Skip to main content
3 of 3
Add rioxarray tag; removed TIA
Vince
  • 20.3k
  • 16
  • 48
  • 65

Creating (x,y) coordinates in .nc from .grib2

I have to use a .nc file as input in a model and such model requires projection_x_coordinate and projection_y_coordinate as variables but I don't have them. Is it possible to create them using pyproj, for instance? (file available here). My projparams are:

{'a': 6371229,
 'b': 6371229,
 'proj': 'stere',
 'lat_ts': 60.0,
 'lat_0': 90.0,
 'lon_0': 264.0}

My first idea was to use the information of the number of points (Nx in the file), the horizontal resolution (Dx) and the first points (e.g. latitudeOfFirstGridPointInDegrees) to create the desired variables but I don't know if it is the right thing to do.