grs.pds.edr
Class ChanEdrRecord

java.lang.Object
  |
  +--grs.pds.BasePdsRecord
        |
        +--grs.pds.TimeSeriesRecord
              |
              +--grs.pds.edr.ChanEdrRecord
All Implemented Interfaces:
PdsRecord

public class ChanEdrRecord
extends TimeSeriesRecord

Channelized engineering data from the spacecraft. Takes the sc_recv_time, utc, and processed value -- the unprocessed value is not used here.

Version:
$Revision: 1.4 $
Author:
$Author: guym $

Field Summary
 float processed
          processed channelized data value
 long sc_recv_time
          spacecraft time in ticks
 Date utc
          spacecraft time in utc (from SPICE)
 
Fields inherited from class grs.pds.BasePdsRecord
PdsTimeFormat
 
Fields inherited from interface grs.pds.PdsRecord
GAMMA_CHANNELS, int10, int12, int2, int3, logger, MESSAGE_LENGTH, NS_MAX_EVENTS, PEF_COMMANDS, prec10, prec12, prec13, prec14, prec15, prec16, prec17, prec5, prec6, prec7, PROFILE_LENGTH, PROFILE_SIZE, PULSER_CHANNELS, QUERY_DATE_FMT, SC_ID
 
Constructor Summary
ChanEdrRecord(DataInputStream in)
          Read record in from a DataInputStream.
ChanEdrRecord(ResultSet rs)
          Read record in from a ResultSet.
 
Method Summary
static String[] createInsertString(String schema)
          Create the SQL queries used to insert records of this type into the PDS schema.
static String[] createSelectString(String schema)
          Create the SQL queries used to make records of this type.
static String[] getColumns()
          Return an array of the columns used for channelized data.
 long getSCLK()
          Get the Date (time) of record.
 Date getUTC()
          Get the UTC time that this record was observed on.
static void main(String[] args)
          Demonstrates use of this class to parse an Chan EDR record.
 int prepareInsert(PreparedStatement pstmt)
          Bind values to the PreparedStatement
 String[] toStringArray()
          Display the values in this record.
 void writeTo(DataOutputStream out)
          Write this record to a DataOutputStream.
 
Methods inherited from class grs.pds.BasePdsRecord
endianSwapShort
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sc_recv_time

public long sc_recv_time
spacecraft time in ticks


utc

public Date utc
spacecraft time in utc (from SPICE)


processed

public float processed
processed channelized data value

Constructor Detail

ChanEdrRecord

public ChanEdrRecord(ResultSet rs)
              throws SQLException
Read record in from a ResultSet.

Parameters:
rs - ResultSet to read from.
Throws:
SQLException - Error reading from resultset.

ChanEdrRecord

public ChanEdrRecord(DataInputStream in)
              throws ParseException,
                     IOException
Read record in from a DataInputStream.

Parameters:
in - Stream to read from.
Throws:
IOException - error reading from stream.
ParseException - UTC date in stream data is invalid.
Method Detail

getColumns

public static String[] getColumns()
Return an array of the columns used for channelized data.

Returns:
Channelized columns.

createSelectString

public static String[] createSelectString(String schema)
Create the SQL queries used to make records of this type.

Parameters:
schema - DB Schema to use.
Returns:
SQL query array.

createInsertString

public static String[] createInsertString(String schema)
Create the SQL queries used to insert records of this type into the PDS schema.

Parameters:
schema - DB Schema to use.
Returns:
SQL query array.

prepareInsert

public int prepareInsert(PreparedStatement pstmt)
                  throws SQLException
Bind values to the PreparedStatement

Specified by:
prepareInsert in class BasePdsRecord
Parameters:
pstmt - prepared statement
Returns:
number of values bound
Throws:
SQLException - Error in binding binding

writeTo

public void writeTo(DataOutputStream out)
             throws IOException
Write this record to a DataOutputStream.

Specified by:
writeTo in class BasePdsRecord
Parameters:
out - Stream to write to.
Throws:
IOException - Error writing to stream.

toStringArray

public String[] toStringArray()
Display the values in this record.

Specified by:
toStringArray in class BasePdsRecord
Returns:
This record as a String array.

getSCLK

public long getSCLK()
Get the Date (time) of record.

Specified by:
getSCLK in class TimeSeriesRecord
Returns:
Date

main

public static final void main(String[] args)
Demonstrates use of this class to parse an Chan EDR record. Uses the toString[] method to print the values;

Parameters:
args - path to chan data file, e.g. chan/grs_gsh_tmp.dat

getUTC

public Date getUTC()
Description copied from class: TimeSeriesRecord
Get the UTC time that this record was observed on.

Specified by:
getUTC in class TimeSeriesRecord
Returns:
UTC.


2001 Mars Odyssey Gamma Ray Spectrometer Team