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

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.output.hdf5.CommonDataSetObject
      extended by gov.nasa.gsfc.drl.rtstps.core.output.hdf5.Aggregate

public class Aggregate
extends CommonDataSetObject

Create or read the Aggregrate metadata from an RDR file. The RDR file is specified by an input handle, and assumed to be opened outside of this class. An Aggregate consists of certain attributes that contain among other things Granule start/stop times, counts and other items. The Aggregate itself references the items in the HDF and is defined the JPSS metadata documentation.


Field Summary
private  java.lang.String aggregateName
           
private  java.lang.String begDateStr
           
private  PDSDate beginningDateTime
           
private  GranuleId beginningGranuleId
           
private  long beginningOrbit
           
private  java.lang.String begTimeStr
           
private  int dataSet
           
private  int dataSpace
           
private  java.lang.String endDateStr
           
private  PDSDate endingDateTime
           
private  GranuleId endingGranuleId
           
private  long endingOrbit
           
private  java.lang.String endTimeStr
           
private  long granuleCount
           
private  RDRName rdrReferenceName
           
 
Constructor Summary
Aggregate(GranuleId beginningGranuleId, GranuleId endingGranuleId, long beginningOrbit, long endingOrbit, PDSDate beginningDateTime, PDSDate endingDateTime, long granuleCount, RDRName rdrReferenceName)
          Constructor for creating a new Aggregate in the RDR.
Aggregate(int rdrGroup, RDRName rdrName)
          Constructor for reading a pre-existing Aggregate.
Aggregate(int rdrGroup, java.lang.String aggregateName)
          Constructor for reading a pre-existing Aggregate.
 
Method Summary
 void close()
          Close the RDR/HDF Aggregate structure after calling the write method above.
 java.lang.String getBeginningDateFormatted()
          Returns the formatted date String of the BeginningDateTime as follows: yyyyMMdd
 PDSDate getBeginningDateTime()
          Returns the beginning date and time of the first Granule in this Aggregate as a Spacecraft PDS formated date and time.
 GranuleId getBeginningGranuleId()
          Returns the beginning Granule identifier
 long getBeginningOrbit()
          Returns the beginning orbit
 java.lang.String getBeginningTimeFormatted()
          Returns the formatted time String of the BeginningDateTime as follows: HHmmss.SSS
 java.lang.String getEndingDateFormatted()
          Returns the formatted date String of the EndingDateTime as follows: yyyyMMdd
 PDSDate getEndingDateTime()
          Returns the end date and time of the last Granule in this Aggregate as a Spacecraft PDS formated date and time.
 GranuleId getEndingGranuleId()
          Returns the ending Granule identifier
 long getEndingOrbit()
          Returns the ending orbit
 java.lang.String getEndingTimeFormatted()
          Returns the formatted time String of the EndingDateTime as follows: HHmmss.SSS
 long getGranuleCount()
          Returns the Granule count, the number of Granules that make up the Aggregate
 RDRAllReader getReferencedRDRAll()
          Return the RDR_All RDRAllReader that the reference points to in the Aggregate
private  void readAttributes()
           
 void write(int hdfFile)
          Write this Aggregrate to the HDF files according to the RDR format.
private  void writeAttributes()
          Write the various attributes associated with the Aggregate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataSpace

private int dataSpace

dataSet

private int dataSet

beginningGranuleId

private GranuleId beginningGranuleId

endingGranuleId

private GranuleId endingGranuleId

beginningOrbit

private long beginningOrbit

endingOrbit

private long endingOrbit

rdrReferenceName

private RDRName rdrReferenceName

aggregateName

private java.lang.String aggregateName

granuleCount

private long granuleCount

begTimeStr

private java.lang.String begTimeStr

endDateStr

private java.lang.String endDateStr

endTimeStr

private java.lang.String endTimeStr

begDateStr

private java.lang.String begDateStr

beginningDateTime

private PDSDate beginningDateTime

endingDateTime

private PDSDate endingDateTime
Constructor Detail

Aggregate

public Aggregate(int rdrGroup,
                 java.lang.String aggregateName)
          throws RtStpsException
Constructor for reading a pre-existing Aggregate.

Parameters:
rdrGroup - the RDR group on the HDF the Aggregrate is in such as /Data_Products/XXX-RDR
aggregateName - the aggregate name in the group like: SPACECRAFT-DIARY-RDR_Aggr
Throws:
RtStpsException

Aggregate

