GIS4WRF / gis4wrf

QGIS toolkit 🧰 for pre- and post-processing 🔨, visualizing 🔍, and running simulations 💻 in the Weather Research and Forecasting (WRF) model 🌀
https://gis4wrf.github.io
MIT License
159 stars 36 forks source link

qgis crashes by attempting to load as mesh netcdf wrf files once GIS4WRF started #144

Closed uranoscopus closed 4 years ago

uranoscopus commented 4 years ago

Describe the bug I loaded some wrf nc file with GIS4WRF. It also generates a CRS user-defined which corresponds to what defined by the WRF setup (done externally to GIS4WRF). I'm also able to see fields etc, BUT I would like to exploit new mesh potentialities (e.g. vector fields visualization for instance) of qgis. So I try to load the SAME file with mesh qgis tool. I load the file and ASSIGN the CRS generated by the system. QGIS crashes. If I do the same WITHOUT loading GIS4WRF plugins, QGIS doesn't crash BUT, when assigning the same generated projection, the field is not projected correctly as one could expect. The field is even Flipped upside down, and coordinates are wrong. the projection recognized is the following: Proj4 +proj=lcc +lat_1=30 +lat_2=60 +lat_0=39.35000228881836 +lon_0=9 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs

To Reproduce Steps to reproduce the behavior:

  1. Open a brand new QGIS project
  2. Click on GIS4WRF icon
  3. Click on Layer-->Add Layer-->Add WRF Netcdf Layer....
  4. Select a WRF netcdf File
  5. Visualize a field from the "View" tab of GIS4WRF window
  6. Click on Layer-->Data Source Manager-->Mesh
  7. Select as "Mesh dataset" the same wrf netcdf file and "Add" it to the project
  8. A window will ask you to select a CRS (at least in my case do not recognise the CRS). Select the same CRS generated during the use of GIS4WRF
  9. The layer is not even visible even if loaded....the QGIS crashes after a while

Expected behavior The system should load the file correctly and overlay it on the previously loaded layers.

Operating System Information (please complete the following information): GIS4WRF version 0.14.1 QGIS version 3.8 Zanzibar on MacOS Mojave 10.14.5

Additional context Add any other context about the problem here.

dmey commented 4 years ago

Thanks for reporting this issue. This issue is not a bug in GIS4WRF. The mesh source option available in QGIS relies on the Mesh Data Abstraction Library which, as I understand, is compatible with NetCDF (CF convention complaint http://cfconventions.org/). You can see that some issues have already been reported (e.g. https://github.com/lutraconsulting/MDAL/issues/132 and https://github.com/lutraconsulting/MDAL/issues/130) about related issue. WRF output files are non CF complaint. I think this is the issue (not having had time to investigated the matter) -- we have described this in the GIS4WRF paper already (see http://dx.doi.org/10.1016/j.envsoft.2018.10.018). The fact that QGIS freezes is not good however and you should probably report this to https://github.com/lutraconsulting/MDAL/ and link to this issue (simply copy and paste the URL of this issue when reporting the issue with MDAL). Hope this helps.

uranoscopus commented 4 years ago

Yes thanks, I just realized that sometimes the mesh tool MDAL based crashes even with GIS4WRF turned off...it more strictly depends, as you said, by the attempt to load non-CF netcdf files. Good to know this. I'll try other ways Thanks Antonio

dmey commented 4 years ago

Good, I will close this for now but feel free to comment/link/report fixes or workarounds you may find.