grs.pds.edr
Class PulserEdrRecord

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

public class PulserEdrRecord
extends TimeSeriesRecord

Pulser data. The pulsers are calibration sources within the Gamma Sensor Head that emit gamma ray pulses at known energies. The spectrum which is stored is actually 3 500-channel-wide slices, each centered on one of the 3 energies, placed end-to-end in the array. So there are 1500 total channels in the spectrum, each containing a count as a byte, i.e. a total of 1500 bytes, 1 byte per channel.


Field Summary
 long bad_code
          bad flags, defined in BadFlag.doc
 long ceb_time
          CEB time in milliseconds since previous rollover
 byte counter
          counter, should be sequential with each packet
 short first_chan
           
 short last_chan
           
 short mid_chan
           
 int ody_orbit
          ody orbit number
 int orbit
          grs orbit number
 int pixel
          grs pixel number
 long sc_ev_time
          spacecraft event time (middle of pixel), in ticks
 long sc_recv_time
          spacecraft received time, in ticks
 byte[] spectra
          the pulser spectra
 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
PulserEdrRecord(DataInputStream in)
          Read a PulserEdrRecord in from a DataInputStream.
PulserEdrRecord(ResultSet rs)
          Create a PulserEdrRecord 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)
          SQL to join the header table and pulser table to retrieve pulser records from a specific schema.
 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 Pulser EDR record.
 int prepareInsert(PreparedStatement pstmt)
          Bind the variables to a prepared statement.
 String[] toStringArray()
          Display the values in this record.
 void writeTo(DataOutputStream out)
          Write this PulserEdrRecord 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 received time, in ticks


sc_ev_time

public long sc_ev_time
spacecraft event time (middle of pixel), in ticks


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 byte counter
counter, should be sequential with each packet


first_chan

public short first_chan

mid_chan

public short mid_chan

last_chan

public short last_chan

spectra

public byte[] spectra
the pulser spectra

Constructor Detail

PulserEdrRecord

public PulserEdrRecord(ResultSet rs)
                throws SQLException,
                       IOException
Create a PulserEdrRecord from a ResultSet.

Parameters:
rs - ResultSet constructed from SQL query.
Throws:
SQLException - Error reading from ResultSet.
IOException - Error reading from the stream.

PulserEdrRecord

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

Parameters:
in - Binary stream of pulser data.
Throws:
ParseException - Invalid time format in stream.
IOException - Error reading from strea,.
Method Detail

createSelectString

public static String[] createSelectString(String schema)
SQL to join the header table and pulser table to retrieve pulser records from a specific schema. TimeQuery has a method to lookup schema based on an SCLK value

Parameters:
schema - Schema to use (e.g. "map1").
Returns:
SQL to be used in PreparedStatement

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 this PulserEdrRecord to a DataOutputStream

Specified by:
writeTo in class BasePdsRecord
Parameters:
out - Binary output stream.
Throws:
IOException - Error writing to the stream.

toStringArray

public String[] toStringArray()
Display the values in this record. Does not include pulser spectra.

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

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 an Pulser EDR record.

Parameters:
args - Filename
Exception


2001 Mars Odyssey Gamma Ray Spectrometer Team