Table of Contents

Module: globalIsprint madrigalWeb/globalIsprint.py

This script runs a global search through Madrigal data from a given URL.

This script is a stand-alone application, and can be run from anywhere with a connection to the internet. It runs on either unix or windows. It requires only the MadrigalWeb python module to be installed.

Usage:

globalIsprint --url=<Madrigal url> --parms=<Madrigal parms> --output=<output file> \ --user_fullname=<user fullname> --user_email=<user email> \ --user_affiliation=<user affiliation> [options]

where:

--url=<Madrigal url> - url to homepage of site to be searched (ie, http://madrigal.haystack.mit.edu/madrigal/) This is required.

--parms=<Madrigal parms> - a comma delimited string listing the desired Madrigal parameters in mnemonic form. (Example: gdalt,dte,te). Data will be returned in the same order as given in this string. See http://madrigal.haystack.mit.edu/cgi-bin/madrigal/getMetadata and choose "Parameter code table" for all possible parameters

--output=<output file name> - the file name to store the resulting data.

--user_fullname=<user fullname> - the full user name (probably in quotes unless your name is Sting or Madonna)

--user_email=<user email>

--user_affiliation=<user affiliation> - user affiliation. Use quotes if it contains spaces.

and options are:

--startDate=<MM/DD/YYY> - start date to filter experiments before. Defaults to allow all experiments.

--endDate=<MM/DD/YYY> - end date to filter experiments after. Defaults to allow all experiments.

--inst=<instrument list> - comma separated list of instrument codes or names. See Madrigal documentation for this list. Defaults to allow all instruments. If names are given, the argument must be enclosed in double quotes. An asterick will perform matching as in glob. Examples: (--inst=10,30 or --inst="Jicamarca IS Radar,Arecibo*")

--expName - filter experiments by the experiment name. Give all or part of the experiment name. Matching is case insensitive and fnmatch characters * and ? are allowed. Default is no filtering by experiment name.

--fileDesc - filter files by their file description string. Give all or part of the file description string. Matching is case insensitive and fnmatch characters * and ? are allowed. Default is no filtering by file description.

--kindat=<kind of data list> - comma separated list of kind of data codes. See Madrigal documentation for this list. Defaults to allow all kinds of data. If names are given, the argument must be enclosed in double quotes. An asterick will perform matching as in glob. Examples: (--kindat=3001,13201 or --kindat="INSCAL Basic Derived Parameters,*efwind*,2001")

--filter=<[mnemonic] or [mnemonic1,[+-*/]mnemonic2]>,<lower limit1>,<upper limit1>[or<lower limit2>,<upper limit2>...] a filter using any measured or derived Madrigal parameter, or two Madrigal parameters either added, subtracted, multiplied or divided. Each filter has one or more allowed ranges. The filter accepts data that is in any allowed range. If the Madrigal parameter value is missing, the filter will always reject that data. Multiple filter arguments are allowed on the command line. To skip either a lower limit or an upper limit, leave it blank. Examples: (--filter=ti,500,1000 (Accept when 500 <= Ti <= 1000) or --filter=gdalt,-,sdwht,0, (Accept when gdalt > shadowheight - that is, point in direct sunlight) or --filter=gdalt,200,300or1000,1200 (Accept when 200 <= gdalt <= 300 OR 1000 <= gdalt <= 1200))

--seasonalStartDate=<MM/DD> - seasonal start date to filter experiments before. Use this to select only part of the year to collect data. Defaults to Jan 1. Example: (--seasonalStartDate=07/01) would only allow experiments after July 1st from each year.

--seasonalEndDate=<MM/DD> - seasonal end date to filter experiments after. Use this to select only part of the year to collect data. Defaults to Dec 31. Example: (--seasonalEndDate=10/31) would only allow experiments before Oct 31 of each year.

--showFiles - if given, show file names. Default is to not show file names.

--showSummary - if given, summarize all arguments at the beginning. Default is to not show summary.

--includeNonDefault - if given, include realtime files when there are no default. Default is to search only default files.

--missing=<missing string> (defaults to "missing")

--assumed=<assumed string> (defaults to "assumed")

--knownbad=<knownbad string> (defaults to "knownbad")

--verbose - if given, print each file processed info to stdout. Default is to run silently.

$Id: globalIsprint.py.html 4436 2014-07-30 20:22:43Z brideout $

Functions   
filterExperimentFilesUsingFileDesc
filterExperimentFilesUsingKindat
filterExperimentFilesUsingStatus
filterExperimentsUsingExpName
filterExperimentsUsingSeason
getExperimentFileList
getInstrumentList
getTimeParms
getTimesOfExperiment
  filterExperimentFilesUsingFileDesc 
filterExperimentFilesUsingFileDesc ( expFileList,  fileDesc )

filterExperimentFilesUsingFileDesc returns a subset of the experiment files in expFileList with filtered using fileDesc string and case-insensitive fnmatch.

Input:

expFileList - a list of MadrigalExperimentFile objects to be filtered.

Returns:

a subset of expFileList with default status

  filterExperimentFilesUsingKindat 
filterExperimentFilesUsingKindat ( expFileList,  kindat )

filterExperimentFilesUsingKindat returns a subset of the experiment files in expFileList whose kindat is found in kindat argument.

Input:

expFileList - a list of MadrigalExperimentFile objects to be filtered

kindat - the kindat argument passed in by the user - comma separated list of kind of data codes. If names are given, the argument must be enclosed in double quotes. An asterick will perform matching as in glob.

Returns:

a subset of expFileList whose kindat values are accepted

  filterExperimentFilesUsingStatus 
filterExperimentFilesUsingStatus ( expFileList )

filterExperimentFilesUsingStatus returns a subset of the experiment files in expFileList with default status.

Input:

expFileList - a list of MadrigalExperimentFile objects to be filtered.

Returns:

a subset of expFileList with default status

  filterExperimentsUsingExpName 
filterExperimentsUsingExpName ( expList,  expName )

filterExperimentsUsingExpName returns a subset of the experiments in expList whose name matches.

Input:

expList - a list of MadrigalExperiment objects to be filtered

expName - filter experiments by the experiment name. Can be all or part of the experiment name. Matching is case insensitive.

Returns:

a subset of expList whose names are accepted

  filterExperimentsUsingSeason 
filterExperimentsUsingSeason (
        expList,
        seasonalStartDate,
        seasonalEndDate,
        )

filterExperimentsUsingSeason returns a subset of the experiments in expList whose date is within the given season.

Input:

expList - a list of MadrigalExperiment objects to be filtered

seasonalStartDate - in form MM/DD - seasonal start date to filter experiments before

seasonalEndDate - in form MM/DD - seasonal end date to filter experiments after

Returns:

a subset of expList whose times are accepted

Exceptions   
ValueError, 'seasonalEndDate must be in form MM/DD: ' + str( seasonalEndDate )
ValueError, 'seasonalStartDate must be in form MM/DD: ' + str( seasonalStartDate )
  getExperimentFileList 
getExperimentFileList (
        server,
        expList,
        verbose,
        )

getExperimentFileList returns a list of MadrigalExperimentFile objects given an experiment list.

Inputs:

        server - the active MadrigalData object to get information from

        expList - the list of desired MadrigalExperiment objects

        verbose - if True, print verbose output

Returns:

a list of MadrigalExperimentFile objects

  getInstrumentList 
getInstrumentList ( inst,  server )

getInstrumentList takes the user argument inst and coverts it into a list of instrument codes.

Inputs:

inst - a string containing a comma separated list of instrument codes or names. If names are given, the argument must be enclosed in double quotes. An asterick will perform matching as in glob. Both names and codes may be mixed together.

server - the active MadrigalData object to get information from

Returns:

a list of instrument codes (int). Instrument code 0 means all instruments

  getTimeParms 
getTimeParms (
        expTimeList,
        numIter,
        j,
        )

getTimeParms creates arguments to be passed to isprint to get only a slice of an experiment's data

Input:

expTimeList: a list of experiment start and end times:startyear, startmonth, startday, starthour, startmin, startsec, endyear, endmonth, endday, endhour, endmin, endsec

numIter - the number of pieces to break the experiment into

j - this iteration

Returns - a string in the form ' date1=01/20/1998 time1=09:00:00 date2=01/20/1998 time2=10:30:00 ' that will cause isprint to only examine a slice of the data.

  getTimesOfExperiment 
getTimesOfExperiment ( expList,  expId )

getTimesOfExperiment returns a list of the start and end time of the experiment given expId.

Input:

expList - the list of MadrigalExperiment objects

expId - the experiment id

Returns:

a list of: (startyear, startmonth, startday, starthour, startmin, startsec, endyear, endmonth, endday, endhour, endmin, endsec)


Table of Contents

This document was automatically generated on Wed Jul 30 15:08:34 2014 by HappyDoc version r1_5