public class EarthDataInfo extends MetadataContainer
EarthDataInfo
class is a container for global
metadata pertaining to a number of DataVariable
objects.
The required global metadata includes the data source, the date and
duration of data recording (possible more than one), and the EarthTransform
object used to translate between data array
coordinates and geographic coordinates. Other metadata may also be
attached using the inherited TreeMap
functions and
Java String
objects as keys.Constructor and Description |
---|
EarthDataInfo(java.lang.String source,
java.util.Date date,
EarthTransform trans,
java.lang.String origin,
java.lang.String history)
Constructs a new earth data info object with the specified
properties.
|
EarthDataInfo(java.lang.String source,
java.util.List periodList,
EarthTransform trans,
java.lang.String origin,
java.lang.String history)
Constructs a new earth data info object with the specified
properties.
|
Modifier and Type | Method and Description |
---|---|
EarthDataInfo |
append(EarthDataInfo appendInfo,
boolean pedantic)
Appends another info object to this one.
|
java.lang.Object |
clone() |
java.lang.String |
formatDate(java.lang.String format)
Formats the first date.
|
java.lang.String |
formatDate(java.lang.String format,
EarthLocation loc)
Formats the first date.
|
java.lang.String |
formatDate(java.lang.String format,
java.util.TimeZone zone)
Formats the first date.
|
java.util.Date |
getDate()
Gets the data recording date.
|
java.util.Date |
getEndDate()
Gets the data recording ending date.
|
java.lang.String |
getHistory()
Gets the data command history.
|
java.lang.String |
getOrigin()
Gets the data origin.
|
java.lang.String |
getSceneTime(DataLocation upperLeft,
DataLocation lowerRight)
Gets the scene time in terms of day or night for the specified 2D
scene bounds.
|
java.lang.String |
getSceneTime(int[] dims)
Gets the scene time in terms of day or night for the specified 2D
scene dimensions.
|
java.lang.String |
getSource()
Gets the data source.
|
java.util.Date |
getStartDate()
Gets the data recording start date, the same value as the
getDate() method.
|
java.util.List<TimePeriod> |
getTimePeriods()
Gets the list of time periods for data recording.
|
EarthTransform |
getTransform()
Gets the earth transform object.
|
boolean |
isInstantaneous()
Returns true if the data recording originated from one date
and time with essentially no data recording duration.
|
void |
setTimePeriods(java.util.List<TimePeriod> periodList)
Sets the list of time periods for data recording.
|
void |
setTransform(EarthTransform trans)
Sets the earth transform.
|
void |
updateHistory(java.lang.String command,
java.lang.String[] argv)
Appends a command line to the history attribute.
|
getMetadataMap
public EarthDataInfo(java.lang.String source, java.util.List periodList, EarthTransform trans, java.lang.String origin, java.lang.String history)
source
- the data source. The source name should be a data
collection instrument or numerical model name using to collect or
generate the data.periodList
- the list of data recording time periods.trans
- the earth transform. The transform specifies the
translation between data array coordinates and geographic
coordinates. The parameter is null if no transform is known.origin
- the original data producer. The origin should be
specified as accurately as possible to reflect the agency and
division that initially processed and formatted the data.history
- the data command history. The history is a
newline separated list of commands and parameters that lead to
the creation of the data.EarthDataInfo(String,List,EarthTransform,String,String)
public EarthDataInfo(java.lang.String source, java.util.Date date, EarthTransform trans, java.lang.String origin, java.lang.String history)
source
- the data source. The source name should be a data
collection instrument or numerical model name using to collect or
generate the data.date
- the data recording date. It is assumed that the data
was recorded on the specified date and time, with essentially no
time duration.trans
- the earth transform. The transform specifies the
translation between data array coordinates and geographic
coordinates. The parameter is null if no transform is known.origin
- the original data producer. The origin should be
specified as accurately as possible to reflect the agency and
division that initially processed and formatted the data.history
- the data command history. The history is a
newline separated list of commands and parameters that lead to
the creation of the data.EarthDataInfo(String,List,EarthTransform,String,String)
public java.lang.String getSource()
public java.util.Date getDate()
getTimePeriods()
public java.util.Date getStartDate()
getDate()
,
getEndDate()
public java.util.Date getEndDate()
getStartDate()
public boolean isInstantaneous()
public java.lang.String formatDate(java.lang.String format)
getDate()
,
DateFormatter.formatDate(Date,String)
public java.lang.String formatDate(java.lang.String format, java.util.TimeZone zone)
public java.lang.String formatDate(java.lang.String format, EarthLocation loc)
public java.util.List<TimePeriod> getTimePeriods()
getDate()
,
setTimePeriods(java.util.List<noaa.coastwatch.util.TimePeriod>)
public void setTimePeriods(java.util.List<TimePeriod> periodList)
periodList
- the new list of time periods.getTimePeriods()
public EarthTransform getTransform()
public java.lang.String getOrigin()
public java.lang.String getHistory()
public void setTransform(EarthTransform trans)
trans
- the new earth transform to use.public java.lang.String getSceneTime(DataLocation upperLeft, DataLocation lowerRight)
upperLeft
- the upper-left 2D scene boundary.lowerRight
- the lower-right 2D scene boundary.day
for daytime scenes, night
for
nighttime scenes, or day/night
for a scene that
crosses the terminator.public java.lang.String getSceneTime(int[] dims)
dims
- the scene boundary dimensions as [rows, columns].day
for daytime scenes, night
for
nighttime scenes, or day/night
for a scene that
crosses the terminator.public void updateHistory(java.lang.String command, java.lang.String[] argv)
command
- the command or program name.argv
- an array of command line arguments.public java.lang.Object clone()
clone
in class MetadataContainer
public EarthDataInfo append(EarthDataInfo appendInfo, boolean pedantic)
appendInfo
- the info object to append.pedantic
- the pedantic flag, true if metadata should be
appended exactly so that duplicate values are preserved, false if
not.java.lang.IllegalArgumentException
- if the classes or Earth
transforms for this object and the object to append do not match.