Open mortenwh opened 9 years ago
Btw - I also removed the try-except lines in __getitem__
- if such value replacements fail it should cause errors, otherwise we'll get difficulties in debugging when problems arise... Please be very careful with try-except.
orig.export2thredds(ncfile, bands = {'incidence_angle': {}}) in TestRadarsat.test_export2thredds() does not work because dataset with GCPs cannot export for Thredds. The problem should be fixed in export().
Don't worry about that now - we can reproject the image to make it work later. It should be tested in any case but first the export function should be improved
orig.export2thredds(ncfile, bands = {'incidence_angle': {}}) in TestRadarsat.test_export2thredds() does not work because dataset with GCPs cannot export for Thredds. The problem should be fixed in export().
— Reply to this email directly or view it on GitHub https://github.com/nansencenter/nansat/issues/123#issuecomment-77172064.
It is related to issue42. I will test how it works if pixelfunction returns NaN. (a6286a9)
Great - that will probably work and both issues should be solved :) perfect
It is related to issue42. I will test how it works if pixelfunction returns NaN. (a6286a9 https://github.com/nansencenter/nansat/commit/a6286a96d43682c67ff9deec032d2ed1c1db60eb )
— Reply to this email directly or view it on GitHub https://github.com/nansencenter/nansat/issues/123#issuecomment-77243780.
When I export a Radarsat-2 image to netcdf, the
_FillValue
metadata item is set to9.96921e+36
whereas the actual invalid data points arefloat(-10000)
. This causes the__getitem__
function in Nansat to fail. I have created a quick hack to set all values equal tofloat(-10000)
in thenp.array
tonp.nan
when_FillValue
is9.96921e+36
but this should be corrected such that the_FillValue
provided in the metadata is the same as the actual invalid data. See b7fba1f0b566a793f6f83b4619087069091a7d4b.This problem seems to be solved in the export2thredds function, and probably the same fix should apply also in the export-function. If so, please make sure that code is not duplicated but that export and export2thredds use a common function.
I have created three tests for checking:
nansat.tests.test_export_netcdf
(in the develop branch) which tests test_file_gcps by setting some band values to nan, then exports to a netcdf. This seems to work.mapper_tests.test_mappers.TestRadarsat.test_export2thredds
(in the master branch) which does not yet work because I didn't add all the parameters (see the code)mapper_tests.test_mappers.TestRadarsat.test_export
(in the master branch) which tests export of a radarsat-2 fileSo, the tasks in this issue are to
_FillValue
item equals the actual values of invalid datanansat.Nansat.__getitem__