Table of Contents

Class: madPcolorScan ui/madrigalPlot.py

madPcolorScan is the class that produces pcolor scans.

Usage example:

        obj = madPcolorScan(isprintText,
                        'Nel (log(m^-3)) - 26 June 2006 13:49:43-14:07:36',
                        'Longitude',
                        'Latitude',
                        './isprint.png',
                        size = 'large',
                        minColormap = 9,
                        maxColormap = 12)    

Non-standard Python modules used: matplotlib

Change history:

Written by Bill Rideout Jul. 20, 2006

Methods   
__filter_input
__init__
__round
__truncateIsprint
displayToScreen
getAverage
getFigureHandle
sortArrayInX
  __filter_input 
__filter_input ( self,  x )

__filter_input is called in map to convert missing strings to self.__missing, and to round x and y vales to the nearest xGridSize or yGridSize

  __init__ 
__init__ (
        self,
        isprintText,
        xGridSize,
        yGridSize,
        titleStr,
        xLabelStr,
        yLabelStr,
        fullFilename,
        size='small',
        xMinimum=None,
        xMaximum=None,
        yMinimum=None,
        yMaximum=None,
        minColormap=None,
        maxColormap=None,
        colorMap=matplotlib.cm.jet,
        maxNumLines=None,
        )

__init__ writes a madPcolorScan to a file.

Inputs:

isprintText - a string giving isprint output without headers. First parameter must be the X axis value, and the second must be the Y axis value. The third column is the value (intensity). Any missing data should be written as "missing" or other string that cannot be converted to a float.

xGridSize - grid size for x data (for example 0.1 for 0.1 degree longitude grid)

yGridSize - grid size for x data (for example 0.1 for 0.1 degree latitude grid)

titleStr - plot title (string) - should describe parameter being plotted

xLabelStr - x label string

yLabelStr - ylabel string

fullFilename - full path of file containing pcolor plot to be saved. Extension must be jpeg or png, or exception thrown.

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.

xMaximum = maximum x value. If None (default), uses highest x value found.

yMinimum = minumum y value. If None (default), uses lowest y value found.

yMaximum = maximum y value. If None (default), uses highest y value found.

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

Returns: void

Affects: None

Exceptions   
ValueError, 'No valid z data found'
ValueError, 'input text is not parseable'
ValueError, 'size must be "small", "wide", or "large", not %s' %(str( size ) )
  __round 
__round (
        self,
        value,
        increment,
        )

__round returns a value to the nearest increment

  __truncateIsprint 
__truncateIsprint (
        self,
        isprintText,
        maxLines,
        )

__truncateIsprint truncates isprintText to have maxLines at most.

  displayToScreen 
displayToScreen ( self )

to implement this takes a reworking away from pylab to use the underlying matplotlib code

  getAverage 
getAverage ( self,  X )

returns the average of items in a float array. Does not including missing data. If all data missing, returns self.__missing

  getFigureHandle 
getFigureHandle ( self )

  sortArrayInX 
sortArrayInX ( self,  array_data )

sortArrayInX sorts a two-dimensional array so that the first element in each row (x) is in ascending order.

Input: array_data - two-dimensional array to be sorted by rearranging rows so that the first element in each row (x) is in ascending order

Returns: new_array


Table of Contents

This document was automatically generated on Fri Jul 13 09:36:49 2007 by HappyDoc version r1_5