grs.pds.edr
Class ProfileEdrRecord

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

public class ProfileEdrRecord
extends TimeSeriesRecord

GRS gamma profile records.

Version:
$Revision: 1.6 $
Author:
$Author: guym $

Nested Class Summary
 class ProfileEdrRecord.Profile
          Profile element from the profile_series.
 
Field Summary
 long bad_code
          bad flags defined in BadFlag.doc
 long ceb_time
          CEB time in milliseconds since previous rollover
 long counter
          counters from up to eight packets
 int ody_orbit
          ody orbit number
 int orbit
          grs orbit number
 int pixel
          grs pixel number
 ProfileEdrRecord.Profile[] profile
          profile array
 short profile_count
          number of valid elements in the profile array
 long sc_ev_time
          spacecraft time at middle of the pixel, in ticks
 short sc_ev_time_fine
          fine time addition to sc_ev_time
 long sc_recv_time
          spacecraft received time, in ticks
 Date utc
          UTC at middle of pixel
 
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
ProfileEdrRecord(DataInputStream in)
          Create record from a DataInputStream.
ProfileEdrRecord(ResultSet rs)
          Read record from a ResultSet.
 
Method Summary
static String[] createInsertString(String schema)
          Create the SQL query used to insert gamma data into the PDS schema.
static String[] createSelectString(String schema)
          Create the SQL query string used for these records.
 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 a Profile EDR record.
 int prepareInsert(PreparedStatement pstmt)
          Bind the variables to a prepared statement.
 String[] toStringArray()
          Display this record as a string array.
 void writeTo(DataOutputStream out)
          Write record to 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 received time, in ticks


sc_ev_time

public long sc_ev_time
spacecraft time at middle of the pixel, in ticks


sc_ev_time_fine

public short sc_ev_time_fine
fine time addition to sc_ev_time


ceb_time

public long ceb_time
CEB time in milliseconds since previous rollover


utc

public Date utc
UTC at middle of pixel


pixel

public int pixel
grs pixel number


orbit

public int orbit
grs orbit number


ody_orbit

public int ody_orbit
ody orbit number


bad_code

public long bad_code
bad flags defined in BadFlag.doc


counter

public long counter
counters from up to eight packets


profile_count

public short profile_count
number of valid elements in the profile array


profile

public ProfileEdrRecord.Profile[] profile
profile array

Constructor Detail

ProfileEdrRecord

public ProfileEdrRecord(ResultSet rs)
                 throws SQLException,
                        IOException
Read record from a ResultSet.

Parameters:
rs - ResultSet to read from.
Throws:
SQLException - error reading from result set.
IOException - internal error processing data.

ProfileEdrRecord

public ProfileEdrRecord(DataInputStream in)
                 throws ParseException,
                        IOException
Create record from a DataInputStream.

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

createSelectString

public static String[] createSelectString(String schema)
Create the SQL query string used for these records.

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

createInsertString

public static String[] createInsertString(String schema)
Create the SQL query used to insert gamma data into the PDS schema.

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

prepareInsert

public int prepareInsert(PreparedStatement pstmt)
                  throws SQLException
Bind the variables to a prepared statement.

Specified by:
prepareInsert in class BasePdsRecord
Parameters:
pstmt - prepared statement
Returns:
number of columns bound
Throws:
SQLException - could not bind variables

writeTo

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

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

toStringArray

public String[] toStringArray()
Display this record as a string array. Does not include profile array.

Specified by:
toStringArray in class BasePdsRecord
Returns:
Record as string.

getSCLK

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

Specified by:
getSCLK in class TimeSeriesRecord
Returns:
Date

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.

main

public static final void main(String[] args)
                       throws Exception
Demonstrates use of this class to parse a Profile EDR record.

Parameters:
args - Filename
Exception


2001 Mars Odyssey Gamma Ray Spectrometer Team