ocean-transport / argo-intern

Andrew's project
1 stars 1 forks source link

ISSUE: Mapping with cartopy #5

Closed andrewfagerheim closed 2 years ago

andrewfagerheim commented 2 years ago

8 June 2022

When I graphed the glider path using cartopy the results seemed both logically inconsistent and in the wrong place based on what Dhruv and I had discussed. There seemed to be two problems:

image

rabernat commented 2 years ago

You may need to provide the transform argument to plot. See https://earth-env-data-science.github.io/lectures/mapping_cartopy.html#adding-data-to-the-map

jbusecke commented 2 years ago

Can you plot the longitude vs latitude without using the map projection plt.plot(lon,lat)? That will enable us to narrow down if the problem is with the data or is due to the projection details.

andrewfagerheim commented 2 years ago

8 June 2022

@dhruvbalwada first said that I flipped the x and y axes: x should be longitude and y should be latitude. This correctly oriented the glider path (a problem I didn't know existed) but didn't solve either of the two problems outlined above. image

andrewfagerheim commented 2 years ago

9 June 2022

@dhruvbalwada then said it was probably an issue with the projection I was using. So I switched from using the Robinson projection to the Platte Carree projection and this seemed to fix both issues. Both the scale and location seem much more reasonable.

image (1)

rabernat commented 2 years ago

In general, you should always specify transform=ccrs.PlateCarree() in your call to plot if you data are specified in lat lon. That will allow you to use any projection. Try it with Robinson and see if it works.

andrewfagerheim commented 2 years ago

Yes that worked, thanks for the help!! I think that can close this issue image