scanPlotter is the class that produces a series of scan plots for a single Madrigal file
Non-standard Python modules used:
matplotlib
Change history:
Written by Bill Rideout Jul. 26, 2006
Methods
|
|
__init__
_getInstLocation
_getLimits
createScanInfoList
createWedgeScanInfoList
getDateStrFromUT
getTimeStrFromUT
plotAllScans
plotAllWedgeScans
|
|
__init__
|
__init__ (
self,
madFile,
madDBObj=None,
)
__init__ initializes a scanPlotter object.
Inputs:
madFile - the Madrigal file to be analyzed. Must contain SCNTYP and CYCN parameters.
madDBObj - a madrigal.metadata.MadrigalDB object. If None (default),
one created
Returns: void
Affects: sets self.madFile, self.madDBObj
Exceptions
|
|
IOError, 'unable to read %s' %(str( madFile ) )
|
|
|
_getInstLocation
|
_getInstLocation ( self, isprintStr )
_getInstLocation returns a tuple of instrument location (gdlatr, gdlonr, galtr)
Input isprint string has parameters ut1,scntyp,cycn,<parm>,gdalt,gdlat,glon,azm,elm,gcdist,
gdlatr,gdlonr,galtr,range,az1,az2,el1,el2
|
|
_getLimits
|
_getLimits (
self,
scanList,
xMinimum,
xMaximum,
yMinimum,
yMaximum,
)
_getLimits returns a dictionary with keys that may include (az , el_lat , el_lon , el_gcdist ),
though not all will neccessarily be there. Values are overall tuple of
(xMinimum, xMaximum, yMinimum, yMaximum). These values are set by the input
arguments unless it is None, in which case the scanList limits set the values.
Inputs:
scanList: a list of tuples, which each tuple representing a single scan, and
has values of: (isprintString, startUT, startAz, startEl, endUT, endAz, endEl, type,
minGdlat, maxGdlat,minGlon, maxGdlon,minGdalt, maxGdalt, minGcdist, maxGcdist). Isprint string
has values (gdlatr, gdlonr, galtr, range, az1, az2, el1, el2,plotParm),. Type is Gdlat or Glon or
Gcdist for el scans, None for az scans.
xMinimum, xMaximum, yMinimum, yMaximum - as passed into scanPlotter
|
|
createScanInfoList
|
createScanInfoList ( self, isprintStr )
createScanInfoList creates a list of tuples, which each tuple representing a single scan, and
values of:
(isprintString, startUT, startAz, startEl, endUT, endAz, endEl, type,
minGdlat, maxGdlat,minGlon, maxGdlon,minGdalt, maxGdalt, minGcdist, maxGcdist). Isprint string
has values (x,y,plotParm), where for az scan x=lon, y=lat, and for el scan y=alt, x=lat if starting
az within 15 degrees of north or south, x=lon if starting az within 15 degrees of east or west,
of x=gcdist if other az. Type is Gdlat or Glon or Gcdist for el scans, None for az scans.
Input isprint string has parameters ut1,scntyp,cycn,<parm>,gdalt,gdlat,glon,azm,elm,gcdist
Azimuth scans are split whenever direction or elevation changes. For elevation scans, there will be zero or one
north-south scans, zero or one east-west scans, and zero or more off azimuth scans. An off azimuth
scan is not within 15 degrees of north, south, east or west. Off azimuth scans are not combined with
scans 180 degrees in the other direction, because the x axis is ground distance, which does not reverse
sign.
|
|
createWedgeScanInfoList
|
createWedgeScanInfoList ( self, isprintStr )
createWedgeScanInfoList creates a list of tuples, which each tuple representing a single scan, and
values of:
(isprintString, startUT, startAz, startEl, endUT, endAz, endEl, type,
minGdlat, maxGdlat,minGlon, maxGdlon,minGdalt, maxGdalt, minGcdist, maxGcdist).
Input isprint string has parameters ut1,scntyp,cycn,<parm>,gdalt,gdlat,glon,azm,elm,gcdist,
gdlatr,gdlonr,galtr,range,az1,az2,el1,el2
Azimuth scans are split whenever direction or elevation changes. For elevation scans, there will be zero or more
north-south scans, zero or more east-west scans, and zero or more off azimuth scans. A south to north
elevation scan or a west to east elevation scan is called clockwise, and a switch from clockwise
to counterclockwise will create a new elevation scan. An off azimuth
scan is not within 15 degrees of north, south, east or west. Off azimuth scans are not combined with
scans 180 degrees in the other direction, because the x axis is ground distance, which does not reverse
sign.
|
|
getDateStrFromUT
|
getDateStrFromUT ( self, ut )
getDateStrFromUT returns a date string formated as YYYY-MM-DD HH:MM:SS from a ut time
(seconds since 1/1/1950)
|
|
getTimeStrFromUT
|
getTimeStrFromUT ( self, ut )
getTimeStrFromUT returns a time string formated as HH:MM:SS from a ut time
(seconds since 1/1/1950)
|
|
plotAllScans
|
plotAllScans (
self,
scanType,
fullFilenameTemplate,
plotParm,
size='small',
xMinimum=None,
xMaximum=None,
yMinimum=None,
yMaximum=None,
xGridSize=None,
yGridSize=None,
minColormap=None,
maxColormap=None,
colorMap=matplotlib.cm.jet,
maxNumLines=None,
filterStr='',
)
plotAllScans creates a series of az or el scans.
Inputs:
scanType - must be az or el
fullFilename - full path of file containing pcolor plot to be saved. Each image
created will have _#.png appended, with # starting at 0
plotParm - mnemonic of parameter to be plotted.
size - size of plot to save. Must be "small", "wide", or "large". Defaults to small.
xMinimum = minumum x value. If None (default), uses lowest x value found for each scan.
xMaximum = maximum x value. If None (default), uses highest x value found for each scan.
yMinimum = minumum y value. If None (default), uses lowest y value found for each scan.
yMaximum = maximum y value. If None (default), uses highest y value found for each scan.
minColormap - minimum parameter value (defaults to lowest parameter value)
maxColormap - maximum parameter value (defaults to highest parameter value). However, if
both minColormap and maxColormap == None, autoscaling applied.
colorMap - sets colormap. It not given, defaults to matplotlib.cm.jet
maxNumLine - max number of lines in isprintText before truncating. If None, no truncation
filterStr - a filter string to pass to isprint. Defaults to no filtering
Returns - a list of tuples, where each tuple has two items: 1. time string,
2. metadata string in form for scanTab.txt. List length = number
of plots created
Exceptions
|
|
ValueError, 'scantype must be az or el, not %s' %(str( scanType ) )
|
|
|
plotAllWedgeScans
|
plotAllWedgeScans (
self,
scanType,
fullFilenameTemplate,
plotParm,
size='small',
xMinimum=None,
xMaximum=None,
yMinimum=None,
yMaximum=None,
minColormap=None,
maxColormap=None,
colorMap=matplotlib.cm.jet,
maxNumLines=None,
filterStr='',
addTitle='',
includeKml=False,
radarName=None,
radarDesc=None,
)
plotAllWedgeScans creates a series of az or el scans. Similar to plotAllScans, except produces
fancier wedge plots with uniform scalling.
Inputs:
scanType - must be az or el
fullFilename - full path of file containing pcolor plot to be saved. Each image
created will have _#.png appended, with # starting at 0
plotParm - mnemonic of parameter to be plotted.
size - size of plot to save. Must be "small", "wide", or "large". Defaults to small.
xMinimum = minumum x value. If None (default), uses lowest x value found for each scan.
xMaximum = maximum x value. If None (default), uses highest x value found for each scan.
yMinimum = minumum y value. If None (default), uses lowest y value found for each scan.
yMaximum = maximum y value. If None (default), uses highest y value found for each scan.
minColormap - minimum parameter value (defaults to lowest parameter value)
maxColormap - maximum parameter value (defaults to highest parameter value). However, if
both minColormap and maxColormap == None, autoscaling applied.
colorMap - sets colormap. It not given, defaults to matplotlib.cm.jet
maxNumLine - max number of lines in isprintText before truncating. If None, no truncation
filterStr - a filter string to pass to isprint. Defaults to no filtering
addTitle - a string with additional title. If empty string (the default), no additional title string.
includeKml - if True, create a corresponding kml file for every png file. Same names
as png files, except extension = .kml. If False, do not.
radarName - name to label radar placemark if kml generated.
radarDesc - description text for radar placemark if kml generated
Returns - a list of tuples, where each tuple has two items: 1. time string,
2. metadata string in form for scanTab.txt. List length = number
of plots created
Exceptions
|
|
ValueError, 'scantype must be az or el, not %s' %(str( scanType ) )
|
|
|