Table of Contents

Class: madHistogram ui/madrigalPlot.py

madHistogram is the class that produces Histogram plots of Madrigal Data.

Usage example:

            obj = madHistogram(isprintText,
                                'Nel (log(m^-3)) - Millstone Hill - Oct. 30, 2005 - Alt. code',
                                'Hours since midnight UT Oct. 30,2003'
                                'Altitude',
                                './isprint.png'
                                size = 'large')

Inputs:

isprintText - a string giving isprint output without headers. Any missing data should be written as missing or other string that cannot be converted into a float. Only one column.

TitleStr - plot title(string) - should describe the plot being made

xLabelStr - Label for x axis

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

size - size of plot to be saved. Must be small,'wide', or large. Defaults to small

maxNumPoints - maximum number of points to be considered. Defaults to None, so all points in string shown

numBins - number of bins to be used to store the data. More bins means closer resolution in Histogram. Default is 30

orientation - whether histogram shows horizontal or vertical. Must be written as horizontal or vertical, or exception thrown--defaults to vertical

isNorm - whether histogram should be normalized or not. Default is 0, or False

isBottom - If true, sets the lowest passed value as zero

sdevs - number of standard deviations to take into account. When 0 is passed to it, this option is ignored and all data is included in the distribution; otherwise, the range of values accepted is sdevs*(standard deviation of sample)

Outputs:

A .png file is written to the fullFilename path given, resulting in a Histogram drawn by matplotlib

Change History:

Written by Brandon Scott Fines Aug. 1,2006 Written by Bill Rideout Aug. 1,2006

Methods   
__filter_missing
__init__
__truncateIsprintStr
removeOutliers
  __filter_missing 
__filter_missing ( self,  x )

  __init__ 
__init__ (
        self,
        isprintText,
        titleStr,
        xLabelStr,
        fullFilename,
        size='small',
        maxNumPoints=None,
        numBins=30,
        Orientation='vertical',
        isNorm=0,
        isBottom=0,
        sdevs=0,
        )

__init__ writes a madHistogram string to file

Exceptions   
ValueError, 'input text is not parseable'
ValueError, 'size must be "small","wide" or "large", not %s' %(str( size ) )
  __truncateIsprintStr 
__truncateIsprintStr (
        self,
        isprintText,
        maxLines,
        )

__truncateIsprintStr truncates isprintText to have maxLines at most.

  removeOutliers 
removeOutliers (
        self,
        ndevs,
        values=[],
        )


Table of Contents

This document was automatically generated on Fri May 30 14:39:57 2008 by HappyDoc version r1_5