-
Notifications
You must be signed in to change notification settings - Fork 148
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
t.rast.import.netcdf: Create STRDS from netcdf-cf data #794
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some minor grammar fixes.
Testing with one of the manual page examples, I get:
./t.rast.import.netcdf.py output=SeNorge semantic_labels=semantic_labels.conf memory=2048 nprocs=2 start_time="2020-08-01" end_time="2021-08-01" input=https://thredds.met.no/thredds/fileServer/senorge/seNorge_2018/Archive/seNorge2018_2020.nc
ERROR 1: CPLCreateUserFaultMapping(): syscall(__NR_userfaultfd) failed
Traceback (most recent call last):
File "/home/veroandreo/software/grass-addons/src/temporal/t.rast.import.netcdf/./t.rast.import.netcdf.py", line 1202, in <module>
sys.exit(main())
File "/home/veroandreo/software/grass-addons/src/temporal/t.rast.import.netcdf/./t.rast.import.netcdf.py", line 1030, in main
inputs_dict = [
File "/home/veroandreo/software/grass-addons/src/temporal/t.rast.import.netcdf/./t.rast.import.netcdf.py", line 1031, in <listcomp>
parse_netcdf(
File "/home/veroandreo/software/grass-addons/src/temporal/t.rast.import.netcdf/./t.rast.import.netcdf.py", line 734, in parse_netcdf
ncdf_metadata = ncdf.GetMetadata()
AttributeError: 'NoneType' object has no attribute 'GetMetadata'
Is this perhaps something on my end?
|
||
<em>t.rast.import.netcdf</em> imports content of one or more NetCDF files into a | ||
GRASS GIS Space Time Raster Dataset (STRDS). NetCDF files are expected to follow | ||
the CF-convention. Files not adhering to those standards may fail to import. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a link to the standards perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link to the cf-convention added in 387c75c
Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
Yes, I think so. In fact I ran into the same issue myself. It is the combination of GDAL version and Linux Kernel: https://www.mail-archive.com/gdal-dev@lists.osgeo.org/msg37419.html Anyway, I added a note in the manual about it. I could add a check for the GDAL version (and OS) as well, but Fedora 36 ships GDAL 3.4.3 and also Ubunutu 20.04 ships newer versions of GDAL, so the issue should disappear on Linux... |
I updated to Fedora 36 and have GDAL 3.4.3 now. I ran the same example than before in the NC location and now it seems it's doing something... This is what I get:
I guess the problem is the region definition and CRS, but it's curious how it got printed... |
Next, I tried in a 4326 location, region Argentina and got this:
I get it that Norwegian climate data won't be available for Argentina ;) but perhaps something can be done with the error that gets printed? |
Ok, now I set the region to Norway in a 4326 location, created the semantic label conf file, but it still produces error:
|
Thanks @veroandreo for bearing with me here. In the code, the GRASS version is checked to figure out if semantic labels can be used. Your test shows, that this is not safe. When you got the projection errors, did you use the version from the latest commit (6e3f80c)? The region setting should only have an effect if you use the r-flag... Norwegian data is out of bounds of the NC CRS, which is why reprojection may fail in that case anyway. Not sure how to catch this though... Anyway thanks for continuous tries and feedback! |
I take the liberty to merge this one now. If there are issues left that I did not catch, please open a bugreport... |
* new module t.rast.import.netcdf * Update src/temporal/t.rast.import.netcdf/t.rast.import.netcdf.html Co-authored-by: Veronica Andreo <veroandreo@gmail.com> * Update src/temporal/t.rast.import.netcdf/t.rast.import.netcdf.html Co-authored-by: Veronica Andreo <veroandreo@gmail.com> * Update src/temporal/t.rast.import.netcdf/t.rast.import.netcdf.html Co-authored-by: Veronica Andreo <veroandreo@gmail.com> * Update src/temporal/t.rast.import.netcdf/t.rast.import.netcdf.html Co-authored-by: Veronica Andreo <veroandreo@gmail.com> * add note about GDAL versions and /vsicurl/ * add link to cfconvention * bugfixes * black * Add cf_units python module to CI * add check for tgis version Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
No description provided.