Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

[RESOLVED] Issue with latitude axis shift in topography plotting using WRF-Python and imshow

Arty

Member
Hello,

I encountered a small issue while plotting the topography for my main domain and nested ones. It seems that the pixels in the imshow plots are slightly shifted along the latitude axis, though the longitude axis is interpreted correctly. Please refer to the attached image for details.

I have included the script I use for plotting in case anyone wants to review it. I attempted to convert from Mercator to PlateCarree projection, but this resulted in blank maps. This outcome is understandable since I believe the WRF-Python latlon_coords function already transforms grid cell positions to a Lat/Lon coordinate system.

I would appreciate any insights or suggestions to correct this issue. It's not a major problem, but I would like to ensure the plots are accurate.

Thanks 🙏
 

Attachments

  • TOPO_LAT_SHIFT_V01.png
    TOPO_LAT_SHIFT_V01.png
    357.3 KB · Views: 4
  • topo_display.txt
    5.8 KB · Views: 1
The issue arose from using imshow, which was not suitable for this case. When working with geospatial data where coordinates are involved, it is more appropriate to use pcolormesh instead. pcolormesh directly maps a 2D array to pixels and aligns them with their respective coordinates, providing better accuracy in both size and position.

Comparing the two images I uploaded, you can see that the difference in the size and position of pixels is significant. The pcolormesh function provides a more accurate representation and should be preferred in such scenarios.
 

Attachments

  • TOPO_GNUPLOT2_V02.png
    TOPO_GNUPLOT2_V02.png
    331.3 KB · Views: 4
  • topo_display.txt
    5.8 KB · Views: 2
Top