Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue overlapping model data to Google map background #239

Open
alessandroanav opened this issue Apr 22, 2024 · 0 comments
Open

Issue overlapping model data to Google map background #239

alessandroanav opened this issue Apr 22, 2024 · 0 comments

Comments

@alessandroanav
Copy link

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:

  • time (time) datetime64[ns] 8B 2023-06-10
  • lon (lon) float32 17kB -180.0 -179.9 -179.8 ... 179.8 179.9 180.0
  • 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.

Model_data
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)  

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):

sm                    = Map(g.grid, factor=1, countries=False)
x, y                  = sm.grid.transform(lon, lat)

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.

Model_on_google_map

Any insight of this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant