Main Page   Classes  

Public Member Functions | Static Public Member Functions
Record Class Reference

List of all members.

Public Member Functions

 Record ()
 Record (String[] filenames, String filter) throws NoDataException, Beatl2Exception
 Record (String[] filenames) throws NoDataException, Beatl2Exception
 Record (String filename, String filter) throws NoDataException, Beatl2Exception
 Record (String filename) throws Beatl2Exception
void remove () throws Beatl2Exception
int getNumFields () throws Beatl2Exception
int getFieldIndexFromName (String fieldName) throws Beatl2Exception
int addField (String fieldName, BasicTypeEnum type, int[] dim) throws Beatl2Exception
int addStringField (String fieldName, String str) throws Beatl2Exception
void removeField (int index) throws Beatl2Exception
int attachField (String fieldName, BasicTypeEnum type, int[] dim, DataType fieldData) throws Beatl2Exception
DataType detachField (int index) throws Beatl2Exception
String getFieldName (int index) throws Beatl2Exception
BasicTypeEnum getFieldType (int index) throws Beatl2Exception
int[] getFieldDim (int index) throws Beatl2Exception
int getFieldNumElements (int index) throws Beatl2Exception
DataType getFieldData (int index) throws Beatl2Exception
void setStringDataElement (DataType field_data, int array_index, String str) throws Beatl2Exception
void changeFieldName (int index, String fieldName) throws Beatl2Exception
void appendDataToField (int index, int[] dim, DataType data) throws Beatl2Exception
void appendFieldToFieldByIndex (int index1, Record record2, int index2) throws Beatl2Exception
void appendFieldToFieldByName (String fieldName1, Record record2, String fieldName2) throws Beatl2Exception
void reshapeFieldData (int index, int dimId, int[] dimElementId) throws Beatl2Exception
void filterFieldData (int index, byte[] dimFilter) throws Beatl2Exception
void append (Record record) throws Beatl2Exception
void slice (String dimension, int[] ids) throws Beatl2Exception
void sliceRange (String dimension, int fromId, int toId) throws Beatl2Exception
void exportToFile (String format, String filename) throws Beatl2Exception
String toString ()
String dump ()

Static Public Member Functions

static void findColocatedData (Record record1, Record record2, double timeDistance, double radialDistance, double altitudeDistance) throws NoDataException, Beatl2Exception
static Record importFromFile (String format, String filename) throws Beatl2Exception

Detailed Description

BEAT-II Record class.

BEAT-II records are generic records that can be dynamically changed. Although this type of record was made for BEAT-II its genericity allows for a much wider use. Each BEAT-II record consists of a dynamically growable/shrinkable list of fields.


Constructor & Destructor Documentation

Record ( )

Create a new BEAT-II record.

Record ( String[]  filenames,
String  filter 
) throws NoDataException, Beatl2Exception

Ingest multiple files and return a BEAT-II record with the data that matches the ingestion filter.

Parameters:
filenamesList of filenames of the files that need to be ingested. All files need to be of the same product type.
filterString containing a ',' or ';' separated list of key=value pairs with filter options ('value' may be a space separated list of values). The filter parameter string may be set to either an empty string ("") or null if no filter options are required.
Exceptions:
NoDataExceptionIf no data was ingested.
Beatl2ExceptionIf an error occurred.
Record ( String[]  filenames) throws NoDataException, Beatl2Exception

Ingest multiple files and return a BEAT-II record with the data that matches an empty ingestion filter.

Parameters:
filenamesList of filenames of the files that need to be ingested. All files need to be of the same product type.
Exceptions:
NoDataExceptionIf no data was ingested.
Beatl2ExceptionIf an error occurred.
Record ( String  filename,
String  filter 
) throws NoDataException, Beatl2Exception

Ingest a file and return a BEAT-II record with the data that matches the ingestion filter.

Parameters:
filenameFile to be ingested. type.
filterString containing a ',' or ';' separated list of key=value pairs with filter options ('value' may be a space separated list of values). The filter parameter string may be set to either an empty string ("") or NULL if no filter options are required.
Exceptions:
NoDataExceptionIf no data was ingested.
Beatl2ExceptionIf an error occurred.
Record ( String  filename) throws Beatl2Exception

Ingest a file and return a BEAT-II record with the data that matches an empty ingestion filter.

Parameters:
filenameFile to be ingested.
Exceptions:
Beatl2ExceptionIf an error occurred.

Member Function Documentation

int addField ( String  fieldName,
BasicTypeEnum  type,
int[]  dim 
) throws Beatl2Exception

Add a field to an existing BEAT-II record.

Parameters:
fieldNameThe field name.
typeBasic data type for the field.
dimDimensions of the field.
Returns:
Field index of the newly created field.
Exceptions:
Beatl2ExceptionIf an error occurred.
int addStringField ( String  fieldName,
String  str 
) throws Beatl2Exception

Add a field containing a single String element to an existing BEAT-II record .

Parameters:
fieldNameThe field name.
strString containing the value.
Returns:
Field index of the newly created field.
Exceptions:
Beatl2ExceptionIf an error occurred.
void append ( Record  record) throws Beatl2Exception

Append the data of a BEAT-II record.

Parameters:
recordThe record to append.
Exceptions:
Beatl2ExceptionIf an error occurred.
void appendDataToField ( int  index,
int[]  dim,
DataType  data 
) throws Beatl2Exception

Append data to a record field.

Parameters:
indexField index (0 <= index < number of fields).
dimDimensions of the data to be appended.
dataThe field data to append to.
Exceptions:
Beatl2ExceptionIf an error occurred.
void appendFieldToFieldByIndex ( int  index1,
Record  record2,
int  index2 
) throws Beatl2Exception

Append data of one record field to the data block of another a record field.

Parameters:
index1Field index for the current Record (0 <= index < number of fields).
record2The other record from which to append the field.
index2The field index for the other Record (0 <= index < number of fields).
Exceptions:
Beatl2ExceptionIf an error occurred.
void appendFieldToFieldByName ( String  fieldName1,
Record  record2,
String  fieldName2 
) throws Beatl2Exception

Append data of one record field to the data block of another a record field.

Parameters:
fieldName1The field name of the current record.
record2The Record to be appendeother record from which to append the field.
fieldName2The field name of the Record to be appended.
Exceptions:
Beatl2ExceptionIf an error occurred.
int attachField ( String  fieldName,
BasicTypeEnum  type,
int[]  dim,
DataType  fieldData 
) throws Beatl2Exception

Add a field to an existing BEAT-II record and provide its field data.

Parameters:
fieldNameThe field name.
typeBasic data type for the field.
dimDimensions of the field.
fieldDataThe DataType instance containing the data for this field.
Returns:
Field index of the newly created field.
Exceptions:
Beatl2ExceptionIf an error occurred.
void changeFieldName ( int  index,
String  fieldName 
) throws Beatl2Exception

Change the field name of a BEAT-II record field.

Parameters:
indexField index (0 <= index < number of fields).
fieldNameThe field name.
Exceptions:
Beatl2ExceptionIf an error occurred.
DataType detachField ( int  index) throws Beatl2Exception

Remove a field from an existing BEAT-II record without removing its field data.

Parameters:
indexField index of the field to be detached (0 <= index < number of fields).
Returns:
fieldData The field data object.
Exceptions:
Beatl2ExceptionIf an error occurred.
String dump ( )

Return a string containing the full contents of this Record.

This function is identical to toString(), but also prints the array data (instead of only the scalar values).

The string returned by this method can get *quite* large, depending on the size of the data arrays involved...

Returns:
The Record data as a String.
void exportToFile ( String  format,
String  filename 
) throws Beatl2Exception

Export the Record into one of the supported export formats to a file.

Parameters:
formatString value of the name of the export format.
filenameFilename of the export file that needs to be created.
Exceptions:
Beatl2ExceptionIf an error occurred.
void filterFieldData ( int  index,
byte[]  dimFilter 
) throws Beatl2Exception

Filter field data in the first dimension.

Parameters:
indexField index for record (0 <= index < number of fields).
dimFilterAn array containing 0 (exclude) and 1 (include) values to indicate which elements should be filtered out.
Exceptions:
Beatl2ExceptionIf an error occurred.
static void findColocatedData ( Record  record1,
Record  record2,
double  timeDistance,
double  radialDistance,
double  altitudeDistance 
) throws NoDataException, Beatl2Exception [static]

Find co-located data for two BEAT-II records matching time, geolocation, and/or altitude.

Note that this is nbot an instance method, but a static class method that requires two Record instances as parameters.

Parameters:
record1Instance of a valid BEAT-II record.
record2Instance of a valid BEAT-II record.
timeDistanceDistance in seconds used to match time values of both records.
radialDistanceDistance in km used to match latitude and longitude values of both records.
altitudeDistanceDistance in km used to match altitude values of both records.
Exceptions:
NoDataExceptionIf no co-located data was found (both records will be left unmodified).
Beatl2ExceptionIf an error occurred.
DataType getFieldData ( int  index) throws Beatl2Exception

Retrieve the field data object of a BEAT-II record field.

Parameters:
indexField index (0 <= index < number of fields).
Returns:
The field data DataType object.
Exceptions:
Beatl2ExceptionIf an error occurred.
int [] getFieldDim ( int  index) throws Beatl2Exception

