Package noaa.coastwatch.util
Class EarthDataInfo
java.lang.Object
noaa.coastwatch.util.MetadataContainer
noaa.coastwatch.util.EarthDataInfo
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
SatelliteDataInfo
The
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.- Since:
- 3.1.8
- Author:
- Peter Hollemans
-
Constructor Summary
ConstructorDescriptionEarthDataInfo
(String source, Date date, EarthTransform trans, String origin, String history) Constructs a new earth data info object with the specified properties.EarthDataInfo
(String source, List<TimePeriod> periodList, EarthTransform trans, String origin, String history) Constructs a new earth data info object with the specified properties. -
Method Summary
Modifier and TypeMethodDescriptionappend
(EarthDataInfo appendInfo, boolean duplicatePreserving) Appends another info object to this one.appendWithDuplicates
(EarthDataInfo appendInfo) Appends another info object to this one in duplicate preserving mode.appendWithoutDuplicates
(EarthDataInfo appendInfo) Appends another info object to this one in duplicate removal mode.void
Clears the history of processing commands.clone()
void
Collapses the list of time periods in the metadata to a single period covering the full time range of data recording.formatDate
(String format) Formats the first date.formatDate
(String format, TimeZone zone) Formats the first date.formatDate
(String format, EarthLocation loc) Formats the first date.getDate()
Gets the data recording date.Gets the data recording ending date.Gets the data command history.Gets the data origin.getSceneTime
(int[] dims) Gets the scene time in terms of day or night for the specified 2D scene dimensions.getSceneTime
(DataLocation upperLeft, DataLocation lowerRight) Gets the scene time in terms of day or night for the specified 2D scene bounds.Gets the data source.Gets the data recording start date, the same value as the getDate() method.Gets the list of time periods for data recording.Gets the earth transform object.boolean
Returns true if the data recording originated from one date and time with essentially no data recording duration.void
setTimePeriods
(List<TimePeriod> periodList) Sets the list of time periods for data recording.void
setTransform
(EarthTransform trans) Sets the earth transform.void
updateHistory
(String command, String[] argv) Appends a command line to the history attribute.Methods inherited from class noaa.coastwatch.util.MetadataContainer
getMetadataMap
-
Constructor Details
-
EarthDataInfo
public EarthDataInfo(String source, List<TimePeriod> periodList, EarthTransform trans, String origin, String history) Constructs a new earth data info object with the specified properties.- Parameters:
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.- See Also:
-
EarthDataInfo
Constructs a new earth data info object with the specified properties.- Parameters:
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.- See Also:
-
-
Method Details
-
getSource
Gets the data source. -
collapseTimePeriods
public void collapseTimePeriods()Collapses the list of time periods in the metadata to a single period covering the full time range of data recording.- Since:
- 3.5.1
-
clearHistory
public void clearHistory()Clears the history of processing commands.- Since:
- 3.7.0
-
getDate
Gets the data recording date. Since data recording may have occurred over a number of different time periods, the date returned is the first date in the time period list.- See Also:
-
getStartDate
Gets the data recording start date, the same value as the getDate() method.- See Also:
-
getEndDate
Gets the data recording ending date.- See Also:
-
isInstantaneous
public boolean isInstantaneous()Returns true if the data recording originated from one date and time with essentially no data recording duration. -
formatDate
Formats the first date. This method mainly exists as legacy code for classes that have no knowledge of multi-temporal data and may be deprecated in the future. -
formatDate
Formats the first date. This method mainly exists as legacy code for classes that have no knowledge of multi-temporal data and may be deprecated in the future. -
formatDate
Formats the first date. This method mainly exists as legacy code for classes that have no knowledge of multi-temporal data and may be deprecated in the future. -
getTimePeriods
Gets the list of time periods for data recording.- Returns:
- the list of time periods.
- See Also:
-
setTimePeriods
Sets the list of time periods for data recording.- Parameters:
periodList
- the new list of time periods.- See Also:
-
getTransform
Gets the earth transform object. -
getOrigin
Gets the data origin. -
getHistory
Gets the data command history. -
setTransform
Sets the earth transform.- Parameters:
trans
- the new earth transform to use.
-
getSceneTime
Gets the scene time in terms of day or night for the specified 2D scene bounds. The date and time used to determine the scene time is the starting date of the first time period.- Parameters:
upperLeft
- the upper-left 2D scene boundary.lowerRight
- the lower-right 2D scene boundary.- Returns:
- a descriptive scene time string. The scene time is
day
for daytime scenes,night
for nighttime scenes, orday/night
for a scene that crosses the terminator.
-
getSceneTime
Gets the scene time in terms of day or night for the specified 2D scene dimensions. The date and time used to determine the scene time is the starting date of the first time period.- Parameters:
dims
- the scene boundary dimensions as [rows, columns].- Returns:
- a descriptive scene time string. The scene time is
day
for daytime scenes,night
for nighttime scenes, orday/night
for a scene that crosses the terminator.
-
updateHistory
Appends a command line to the history attribute.- Parameters:
command
- the command or program name.argv
- an array of command line arguments.
-
clone
- Overrides:
clone
in classMetadataContainer
-
appendWithoutDuplicates
Appends another info object to this one in duplicate removal mode.- Since:
- 3.5.0
- See Also:
-
appendWithDuplicates
Appends another info object to this one in duplicate preserving mode.- Since:
- 3.5.0
- See Also:
-
append
Appends another info object to this one.- Parameters:
appendInfo
- the info object to append.duplicatePreserving
- the dupicate mode flag, true if metadata should be appended exactly so that duplicate values are preserved, false if not.- Returns:
- the newly created object.
- Throws:
IllegalArgumentException
- if the classes or earth transforms for this object and the object to append do not match.
-