-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some problems with the netcdf-cf mapper #412
Comments
…ansat.tests.mappers.test_mapper_netcdf_cf
…and added tests. It seems to work correctly now.
…t longitude,latitude - fixed and added test
…rs package. It should only import those that has 'mapper' in the module name. Changed code and added a test.
…ded lists ALLOWED_SPATIAL_DIMENSIONS_X and ALLOWED_SPATIAL_DIMENSIONS_Y that will be checked when selecting band numbers from the netcdf_dim dict.
…py) for generic handling of both netcdf and opendap datasets (see #391). Did not write tests but tried the code on the dataset linked in the issue description. Nansat can now read s1 netcdf files from the Norwegian ground segment but reading some of the bands is *very* slow. This is most likely an issue with the way the files are created. Have e-mailed met.no about it.
Regarding reading the netcdf's from satellittdata.no: OPeNDAP (
Downloaded NetCDF:
10 minutes with gdal vs 0.5 seconds with netCDF4! Then, transform the netcdf file:
This shortens the gdal reading time (but now there is only one band in
netCDF4 takes more time to read the new file compared to the original but is still much faster than gdal... |
Reprojection of the Arome dataset now works with the new updates using the downloaded netCDF files:
|
…o. If a dimension was not added as a variable in the netcdf file, the function _get_band_from_subfile failed. Made test to reproduce the issue and fixed the bug. GDAL complains with GDAL_ERROR 1: b'No 1D variable is indexed by dimension dimension_rgb' but it still works. Also removed a warning issued in a try/except clause.
S2 file: |
…his depends on an external resource and will fails if something is changed there. Added a test for NSR just to increase the coverage.
…ansat.tests.mappers.test_mapper_netcdf_cf
…and added tests. It seems to work correctly now.
…t longitude,latitude - fixed and added test
…rs package. It should only import those that has 'mapper' in the module name. Changed code and added a test.
…ded lists ALLOWED_SPATIAL_DIMENSIONS_X and ALLOWED_SPATIAL_DIMENSIONS_Y that will be checked when selecting band numbers from the netcdf_dim dict.
…py) for generic handling of both netcdf and opendap datasets (see #391). Did not write tests but tried the code on the dataset linked in the issue description. Nansat can now read s1 netcdf files from the Norwegian ground segment but reading some of the bands is *very* slow. This is most likely an issue with the way the files are created. Have e-mailed met.no about it.
…o. If a dimension was not added as a variable in the netcdf file, the function _get_band_from_subfile failed. Made test to reproduce the issue and fixed the bug. GDAL complains with GDAL_ERROR 1: b'No 1D variable is indexed by dimension dimension_rgb' but it still works. Also removed a warning issued in a try/except clause.
…his depends on an external resource and will fails if something is changed there. Added a test for NSR just to increase the coverage.
Demo file: https://thredds.met.no/thredds/fileServer/aromearcticarchive/2019/06/15/arome_arctic_vtk_20190615T15Z.nc (download with, e.g., wget)
The projection based on a subdataset is slightly different from the one based on the projection variable (
projection_lambert
) provided in the netcdf file. It is probably best to use the projection variable if it is present.During work with the above file, I discovered that the selection of bands based on the netcdf_dim kwarg is wrong. The time selection works, but it is not possible to filter on the pressure dimension (ref above file).
Nansat fails to open a downloaded S1A file (
wget http://nbstds.met.no/thredds/fileServer/NBS/S1A/2019/06/15/IW/S1A_IW_GRDM_1SDV_20190615T151935_20190615T152004_027692_03202F_6E58.nc
). Also, the scatterometer mapper is selected by Nansat, although it should be the netcdf-cf mapper. We may need to make a specific S1 netcdf-cf mapper.If I reproject the arome dataset to an S1 dataset (
http://nbstds.met.no/thredds/dodsC/NBS/S1A/2019/06/15/IW/S1A_IW_GRDM_1SDV_20190615T151935_20190615T152004_027692_03202F_6E58.nc
) available from opendap), the bands cannot be read. Changing the projection as suggested above (point 1) makes it readable, but all the data is NaN. It works fine if I use the opendap version of the arome dataset (https://thredds.met.no/thredds/dodsC/aromearcticarchive/2019/06/15/arome_arctic_vtk_20190615T15Z.nc
).Also check S2 netcdf datasets
The text was updated successfully, but these errors were encountered: