Jump to content

Mesoscale coordinates to lat/long?


Recommended Posts

Hello,

I had a couple of questions I hope someone can help with. I have been able to download some data from the mesoscale atlas, but am struggling with getting the data to position correctly. How do the south_north and west_east values relate to lat/lon, and how can we interpret them as such? I can view the associated CRS in Panoply and display the data there but when I try in anything else (using the CRS defined) everything plots in the wrong place.

Best regards,

Julian

Link to comment

You could use the windkit package (pip install windkit) to convert to latitude longitude using the function reproject. However, it won't be a raster anymore because the coordinate spacing varies in both south-north and west-east. So you can only plot it if you keep the original projection, which is given in the variable "crs".

import windkit as wk
import matplotlib.pyplot as plt
import xarray as xr
 
test=xr.open_dataset("/home/rofl/newa_elev.nc").set_coords("crs")
test.elevation.plot()
image.png.bb3c5e4810333571f6f32d0302505736.png
 
test_latlon=wk.spatial.reproject(test,"EPSG:4326")
test_latlon.elevation.plot()
image.png.472a5947c543db612b02f45988f7f004.png
Edited by Rogier
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...