grs.pds.edr
Class GammaEdrRecord

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

public class GammaEdrRecord
extends PositionedEdrRecord

GRS raw gamma spectra.

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

Field Summary
 long bad_code
          defined in bad_flags.txt
 long counter
          counter from up to eight packets
 short first_chan
          first valid channel, typically zero
 int l1_cntr
           
 int l2_cntr
           
 int l3_cntr
           
 short last_chan
          last valid channel, typically 16383
 int lld_cntr
           
 int pha_cntr
           
 long pha_timer
           
 byte[] raw_spectrum
          the gamma spectrum
 int uld_cntr
           
 
Fields inherited from class grs.pds.edr.PositionedEdrRecord
ceb_time, day_index, delta_theta, instrboresight_mars, intersecting, latitude, local_hour, local_min, longitude, mars_sol, marspos_instr, marsvel_instr, ody_orbit, orbit, pixel, pointing, sc_ev_time, sc_recv_time, scalt, scpos_inert, scpos_mars, scvel_inert, subsc_mars, utc
 
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
GammaEdrRecord(DataInputStream in)
          Create a gamma record from a DataInputStream.
GammaEdrRecord(ResultSet rs)
          Create a gamma 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 used to select gamma data.
static void main(String[] args)
          Demonstrates use of this class to parse an Gamma 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.edr.PositionedEdrRecord
getSCLK, getUTC, readHeader, readHeader, toStringArray
 
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

bad_code

public long bad_code
defined in bad_flags.txt


counter

public long counter
counter from up to eight packets


first_chan

public short first_chan
first valid channel, typically zero


last_chan

public short last_chan
last valid channel, typically 16383


lld_cntr

public int lld_cntr

uld_cntr

public int uld_cntr

l1_cntr

public int l1_cntr

l2_cntr

public int l2_cntr

l3_cntr

public int l3_cntr

pha_cntr

public int pha_cntr

pha_timer

public long pha_timer

raw_spectrum

public byte[] raw_spectrum
the gamma spectrum

Constructor Detail

GammaEdrRecord

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

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

GammaEdrRecord

public GammaEdrRecord(ResultSet rs)
               throws SQLException,
                      IOException
Create a gamma record from a ResultSet.

Parameters:
rs - ResultSet to read from.
Throws:
SQLException - Error reading from result set.
IOException - Invalid spectrum.
Method Detail

createSelectString

public static String[] createSelectString(String schema)
Create the SQL query used to select gamma data.

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 values to the PreparedStatement

Overrides:
prepareInsert in class PositionedEdrRecord
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.

Overrides:
writeTo in class PositionedEdrRecord
Parameters:
out - Stream to write to.
Throws:
IOException - Error writing to stream.

toStringArray

public String[] toStringArray()
Display the values in this record. Does not display the spectrum.

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

main

public static final void main(String[] args)
Demonstrates use of this class to parse an Gamma EDR record.

Parameters:
args - Filename


2001 Mars Odyssey Gamma Ray Spectrometer Team