![]() [remove menu for printing] [comments] [disclaimer] [site map] [search] [compact menu] Last modified Tuesday 26 August |
Command line interface to MadrigalMadrigal contains a number of command line applications that allow access to Madrigal data. Some of these require local access to the files on the Madrigal server, some use the remote API and so can be run from anywhere. This section describes the isprint application in detail, which is relevant both to direct users of the isprint application, and to users of the many API isprint methods that use the same arguments as the isprint command line application. Command line applications:
Remote applications (can be run from anywhere - included in either python or Matlab remote API downloads)
IsprintThe application isprint is used to display both measured and derived data from one particular Cedar/Madrigal file. The input file can be any valid Cedar format. It will generate a table of user selected parameters subject to user specified filters. The name isprint original referred to "Incoherent scatter print" but the application now generically prints any data file in the Cedar format. The engine underlying isprint is the main method for outputting Madrigal data. This application is located in madroot/bin.The isprint application:
To use isprint, the user needs to specify four things:
file= path to file (this argument is required) Simply enter the desired parameter mnemonic (case-insensitive). They will be displayed in the order entered. If none given, only the header records will be displayed. Example: azm gdalt Range ti Dti
date1=mm/dd/yyyy - starting date to be examined. If time1 not given, defaults to 0 UT. time1=hh:mm:ss - starting UT time to be examined. If date1 given, is applied to date1. If not, applies on the first day of the experiment. date2=mm/dd/yyyy - ending date to be examined. If time2 not given, defaults to 0 UT. time2=hh:mm:ss - ending UT time to be examined - If date2 not given, refers to date1. If date1 and date2 not given, refers to 1st day. In the follow arguments ranges are used. If any range value is not given, it may be used to indicate no lower or upper limit (but the comma is always required). Ranges are inclusive of the end points.
z=lower alt limit1, upper alt limit1 [or lower alt limit2 , upper alt limit2 ...] (km)
az=lower az limit1, upper az limit1 [or lower az limit2 , upper az limit2 ...] (from -180 to 180 degrees)
el=lower el limit1, upper el limit1 [or lower el limit2 , upper el limit2 ...] (from 0 to 90)
plen=lower pl limit1, upper pl limit1 [or lower pl limit2 , upper pl limit2 ...] (pulse len in sec)
filter=[mnemonic] or [mnemonic1,[+-*/]mnemonic2] , lower limit1 , upper limit1 [or lower limit2 , upper limit2 ...] (any number of filters may be added)
header=t or f (defaults to header=t, show headers at the beginning of each record) badval=bad value string (defaults to "missing") assumed=assumed value string (defaults to "assumed") knownbad=known bad value string (defaults to "knownbad") mxchar=maximum characters per line (defaults to no maximum) Example: This example would show data from mil980120g.003 between 15 and 16 UT on 01/20/1998 where altitude is either between 200 and 300 km or between 500 and 600 km, and where gdalt-sdwht is greater than 0 (point is in sunlight), and where ti is between 500 and 1000. "noData" would be printed if data was not available.
printCedarRecordsprintCedarRecord prints specified records of a CEDAR file. The file may be any of the 5 supported CEDAR formats (Madrigal, Blocked Binary, Cbf, Unblocked Binary or ASCII"), and may include any mixture of prologue, header and data records. The format of the file is determined automatically. This application is located in madroot/bin.Usage: printCedarRecords filename firstRecord lastRecord summarizeCedarFilesummarizeCedarFile prints a one line per record summary of a CEDAR file. The file may be any of the 5 supported CEDAR formats (Madrigal, Blocked Binary, Cbf, Unblocked Binary or ASCII"), and may include any mixture of prologue, header and data records. The format of the file is determined automatically. This application is located in madroot/bin.Usage: summarize CedarFilefilename globalIsprint.pyThis script runs a global search through Madrigal data from a given URL. It is installed when you install the Remote python API. Because it is a remote program, it can be run from any machine on the internet, using any operating system. It is a python script.
Usage: globalIsprint --url=<Madrigal url> --parms=<Madrigal parms> --output=<output file> \
--user_fullname=<user fullname> --user_fullname=<user fullname> \
--user_fullname=<user fullname> [options]
where: --url=<Madrigal url> - url to homepage of site to be searched
(ie, http://www.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
using http://madrigal.haystack.mit.edu/cgi-bin/madrigal/getMetadata and
choose "Instrument Table"
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
--inst="Jicamarca IS Radar,Arecibo*"
--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
--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) filter=gdalt,-,sdwht,0, (Accept when gdalt > shadowheight - that is, point in direct sunlight) 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 all files, including history. 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.
Example:
globalIsprint.py --url=http://www.haystack.mit.edu/madrigal/ --parms='uth,gdalt,ti' --output=test.dat
--startDate=01/19/1998 --endDate=01/21/1998 --inst="Millstone*" --verbose --user_fullname="Bill Rideout"
--user_email=brideout@haystack.mit.edu --user_affiliation=MIT
globalIsprint.mThis script runs a global search through Madrigal data from a given URL. It is installed when you install the Remote Matlab API. Because it is a remote program, it can be run from any machine on the internet, using any operating system. It is a Matlab script. Because it uses the Matlab method urlread, which has an upper limit to the amount of data it can read in one call, it is not as robust as globalIsprint.py. It is recommended that globalIsprint.py be used instead if at all possible. function [] = globalIsprint(url, ... madrigalPColor.pymadrigalPColor.py is a command-line application that creates PColor plots from Madrigal. For example, it could be used to plot electron density versus altitude and time for a given Madrigal experiment file. This application can be run from anywhere, and is included in the python Madrigal remote API download. Use of this module requires Matplotlib (matplotlib.sourceforge.net). Usage: python madrigalPColor.py --url=<url> --file=<file> --parm=<parm>
--output=<output> --name=<name> --email=<email> --affiliation=<affiliation>
[--filter=<filter> --title=<title>]
See isprint for details of how filters work. Example: python madrigalPColor.py --url=http://madrigal.haystack.mit.edu/madrigal \
--file=/opt/madrigal/experiments/1998/mlh/20jan98/mlh980120g.002 --parm=nel \
--output=/tmp/mlh_20jan98.png --name="Bill Rideout" --email=brideout@haystack.mit.edu \
--affiliation=MIT --filter="filter=elm,80,90 filter=gdalt,,500"
madrigalScatter.pymadrigalScatter.py is a command-line application that creates scatter plots from Madrigal. For example, it could be used to Kp versus time for a given Madrigal experiment file. This application can be run from anywhere, and is included in the python Madrigal remote API download. Use of this module requires Matplotlib (matplotlib.sourceforge.net). Usage: python madrigalScatter.py --url=<url> --file=<file> --parm=<parm> --output=<output> --name=<name> --email=<email> --affiliation=<affiliation> [--filter=<filter> --title=<title>] See isprint for details of how filters work. Example: python madrigalScatter.py --url=http://madrigal.haystack.mit.edu/madrigal \ --file=/opt/madrigal/experiments/1998/mlh/20jan98/mlh980120g.002 --parm=systmp \ --output=/tmp/mlh_20jan98.png --name="Bill Rideout" --email=brideout@haystack.mit.edu \ --affiliation=MIT --filter="filter=elm,80,90"
|