public final class DLinkFile
extends java.lang.Object
This class is functionally comparable to the MTT DLink
class. It does not, however,
require SPICE and it does not require the MTT planning layer to be
instantiated.
The downlink volume file's header is of the following form:
# FILE_TYPE: DATA_VOLUME_DRAIN # START_TIME: 2012-085T00:00:00 # STOP_TIME: 2012-099T00:06:32 # PAYLOAD_BREAKDOWN (PERCENTAGE) # HIRISE: 35.000000 # CRISM: 30.000000 # CTX: 13.000000 # MARCI: 7.000000 # SHARAD: 15.000000 # ELECTRA: 0.000000 ##
The FILE_TYPE keyword and value (DATA_VOLUME_DRAIN) identify the file as a downlink volume file. The START_TIME and STOP_TIME key-value pairs identify the file's coverage.
The remainder of the header outlines each instrument's allocation of each downlink pass. If a particular pass consists of 9 megabits (Mb) and if HiRISE has 35% of the downlink (as above), then HiRISE is guaranteed 3.15 Mb.
(In practice, some instruments do not use their allotment of downlink for every pass. In such cases, the remainder is able to be used by the other instruments. The allocation in the headers is therefore effectively a minimum guarantee. There is no maximum guarantee, however.)
These values are available via methods of this class, e.g., getHirisePercent()
and getStartTime()
.
A typical record has the following form:
2012-085T02:47:25.000,2012-085T03:33:23.000,X,9103707584
It consists of the start and stop times of the pass, the pass band, and
the number of total bits allocated to the downlink. Each such record in
the downlink volume file is represented by a DLinkRecord
object.
Modifier and Type | Class and Description |
---|---|
static class |
DLinkFile.DLinkFileException
An exception that indicates a problem with a DLinkFile.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COMMENT_MARKER
The comment marker.
|
static java.lang.String |
CRISM_PERCENT
The CRISM_PERCENT header keyword.
|
static java.lang.String |
CTX_PERCENT
The CTX_PERCENT header keyword.
|
static java.lang.String |
ELECTRA_PERCENT
The ELECTRA_PERCENT header keyword.
|
static java.lang.String |
EOH
The end-of-header marker.
|
static java.lang.String |
FILE_TYPE
The FILE_TYPE header keyword.
|
static java.lang.String |
FILE_TYPE_VALUE
The FILE_TYPE header value.
|
static java.lang.String |
HEADER_MARKER
The marker used in the header to indicate a header keyword-value pair.
|
static java.lang.String |
HIRISE_PERCENT
The HIRISE_PERCENT header keyword.
|
static java.lang.String |
ID
Class identification name with source code version and date.
|
static java.lang.String |
MARCI_PERCENT
The MARCI_PERCENT header keyword.
|
static double |
MINIMUM_DRAIN_DURATION
The minimum value of the drain duration for an SSR drain event.
|
static java.lang.String |
PAYLOAD_BREAKDOWN
The PAYLOAD_BREAKDOWN pseudo-header keyword.
|
static java.lang.String |
SHARAD_PERCENT
The SHARAD_PERCENT header keyword.
|
static java.lang.String |
START_TIME
The START_TIME header keyword.
|
static java.lang.String |
STOP_TIME
The STOP_TIME header keyword.
|
Constructor and Description |
---|
DLinkFile(java.io.File file)
Creates a new DLinkFile from an input file.
|
DLinkFile(java.lang.String filename)
Creates a new DLinkFile from an input filename.
|
Modifier and Type | Method and Description |
---|---|
double |
getCrismPercent()
Gets the CRISM downlink percentage.
|
double |
getCtxPercent()
Gets the CTX downlink percentage.
|
double |
getElectraPercent()
Gets the ELECTRA downlink percentage.
|
java.lang.String |
getFilename()
Gets the filename of this downlink volume file.
|
double |
getHirisePercent()
Gets the HiRISE downlink percentage.
|
double |
getMarciPercent()
Gets the MARCI downlink percentage.
|
java.util.List<DLinkRecord> |
getRecords()
Gets this file's complete list of downlink volume records.
|
java.util.List<DLinkRecord> |
getRecords(DLinkRecord.DownlinkBand band)
Gets this file's list of downlink volume records for a particular downlink
band.
|
double |
getSharadPercent()
Gets the SHARAD downlink percentage.
|
java.util.List<SsrDrain> |
getSsrDrains(double percent)
Gets a list of SSR drains from this file for a given downlink percentage.
|
java.util.List<SsrDrain> |
getSsrDrains(double percent,
DLinkRecord.DownlinkBand band)
Gets a list of SSR drains from this file for a particular downlink band and
given a particular downlink percentage.
|
java.util.Date |
getStartTime()
Gets the start time from the file's header.
|
java.util.Date |
getStopTime()
Gets the stop time from the file's header.
|
public static final java.lang.String ID
public static final java.lang.String FILE_TYPE
DATA_VOLUME_DRAIN
for the file to be a downlink volume file.public static final java.lang.String FILE_TYPE_VALUE
FILE_TYPE
keyword does not have
this value (DATA_VOLUME_DRAIN), the file is not a downlink volume
file.public static final java.lang.String START_TIME
public static final java.lang.String STOP_TIME
public static final java.lang.String PAYLOAD_BREAKDOWN
public static final java.lang.String HIRISE_PERCENT
public static final java.lang.String CRISM_PERCENT
public static final java.lang.String CTX_PERCENT
public static final java.lang.String MARCI_PERCENT
public static final java.lang.String SHARAD_PERCENT
public static final java.lang.String ELECTRA_PERCENT
public static final java.lang.String HEADER_MARKER
public static final java.lang.String COMMENT_MARKER
public static final java.lang.String EOH
public static final double MINIMUM_DRAIN_DURATION
public DLinkFile(java.io.File file) throws DLinkFile.DLinkFileException, java.io.IOException
Downlink volume files use the .dlink filename extension. State files use .nk.
file
- the downlink volume or state file.DLinkFile.DLinkFileException
- if the file is not a downlink volume file or
if it has errors.java.io.IOException
- if there is a problem reading the file.java.lang.NullPointerException
- if the file is null.java.lang.IllegalArgumentException
- if the file does not exist or is not
readable or is not a downlink volume file (or a state file).public DLinkFile(java.lang.String filename) throws DLinkFile.DLinkFileException, java.io.IOException
Downlink volume files use the .dlink filename extension. State files use .nk.
filename
- the downlink volume or state filename.DLinkFile.DLinkFileException
- if the file is not a downlink volume file or
if it has errors.java.io.IOException
- if there is a problem reading the file.java.lang.NullPointerException
- if the file is null.java.lang.IllegalArgumentException
- if the filename is empty or if the file
does not exist or is not readable or is not a downlink volume file
(or a state file).public java.lang.String getFilename()
public java.util.Date getStartTime()
public java.util.Date getStopTime()
public double getHirisePercent()
public double getCrismPercent()
public double getCtxPercent()
public double getMarciPercent()
public double getSharadPercent()
public double getElectraPercent()
public java.util.List<DLinkRecord> getRecords()
public java.util.List<DLinkRecord> getRecords(DLinkRecord.DownlinkBand band)
DLinkRecord.DownlinkBand.KA_BAND
returns an empty list,
while this method invoked with DLinkRecord.DownlinkBand.X_BAND
returns the
file's complete list of downlink volume records.
Note that each record shows the total downlink volume for its pass, not that of a particular instrument.
If band is null, this method returns the complete list of records.
band
- the downlink band, which may be null.public java.util.List<SsrDrain> getSsrDrains(double percent, DLinkRecord.DownlinkBand band)
If band is null, this method returns the complete list of records.
Records whose duration is less than MINIMUM_DRAIN_DURATION
are
skipped. Sometimes a DLINK file will have what appears to be a truncated
downlink event, but the data volume of the downlink is not proportionally
scaled. For example, an event truncated to two-seconds in the creation of
the file might have a datavolume of 2000 megabits, leading to an absurd
downlink rate of 2 Mbps.
percent
- the percentage of available downlink allocated the drains.band
- the downlink band, which may be null.public java.util.List<SsrDrain> getSsrDrains(double percent)
All downlink volume records in this file are converted to SSR drains.
percent
- the percentage of available downlink allocated the drains.Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona