You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would overlap my model data to Google map using salem but I am facing an issue when I use data on its original grid. However, if I regrid data to WRF grid the program works perfectly, so I do not understand why on the native grid the script doesn't work. Any help to understand if I am doing something wrong or there is a bug in the code is greatly appreciated.
Please find below the relevant code.
I open and read the netcdf data with xr.open_dataset, which returns:
lat (lat) float32 9kB 89.96 89.88 89.79 89.71 ... -89.79 -89.88 -89.96
Data variables:
fldout (time, lat, lon) float32 37MB ...
To check if data are recognized correctly by salem, I make a quick map with salem.quick_map(varname="fldout"). As data are displayed correctly, I assume salem recognizes the model grid.
Then, I download the google map over a region of interest:
g = GoogleVisibleMap([0, 20.0], y=[20, 60]],
scale=2,
maptype='satellite',use_cache=True)
Hello and sorry for the delay. GoogleMaps are not meant to be overlaid with gridded data, but with vector files. That being said, sm.set_data() should still work and be preferable to transforming your data yourself.
Now, I am attempting to customize the plot, masking values below a given threshold, but I realized the following commands do not work with salem. In particular, this command:
data = np.where( data<200, np.nan, data)
gives the following error message: ValueError: Dimensions of data do not match the map.
While I do not know how to reproduce this into salem:
cmap.set_bad(alpha = 0.0) # NaN values are transparent
Hello,
I would overlap my model data to Google map using salem but I am facing an issue when I use data on its original grid. However, if I regrid data to WRF grid the program works perfectly, so I do not understand why on the native grid the script doesn't work. Any help to understand if I am doing something wrong or there is a bug in the code is greatly appreciated.
Please find below the relevant code.
I open and read the netcdf data with xr.open_dataset, which returns:
Dimensions: (time: 1, lon: 4320, lat: 2160)
Coordinates:
Data variables:
fldout (time, lat, lon) float32 37MB ...
To check if data are recognized correctly by salem, I make a quick map with salem.quick_map(varname="fldout"). As data are displayed correctly, I assume salem recognizes the model grid.
Then, I download the google map over a region of interest:
and transform model grid to the new map, as suggested in this script (https://salem.readthedocs.io/en/v0.3.4/auto_examples/plot_googlestatic.html):
At the end I try to overlap the data to the google map but, as you can see, the model grid does not match the google map.
Any insight of this problem?
The text was updated successfully, but these errors were encountered: