Rotate PPI plot

123 views
Skip to first unread message

Yogesh Kolte

unread,
Oct 16, 2015, 2:41:25 AM10/16/15
to Py-ART Users
Hello ,
          I am plotting PPI plot from following code :

import matplotlib.pyplot as plt
import pyart


filename = '/home/user/Desktop/Kasper/21April2014/KASPR_20140421-094731_vpp.nc'

radar = pyart.io.read_cfradial(filename)
radar.metadata['instrument_name'] = 'MDV'
sweep_number=radar.sweep_number['data']

for snum in radar.sweep_number['data']:
    fixed_angle = radar.fixed_angle['data'][snum]
    display = pyart.graph.RadarDisplay(radar)
    fig1 = plt.figure(figsize=[30,30])
    ax1 = fig1.add_subplot(111 )
    display.plot_ppi('DBZ', snum, vmin=-50, vmax=40,ax=ax1)
    display.plot_range_rings([5, 10, 15, 20, 25, 30])
    plt.setp( rotation=90)
    plt.savefig('KaP_DBZ_'+ repr(snum) +'_' + display.time_begin.isoformat(),bbox_inches='tight')
    plt.show()


I need to rotate the plot clock wise by 90 degree  so how can i rotate in Py-ART? I am attaching image of PPI plot.
PPI_DBZ_702014-04-21T09:47:31.png

Jonathan Helmus

unread,
Oct 16, 2015, 12:02:23 PM10/16/15
to pyart...@googlegroups.com
Yogesh,

    I'm a little unclear by what exactly you are looking to do, and at least on my setup the "plt.setp(rotation=90)" line of the script is invalid. 

There are a number of ways in which you can rotate a PPI plot.  The easiest is to add 90 degrees to each azimuthal angle in the radar and generate the plot using the RadarDisplay class:

radar.azimuth['data'] = (radar.azimuth['data'] + 90.) % 360.

You will need to modify the axes labels to reflect the fact that the X-axis is South to North and the Y-axis is East to West. 

Cheers,

    - Jonathan Helmus
--
You received this message because you are subscribed to the Google Groups "Py-ART Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyart-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages