NAME

Text::NASA_Ames - Reading data from NASA Ames files

SYNOPSIS

my $nasaAmes = new Text::NASA_Ames('this_file');
# or
$nasaAmes = new Text::NASA_Ames(new IO::File "this_file", "r");
print STDERR "3 independent variables";
$nasaAmes->nAuxV; # number of (real) auxiliary variables not containing
                  # a independent variable
$nasaAmes->nV; # number of independent variables


# scanning through the file:
while (my $entry = $nasaAmes->nextDataEntry) {
   my @X = @{ $dataEntry->X };
   my @aux = @{ $dataEntry->A };
   my @V = @{ $dataEntry->V };
}

DESCRIPTION

This is the factory class for reading on of the Text::NASA_Ames formats (currently 9). The function-names are related to the format specification as in http://cloud1.arc.nasa.gov/solve/archiv/archive.tutorial.html by Gaines and Hipkinds.

PUBLIC METHODS

METHODS FROM SPECIFICATIONS

All lists are returned as references to lists.

The names of the public methods are identical to the format specifications. In some formats, auxiliary variables are misused to store independent variables. In those cases, I return the real number of auxiliary variables with nAuxV and not nAuxV as sum of auxiliray variables plus stored independent variables as written in the file.

a

not implemented, see nextDataEntry

aMiss

list of missing values of the auxiliary variables

aName

list of names of the auxiliary variables

aScal

list of scaling factors of the auxiliary variables

date

UT date marking the beginning of the data: format 'YYYY MM DD'

dX

list of interval between the indep. variables (0 means no linear interval)

ffi

File Format Index of the parsed file

iVol

total number of volumes belonging to complete dataset (see nVol) (starting at 1)

lenA

list of character length of the auxiliary string variables

lenX

list of character length of the independent string variables

mName

mission name

nAuxC

number of auxiliary string variables

nAuxV

number of total auxiliary variables (including string variables). The numeric auxiliary variables come allways in front of the string variables.

nCom

list of normal comment strings

nIV

number of independent variables (== first number of ffi)

nLHead

number of header lines

nNComL

number of normal comment lines

nSComL

number of special comment lines

nV

number of primary variables

nVol

total number of volumes required to store complete dataset

nVPM

number of independent variable between variable marks

nX

list of numbers of values of the primary variables

nXDef

list of numbers of values of the independent variable defined in the header

oName

originator name

org

originators organization

rDate

date of last revision (format as data)

sCom

list of special comment lines

sName

source name

v

not implemented, see nextDataEntry

vMiss

list of missing values of the variables

vName

list of variable names

vScal

list of scaling factor of variables

x

might be used for temporary variables, for iterator-access, see nextDataEntry

xName

list of variable names

ADDITIONAL METHODS

new (filename || IO::File)

parse the first line and distribute the file to the correct Text::NASA_Ames::FFI object;

currentLine

the current line in the file, starting at 1

nextLine

get the next chomped/trimmed line from the file and set the currentLine counter

dataBuffer

set/get the complete dataBuffer. Don't use this method manually without knowing what you're doing. Think about using nextDataEntry.

nextDataEntry

fetch the next Text::NASA_Ames::DataEntry from the dataBuffer, which will be filled automatically. The data will not be set to memory.

INTERNALS

The variables (primary and auxiliary) are stored in the following structure:

$self->{_variables}{X1}{..}{Xn}->{V} = [v1..vn]
$self->{_variables}{X1}{..}{Xn}->{A} = [a1..an]

CAVEATS

It is possible to modify a lot of variables which should be read-only.

In the time of XML such an ASCI format does not seem very reasonable. To the rescue: It is older than XML, much leaner (what isn't?) and at least well documented.

TODO

maybe implementing writing routines maybe implementing a direct-access mode

AUTHOR

Heiko Klein, <H.Klein@gmx.net>

SEE ALSO

http://cloud1.arc.nasa.gov/solve/archiv/archive.tutorial.html, Text::NASA_Ames::DataEntry, Text::NASA_Ames::FFI1001, NASA_Ames::FFI1010, NASA_Ames::FFI1020, Text::NASA_Ames::FFI2010, NASA_Ames::FFI2110, NASA_Ames::FFI2160, Text::NASA_Ames::FFI2310, NASA_Ames::FFI3010, NASA_Ames::FFI4010