public Aggregate(int rdrGroup,
                 RDRName rdrName)
          throws RtStpsException
Constructor for reading a pre-existing Aggregate.

Parameters:
rdrGroup - the RDR group on the HDF the Aggregrate is in such as /Data_Products/XXX-RDR
aggregateName - the aggregate name in the group like: SPACECRAFT-DIARY-RDR_Aggr
Throws:
RtStpsException

Aggregate

public Aggregate(GranuleId beginningGranuleId,
                 GranuleId endingGranuleId,
                 long beginningOrbit,
                 long endingOrbit,
                 PDSDate beginningDateTime,
                 PDSDate endingDateTime,
                 long granuleCount,
                 RDRName rdrReferenceName)
Constructor for creating a new Aggregate in the RDR. It takes several arguments.

Parameters:
beginningGranuleId - The first Granule that constitutes this Aggregate
endingGranuleId - The last Granule that constitutes this Aggregate
beginningOrbit - The first orbit that constitutes this Aggregate
endingOrbit - The last orbit that constitutes this Aggregate
beginningDateTime - The beginning date and time of the Granules in spacecraft time
endingDateTime - The ending date and time of the Granules in spacecraft time
granuleCount - The number of Granules in the Aggregate
rdrReferenceName - The RDR name associated with this Aggregate
Method Detail

getReferencedRDRAll

public RDRAllReader getReferencedRDRAll()
                                 throws RtStpsException
Return the RDR_All RDRAllReader that the reference points to in the Aggregate

Returns:
an RDRAlLReader for the RDR_All
Throws:
RtStpsException

getBeginningGranuleId

public final GranuleId getBeginningGranuleId()
Returns the beginning Granule identifier

Returns:
the GranuleId

getBeginningOrbit

public final long getBeginningOrbit()
Returns the beginning orbit

Returns:
the beginning orbit as a long

getEndingGranuleId

public final GranuleId getEndingGranuleId()
Returns the ending Granule identifier

Returns:
the GranuleId

getEndingOrbit

public final long getEndingOrbit()
Returns the ending orbit

Returns:
the ending orbit as a long

getBeginningDateTime

public final PDSDate getBeginningDateTime()
Returns the beginning date and time of the first Granule in this Aggregate as a Spacecraft PDS formated date and time.

Returns:
returns the date/time in a PDSDate

getBeginningDateFormatted

public final java.lang.String getBeginningDateFormatted()
Returns the formatted date String of the BeginningDateTime as follows: yyyyMMdd

Returns:
the String containing the formatted date

getBeginningTimeFormatted

public final java.lang.String getBeginningTimeFormatted()
Returns the formatted time String of the BeginningDateTime as follows: HHmmss.SSS

Returns:
the String contained the formatted time

getEndingDateTime

public final PDSDate getEndingDateTime()
Returns the end date and time of the last Granule in this Aggregate as a Spacecraft PDS formated date and time.

Returns:
returns the date/time in a PDSDate

getEndingDateFormatted

public final java.lang.String getEndingDateFormatted()
Returns the formatted date String of the EndingDateTime as follows: yyyyMMdd

Returns:
the String containing the formatted date

getEndingTimeFormatted

public final java.lang.String getEndingTimeFormatted()
Returns the formatted time String of the EndingDateTime as follows: HHmmss.SSS

Returns:
the String contained the formatted time

getGranuleCount

public final long getGranuleCount()
Returns the Granule count, the number of Granules that make up the Aggregate

Returns:
the Granule count as a long

write

public void write(int hdfFile)
           throws RtStpsException
Write this Aggregrate to the HDF files according to the RDR format. In particular it creates the /Data_Products/XXX-XXXX-RDR/XXX-XXXX-RDR_Aggr structure.

Parameters:
hdfFile - the handle from the HDF file to the root of the HDF structure
Throws:
RtStpsException - Wraps any exceptions thrown by the HDF library

writeAttributes

private void writeAttributes()
                      throws RtStpsException
Write the various attributes associated with the Aggregate

Throws:
RtStpsException - Wraps any exceptions thrown by the HDF library

readAttributes

private void readAttributes()
                     throws RtStpsException
Throws:
RtStpsException

close

public void close()
           throws RtStpsException
Close the RDR/HDF Aggregate structure after calling the write method above. If this method is not called the HDF will not be complete and the resulting Aggregate may not be correct or even exist in the file.

Specified by:
close in class CommonDataSetObject
Throws:
RtStpsException - Wraps any exceptions thrown by the HDF library