Earth-GRAM 2010 Interface software

Contents:

Python interface to NASA Earth-GRAM2010 software.

NOTE:

You must manually set the ‘exec’ variable in this module.

REQUIREMENTS:

NASA Earth-GRAM2010 software (available on request from NASA)

atpy

numpy

TO-DO_LIST:

Automatically search path for executable, rather than require manual setting.

Be much smarter about scraping data from the ASCII files (e.g., BeautifulSoup?)

HISTORY:

2011-10-19 13:10 IJMC: Created.

class gram.box[source]

Empty object container.

gram.findBreaks(lines, delim='-----')[source]

Find section breaks in a GRAM output text file.

INPUTS:
lines : sequence of strings

Text lines; data contents to be parsed.

OPTIONS:
delim : string

String which, if found within any string of ‘lines’, indicates a new section.

OUTPUT:
locs : sequence of ints

indices of each section break within lines.

NOTES:

Note that no end-of-file index will be returned, unless the proper delimiter is found there.

gram.genAtm(outputFile, speciesFile, filename=None, clobber=False, species=['H2O', 'O3', 'N2O', 'CO', 'CH4'])[source]

Generate .atm-format ASCII text from GRAM atmospheric data.

INPUTS:
outputFile : str or box

GRAM ‘output.txt’ file name, or output of readOutput(). If the latter, elements must have the same size as speciesFile.

speciesFile : str or box

GRAM ‘species.txt’ file name, or output of readSpecies(). If the latter, elements must have the same size as outputFile.

OPTIONS:
filename : str

Filename to write data to (if any)

clobber : bool

if True, overwrite existing filename (if any)

species : list of strings

species to write into output file.

OUTPUTS:
lines : list of strings

Strings for writing to disk (or written to disk, if filename is not None)

NOTES:
Formatting is as follows (note that some units are different than for GRAM):

%ALT PRES TEMP DENSITY H20 O3 N20 CO CH4 %(KM) (MB) (K) (CM-3) (PPMV) (PPMV) (PPMV) (PPMV) (PPMV)

0.00 1.013E+03 299.7 2.450E+19 2.59E+04 2.87E-02 3.20E-01 1.50E-01 1.70E+00

120.00 2.250E-05 380.0 4.225E+11 2.00E-01 5.00E-04 1.85E-04 5.00E+01 3.00E-02

I (IJMC) use these .atm files with D. Feldman’s LBLRTM Matlab wrapper scripts

SEE_ALSO:

readOutput(), readSpecies()

gram.readOutput(filename, verbose=False)[source]

Parse a GRAM2010 ‘output.txt’ output file.

INPUTS:
filename : str

filename of desired output.txt output file.

OPTIONS:
verbose : bool

if True, display additional debugging information.

OUTPUTS:

data structure

NOTES:
Refer to NASA/TM-2011-216467, Appendix D.1, for the appropriate

formatting of the species.txt file.

Tested for GRAM v2.0 (May 2011); changes in data formatting may

cause some aspects of this to function improperly.

TO_DO:Much additional data: RRA sites, winds, variability parameters, etc.
SEE_ALSO:readSpecies()
gram.readSpecies(filename, verbose=False)[source]

Parse a GRAM2010 ‘species.txt’ output file.

INPUTS:
filename : str

filename of desired speciest.txt output file.

OPTIONS:
verbose : bool

if True, display additional debugging information.

OUTPUTS:

data structure

NOTES:
Refer to NASA/TM-2011-216467, Appendix D.2, for the appropriate

formatting of the species.txt file.

Tested for GRAM v2.0 (May 2011); changes in data formatting may

cause some aspects of this to function improperly.

SEE_ALSO:readOutput()

Previous topic

Web stuff

Next topic

Pythonrc

This Page