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

Problems with the use of "plot_grd" function of the module "maps" #207

Closed
Bohr-niels opened this issue May 30, 2024 · 4 comments · Fixed by #212
Closed

Problems with the use of "plot_grd" function of the module "maps" #207

Bohr-niels opened this issue May 30, 2024 · 4 comments · Fixed by #212

Comments

@Bohr-niels
Copy link

Can the function "plot_grd" plot the area outside the Antarctic region?
I want to plot the Beaufort Sea in the Arctic, but there are some problems with the projection of the map, the right map with a correct projection is like this:
image
but now using the "plot_grd" I get the map below:
image
I think it should be the wrong projection setting, but the "plot_grd" function doesn't contain the projection parameter, and in the reference documentation I haven't found the relevant information yet.

@mdtanker
Copy link
Owner

mdtanker commented Jun 3, 2024

Hi @Bohr-niels , that is a well timed question! I've just added support for plotting maps of the Arctic/Greenland. This is currently in PR #212, which will be released in the next few weeks, or you can clone the branch mdtanker-patch-3 and install it locally. There should be some instructions for how to do that in the docs. Let me know if you need help.

Currently I only support plotting with either EPSG 3031, South Polar Stereographic (for antarctica, south of -60°), and EPSG 3413, Sea Ice Polar Stereogrpahic (for greenland and the arctic, north of 60°).

The projections for the figures are set with the function utils.set_proj which is called internally in maps.plot_grd. In the branch above, you must tell polartoolkit which of these projections you want to use with the keyword argument hemisphere with a value of "north" or "south", for whichever hemisphere you want.

If your data is already in EPSG 3413, then plot_grd should work if you pass hemisphere="north". If not, you'll need to reproject it, let me know if you need help with that.

@Bohr-niels
Copy link
Author

Thanks a lot, @mdtanker. My data is geographic data in LLZ formats, so if I want to use plot_grd to map it, Should I first reproject it to XYZ formats using EPSG 3413? Maybe pygmt tool helps this work?

@mdtanker
Copy link
Owner

mdtanker commented Jun 4, 2024

Yeah first reproject it. I use rioxarray to project from lat lon to meters, see here for an example or projecting to EPSG 3031. Should work to just replace 3031 with 3413.

@mdtanker
Copy link
Owner

mdtanker commented Jun 4, 2024

Should be closed when #212 is merged.

This was linked to pull requests Jun 11, 2024
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

Successfully merging a pull request may close this issue.

2 participants