gov.nasa.gsfc.drl.rtstps.core.output.hdf5
Class CRISRawApplicationPackets

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.output.hdf5.RawApplicationPackets
      extended by gov.nasa.gsfc.drl.rtstps.core.output.hdf5.CRISRawApplicationPackets

public class CRISRawApplicationPackets
extends RawApplicationPackets

Build CrIS [@link RawApplicationPackets} by capturing groups scan packets between packet with and application ID of 1289. The first group captured is likely going to be short due to the fact that frame lock could occur at any time. Scans groups that form a granule are specified externally in the constructor.


Field Summary
private  boolean firstPacket
           
private  int scanCounter
           
private  int scansPerGranule
           
private  boolean scansStarted
           
private  Stats stats
           
 
Fields inherited from class gov.nasa.gsfc.drl.rtstps.core.output.hdf5.RawApplicationPackets
packetPool
 
Constructor Summary
CRISRawApplicationPackets(int allRDRId, int setNum)
          Constructor which attempts to read the RawApplicationPacket entry that pre-exists.
CRISRawApplicationPackets(int readId, int setNum, boolean usedByGranuleOnly)
           
CRISRawApplicationPackets(SpacecraftId satellite, int setNum, int scansPerGranule, PacketPool packetPool)
          Constructor to initialize the RawApplicationPackets algorithm for CrIS.
CRISRawApplicationPackets(Stats stats, SpacecraftId satellite, int setNum, int scansPerGranule, PacketPool packetPool)
           
 
Method Summary
 void close()
          Close the RDR/HDF file specifically for the RawApplicationsPackets.
 boolean notFull(Packet p)
          Check that this object is not full and can accumulate more packets before being written.
 void put(Packet p)
          Put the packet into the CrISRawApplications area, the method notFull should have been called first to check if this is allowed or not.
 boolean write(int hdfFile)
          Write the accumulate packets to the RDR/HDF file.
 
Methods inherited from class gov.nasa.gsfc.drl.rtstps.core.output.hdf5.RawApplicationPackets
getAppIdCounts, getData, getDataSet, getDataSpace, getFirstTime, getLastTime, getPacketList, getPacketTypeCounts, getPacketTypes, getStaticHeader, getTimeSpan, getTotalPacketCounts, setFirstTime, setLastTime, updateAppIdCounters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scansStarted

private boolean scansStarted

scanCounter

private int scanCounter

scansPerGranule

private int scansPerGranule

stats

private Stats stats

firstPacket

private boolean firstPacket
Constructor Detail

CRISRawApplicationPackets

public CRISRawApplicationPackets(SpacecraftId satellite,
                                 int setNum,
                                 int scansPerGranule,
                                 PacketPool packetPool)
Constructor to initialize the RawApplicationPackets algorithm for CrIS.

Parameters:
satellite - the satellite ID as defined by the mission documents
setNum - the set number which is appended to the end of each RawApplicationPacket in the HDF
scansPerGranule - The number of scans to collect to make one granule

CRISRawApplicationPackets

public CRISRawApplicationPackets(Stats stats,
                                 SpacecraftId satellite,
                                 int setNum,
                                 int scansPerGranule,
                                 PacketPool packetPool)

CRISRawApplicationPackets

public CRISRawApplicationPackets(int allRDRId,
                                 int setNum)
                          throws RtStpsException
Constructor which attempts to read the RawApplicationPacket entry that pre-exists. The contents of the dataspace are read into a memory buffer... assuming it will fit.

Parameters:
allRDRId - the rdrAll Groups id
setNum - the set number of raw entry
Throws:
RtStpsException
java.lang.NullPointerException
HDF5LibraryException

CRISRawApplicationPackets

public CRISRawApplicationPackets(int readId,
                                 int setNum,
                                 boolean usedByGranuleOnly)
                          throws RtStpsException
Throws:
RtStpsException
Method Detail

notFull

public boolean notFull(Packet p)
                throws RtStpsException
Check that this object is not full and can accumulate more packets before being written. Specifically this is the CrIS variation which collects packets as singular scans between the 1289 packets. The first group is special as it may not be a full scan as lock may have occurred at any time. The granule for it then will likely be short.

Specified by:
notFull in class RawApplicationPackets
Parameters:
p - a Packet to be put into the CrIS RawApplicationPackets area
Returns:
true if it can be put there, or false if it is full and should be written to disk first
Throws:
wraps - any HDF exceptions in RtStpsException
RtStpsException

put

public void put(Packet p)
         throws RtStpsException
Put the packet into the CrISRawApplications area, the method notFull should have been called first to check if this is allowed or not.

Specified by:
put in class RawApplicationPackets
Parameters:
p - a Packet to put into it
Throws:
wraps - any HDF exceptions in RtStpsException
RtStpsException

write

public boolean write(int hdfFile)
              throws RtStpsException
Write the accumulate packets to the RDR/HDF file. Note that this method must be used in conjunction with method notFull and put.

Overrides:
write in class RawApplicationPackets
Parameters:
hdfFile - the handle to the RDR/HDF file that the packets should written to
Returns:
true if the write succeeded
Throws:
wraps - any HDF exceptions in RtStpsException
RtStpsException

close

public void close()
           throws RtStpsException
Close the RDR/HDF file specifically for the RawApplicationsPackets. This method should be called once specific RawApplicationPacket_x has been written.

Overrides:
close in class RawApplicationPackets
Throws:
wraps - any HDF exceptions in RtStpsException
RtStpsException