jschap1 / vicglobal-prep

MATLAB scripts for preparing the VICGlobal soil, vegetation, and elevation band parameter files.
5 stars 2 forks source link

Coordinate Reference System of VICGlobal #3

Open pyested opened 5 months ago

pyested commented 5 months ago

Hi, my name is Patricio and I'm working on an implementation of VIC5 in Europe.

Currently I'm extracting the parameters from VICGlobal for the European domain, and according to the paper in Scientific Data, VICGlobal is referenced to WGS84. After comparing the VICGlobal_params.nc file (i.e., parameters for the Image driver) with a shapefile of the Europe coastline (both referenced to WGS84), I see a significant spatial shift (see image below). I've tried with other shapefiles and always see this shift when compared to VICGlobal.

Is there a reason for this? I'm using VICGlobal version 1.6d from zenodo (latest version). The coastline comes from the European Environment Agency in this link: https://www.eea.europa.eu/data-and-maps/data/eea-coastline-for-analysis-1/gis-data/europe-coastline-shapefile

Screenshot from 2024-03-19 14-25-05

pyested commented 5 months ago

I've also tried to use the parameter file for Eurasia, eurasia_params.nc, and in this case it is perfectly aligned with the shapefile of the Europe coastline (see image below). So the shift only appears when using the complete VICGlobal parameter file.

Screenshot from 2024-03-19 14-35-03

jschap1 commented 5 months ago

Hi Patricio,

I do not immediately have an answer for you, as it has been a few years since I put this together. This may be a bug. This is good for users to be aware of.

One thing to look out for (although I am not suggesting that this is the issue here) is that different GIS programs may use a different convention for defining the center of a grid cell. A grid cell's coordinate could be the center of the cell or the bottom left of the cell, for example.

Jacob

pyested commented 5 months ago

Thank you Jacob for your response.

I simply extracted the variable "gridcell" from both netcdfs (global and eurasia) using xarray in Python and then I saved it as geotiff, which later I opened in QGIS together with the coastline setting the CRS to WGS84 for both layers. I also thought it could be related to how QGIS interprets where the center of a grid cell is, but the eurasia netcdf is working fine following the same procedure.

I guess I'll stick to the eurasia file as it is aligned with the coastline and is not so heavy as the global netcdf.