terraref / extractors-hyperspectral

Scripts and code relevant to the SWIR and VNIR cameras.
BSD 3-Clause "New" or "Revised" License
6 stars 6 forks source link

Remove underscore in netCDF filename #29

Closed czender closed 7 years ago

czender commented 7 years ago

@max-zilla @hmb1 I am trying to understand why the output files from the hyperspectral extractor seem to end with "_.nc". The workflow default is to replace the "_raw" filename with ".nc" (no underscore). But this can be overridden by a user-specified output filename. Do you know where the underscore arises? Is there perhaps an extra underscore in the extractor's invocation of the hyperspectral workflow?

/projects/arpae/terraref/sites/ua-mac/Level_1/hyperspectral/2017-04-15/2017-04-15_16-00-00-124/2e4f6f9d-2193-4f3c-8fcd-45010237a9cd.nc

max-zilla commented 7 years ago

It's a bug in my code, good catch:

return '%s.nc' % raw_filename[:-len('raw')]

should be

return '%s.nc' % raw_filename[:-len('_raw')]

This bug would be fixed once I add terrautils to hyperspectral (the only extractor i've not done that for yet) but I fixed bug in current code in meantime. Subsequent files won't have this issue.