|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.gsfc.drl.rtstps.core.output.hdf5.RawApplicationPackets
public abstract class RawApplicationPackets
An abstract class to support the creation of a raw application packet dataset in an HDF file for an RDR such as: '/All_Data/VIIRS-SCIENCE-RDR/RawApplicationPackets0' Note that several of these routines must be overridden by the implementation for a specific sensor, and that the original version used a certain algorithm whose vestiges remain in this class. Where possible this has been more fully generilized with abstract methods and no implementation. The dataset is created based on a timed holding of packets hung up in the object. (constructor, notFull, put) The time is based on the clock time when the object was created and a given user argument of seconds in the future. It assumed the object will be used immediately to put packets in it and then create the HDF dataset. Once the time span has occurred, the accumulated packets may then be written to the HDF file, created in the RDR dataset structure. (writeRDR) A static header is calculated from the packets given to the object, then the packets themselves are written to the dataset. The object should be explicitly closed by calling close or the HDF API will get a heap exception eventually.
Field Summary | |
---|---|
private int[] |
appIds
|
private byte[] |
data
|
private int |
dataSet
|
private int |
dataSpace
|
private long |
firstTime
|
private long |
lastTime
|
private java.lang.String |
name
|
private java.util.List<Packet> |
packetList
|
(package private) PacketPool |
packetPool
|
private RDRName |
rdrName
|
private int |
readId
|
private SpacecraftId |
satellite
|
private int |
setNum
|
private StaticHeader |
staticHeader
|
Constructor Summary | |
---|---|
RawApplicationPackets(int allRDRId,
int setNum)
Constructor which attempts to read the RawApplicationPacket entry that pre-exists. |
|
RawApplicationPackets(int readId,
int setNum,
boolean usedByGranuleOnly)
Constructor which attempts to read the RawApplicationPacket entry that pre-exists. |
|
RawApplicationPackets(SpacecraftId satellite,
RDRName rdrName,
int setNum,
PacketPool packetPool)
Constructor for creating an nth instance of a raw application data packet area |
Method Summary | |
---|---|
void |
close()
Close up the various HDF items. |
private void |
createDataSet(int hdfFile,
int dataSetSize)
|
int[] |
getAppIdCounts()
Get the calculated application identifier counts |
byte[] |
getData()
|
int |
getDataSet()
Get the HDF data set handle with the RawApplicationPackets |
int |
getDataSpace()
Get the HDF data space associated with the RawApplicationPackets |
long |
getFirstTime()
Get the first time of the first packet in this RawApplicationPackets |
long |
getLastTime()
Get the last time of the first packet in this RawApplicationPackets |
java.util.List<Packet> |
getPacketList()
Return the internal packet list used to create the particular RawApplicationPackets This can be used when adding a packet to it. |
java.lang.String[] |
getPacketTypeCounts()
Return the packet types associated with each counter, these are string names |
long[] |
getPacketTypes()
Get the calculated packets types |
StaticHeader |
getStaticHeader()
Retrieve the static header in RDR, this is for a pre-existing RDR |
long |
getTimeSpan()
Get the time space of the packets in this RawApplicationPacket. |
int |
getTotalPacketCounts()
Return the total packet counts, summed |
abstract boolean |
notFull(Packet p)
Determine if the RawApplicationPacket is full or not. |
abstract void |
put(Packet p)
Put a packet into the RawApplicationPacket after checking if it is full or not. |
void |
setFirstTime(long time)
Set the first time |
void |
setLastTime(long time)
Set the last time |
void |
updateAppIdCounters(int appId)
Update the internal packet counters which are used in the creation of certain attributes for example in the Granules. |
boolean |
write(int hdfFile)
Write the RDR dataset record to the HDF file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int dataSpace
private int dataSet
private int setNum
private RDRName rdrName
private SpacecraftId satellite
private java.util.List<Packet> packetList
private int readId
private byte[] data
private StaticHeader staticHeader
private long firstTime
private long lastTime
private java.lang.String name
private int[] appIds
PacketPool packetPool
Constructor Detail |
---|
public RawApplicationPackets(SpacecraftId satellite, RDRName rdrName, int setNum, PacketPool packetPool)
satellite
- the name of the spacecraftrdrName
- the rdrName of the RDR dataset (i.e. VIIRS-SCIENCE-RDR)setNum
- the set numberpublic RawApplicationPackets(int allRDRId, int setNum) throws RtStpsException
allRDRId
- the rdrAll Groups idsetNum
- the set number of raw entry
RtStpsException
public RawApplicationPackets(int readId, int setNum, boolean usedByGranuleOnly) throws RtStpsException
readId
- the dataspace Id of the RawApp of interestsetNum
- the set number of raw entryusedByGranuleOnly
- a flag (value not used) to differentiate and imply its intended use
RtStpsException
Method Detail |
---|
public byte[] getData()
public StaticHeader getStaticHeader()
private void createDataSet(int hdfFile, int dataSetSize) throws RtStpsException
RtStpsException
public abstract boolean notFull(Packet p) throws RtStpsException
p
- the packet to be added to the RawApplicationPacket
RtStpsException
public abstract void put(Packet p) throws RtStpsException
p
- packet to be written
RtStpsException
public boolean write(int hdfFile) throws RtStpsException
hdfFile
- handle to the HDF file
RtStpsException
public final void updateAppIdCounters(int appId)
appId
- the application identifier of interestpublic final int[] getAppIdCounts()
public final long[] getPacketTypes()
public final java.lang.String[] getPacketTypeCounts()
PacketName
) that have countspublic final int getTotalPacketCounts()
public final long getFirstTime()
public final void setFirstTime(long time)
time
- the 64-bit time in a signed longpublic final long getLastTime()
public final void setLastTime(long time)
time
- the 64-bit time in a signed longpublic final java.util.List<Packet> getPacketList()
public long getTimeSpan()
public int getDataSet()
public int getDataSpace()
int
public void close() throws RtStpsException
RtStpsException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |