Table of Contents

Class: MadrigalIsprintExe ui/isprintExe.py

MadrigalIsprintExe is a private class designed to get output strings from the maddata engine.

MadrigalIsprintExe is a private class designed to get output strings using the maddata engine and possibly additional python postprocessing.

Non-standard Python modules used: None

Methods   
__getLine
__getNeededParms
__init__
getModifiedIsprintString
  __getLine 
__getLine (
        self,
        filterList,
        lineNum,
        lineList,
        dataList,
        neededParms,
        acceptList,
        )

__getLine is a private function that adds a line of data to acceptList if filters accept the data.

Inputs:

filterList - the list of filter strings to be applied

lineNum - number of present row

lineList - a list of line strings, one for each row

dataList - a list of lists of data elements (may be floats, or special strings such as missing)

neededParms - a list parameters used in filters. Each item in list is a list containing a uppercase mnemonic, and an integer representing column number

acceptList - a list containing accepted line so far

Returns: None.

Affects: Appends the appropriate line from lineList to acceptList if accepted.

Exceptions: None.

  __getNeededParms 
__getNeededParms (
        self,
        parmList,
        filterList,
        )

__getNeededParms is a private function that returns a list of parameters found in filterList.

Inputs:

parmList - a list of mnemonic string parameters being displayed

filterList - the list of filter strings to be applied

Returns: a list which is a subset of parmList of all parameters found in filterList. Each member of the list is a list with two members, the string mnemonic and the position in the parmList where that parameter appears.

Affects: None.

Exceptions: None.

  __init__ 
__init__ ( self,  madDB=None )

__init__ initializes MadrigalIsprintExe by reading from MadridalDB..

Inputs: Existing MadrigalDB object, by default = None.

Returns: void

Affects: Initializes self.__metaDir.

Exceptions: None.

  getModifiedIsprintString 
getModifiedIsprintString (
        self,
        filename,
        parmList,
        filterList=None,
        recordListingStyle=0,
        )

getModifiedIsprintString extends the maddata engine by allowing any possible filter.

getModifiedIsprintString is a function that expands the maddata engine by allowing filtering to include all possible logical expression involving any Madrigal parameters.

Inputs:

filename - full path to madrigal file.

parmList - a list of mnemonic or integer parameters.

filterList - a list of strings filtering the output. They must only contain parameters in mnemonic form that are included in the parmList. See example below for examples. Defaults to None.

recordListingStyle - If 0 (the default), show record summary and all data that meet all filters. If 1, show only the record summary of any record that contains any 2d data that meets all the filters. If 2, show only any 2d data that meets all the filters without record headers.

Returns: String containing report formatted in isprint fashion, or empty string if no data.

Affects: None

Exceptions: If any item in filterList is not a valid logical expression.

Usage example:

            import madrigal.ui.isprintExe

            test = madrigal.ui.isprintExe.MadrigalIsprintExe()

            filepath = os.environ.get('MADROOT') + '/experiments/1998/mlh/20jan98/mil980120g.003'

            parmList = ['range',  'ti', 'TN',  'kinst']

            filterList = ['range > 900 and ti > 2000', 'ti < 2500']

            result = test.getModifiedIsprintString(filename, parmList, filterList)

            print result


Table of Contents

This document was automatically generated on Fri Dec 30 09:02:26 2005 by HappyDoc version r1_5