Retrieve the dimensions of a BEAT-II record field.

Parameters:
indexField index (0 <= index < number of fields).
Returns:
Dimension sizes array.
Exceptions:
Beatl2ExceptionIf an error occurred.
int getFieldIndexFromName ( String  fieldName) throws Beatl2Exception

Find the field with the given field name in the record and return the field index. Comparison will be case insensitive.

Parameters:
fieldNameThe field name.
Returns:
Field index of the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
String getFieldName ( int  index) throws Beatl2Exception

Retrieve the field name of a BEAT-II record field.

Parameters:
indexField index (0 <= index < number of fields).
Returns:
The name of the field.
Exceptions:
Beatl2ExceptionIf an error occurred.
int getFieldNumElements ( int  index) throws Beatl2Exception

Retrieve the number of elements of a BEAT-II record field.

Parameters:
indexField index (0 <= index < number of fields).
Returns:
The total number of elements.
Exceptions:
Beatl2ExceptionIf an error occurred.
BasicTypeEnum getFieldType ( int  index) throws Beatl2Exception

Retrieve the basic data type of a BEAT-II record field.

Parameters:
indexField index (0 <= index < number of fields).
Returns:
The basic data type.
Exceptions:
Beatl2ExceptionIf an error occurred.
int getNumFields ( ) throws Beatl2Exception

Get the number of fields of a BEAT-II record.

Returns:
Number of fields of the record.
Exceptions:
Beatl2ExceptionIf an error occurred.
static Record importFromFile ( String  format,
String  filename 
) throws Beatl2Exception [static]

Factory function for importing a BEAT-II record from a file that was stored in one of the supported import formats.

Parameters:
formatString value of the name of the import format.
filenameFilename of the file from which the record should be imported.
Returns:
The imported file data as a Record() instance.
Exceptions:
Beatl2ExceptionIf an error occurred.
void remove ( ) throws Beatl2Exception

Closes an open Record. The Record instance will be invalid after calling this method and should no longer be used.

Exceptions:
Beatl2ExceptionIf an error occurred.
void removeField ( int  index) throws Beatl2Exception

Remove a field from an existing BEAT-II record.

Parameters:
indexField index of the field to be removed (0 <= index < number of fields).
Exceptions:
Beatl2ExceptionIf an error occurred.
void reshapeFieldData ( int  index,
int  dimId,
int[]  dimElementId 
) throws Beatl2Exception

Rearrange field data in one dimension.

Parameters:
indexField index for record (0 <= index < number of fields).
dimIdThe id of the dimension in which the rearrangement should take place.
dimElementIdAn array containing the ids in dimension dim_id in the new arrangement (ids may occur more than once and the number of ids may be smaller or larger than the length of dimension dimId).
Exceptions:
Beatl2ExceptionIf an error occurred.
void setStringDataElement ( DataType  field_data,
int  array_index,
String  str 
) throws Beatl2Exception

Store a copy of a string at a given position in the field data.

Parameters:
field_dataField data for a field that contains string data.
array_indexIndex in the flattened array of strings for the field (use 0 if the field is a zero dimensional array).
strThe string for which a copy should be stored in the field data.
Exceptions:
Beatl2ExceptionIf an error occurred.
void slice ( String  dimension,
int[]  ids 
) throws Beatl2Exception

Shrink a BEAT-II record to a subset of its data.

Parameters:
dimensionName of the dimension to which the id array is applicable. Provide NULL for the main dimension. If the dimension is not the main dimension it should be a subdimension of the main dimension (e.g. 'profile' dimension)
idsArray of indices (0 based) for the elements that need to be kept.
Exceptions:
Beatl2ExceptionIf an error occurred.
void sliceRange ( String  dimension,
int  fromId,
int  toId 
) throws Beatl2Exception

Shrink the record to a subrange of its data.

Parameters:
dimensionName of the dimension to which the id array is applicable. Provide NULL for the main dimension. If the dimension is not the main dimension it should be a subdimension of the main dimension (e.g. 'profile' dimension)
fromIdThe first array index of the sub range (0 based).
toIdThe last array index of the sub range (0 based).
Exceptions:
Beatl2ExceptionIf an error occurred.
String toString ( )

Return a string containing a summary of the contents of this Record.

For array fields, only the dimensions are displayed, not the data values. Use dump() to get the full contents of a record.

The output format is identical to how the BEAT-II MATLAB shows structure information, except that for now a fixed padding value of 32 is used (rather than MATLAB's dynamic padding and justification on the colon), and that the precision parameters for some of the floats will differ from what MATLAB displays.

Returns:
The Record data as a (sumamrized) String.
See also:
java.lang.Object.toString()

The documentation for this class was generated from the following file: