Class EarthDataInfo

java.lang.Object
noaa.coastwatch.util.MetadataContainer
noaa.coastwatch.util.EarthDataInfo
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
SatelliteDataInfo

public class EarthDataInfo extends MetadataContainer
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 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

      public EarthDataInfo(String source, Date date, 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.
      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

      public String 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

      public Date 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

      public Date getStartDate()
      Gets the data recording start date, the same value as the getDate() method.
      See Also:
    • getEndDate

      public Date 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

      public String formatDate(String format)
      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.
      See Also:
    • formatDate

      public String formatDate(String format, TimeZone zone)
      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.
      See Also:
    • formatDate

      public String formatDate(String format, EarthLocation loc)
      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.
      See Also:
    • getTimePeriods

      public List<TimePeriod> getTimePeriods()
      Gets the list of time periods for data recording.
      Returns:
      the list of time periods.
      See Also:
    • setTimePeriods

      public void setTimePeriods(List<TimePeriod> periodList)
      Sets the list of time periods for data recording.
      Parameters:
      periodList - the new list of time periods.
      See Also:
    • getTransform

      public EarthTransform getTransform()
      Gets the earth transform object.
    • getOrigin

      public String getOrigin()
      Gets the data origin.
    • getHistory

      public String getHistory()
      Gets the data command history.
    • setTransform

      public void setTransform(EarthTransform trans)
      Sets the earth transform.
      Parameters:
      trans - the new earth transform to use.
    • getSceneTime

      public String getSceneTime(DataLocation upperLeft, DataLocation lowerRight)
      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, or day/night for a scene that crosses the terminator.
    • getSceneTime

      public String getSceneTime(int[] dims)
      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, or day/night for a scene that crosses the terminator.
    • updateHistory

      public void updateHistory(String command, String[] argv)
      Appends a command line to the history attribute.
      Parameters:
      command - the command or program name.
      argv - an array of command line arguments.
    • clone

      public Object clone()
      Overrides:
      clone in class MetadataContainer
    • appendWithoutDuplicates

      public EarthDataInfo appendWithoutDuplicates(EarthDataInfo appendInfo)
      Appends another info object to this one in duplicate removal mode.
      Since:
      3.5.0
      See Also:
    • appendWithDuplicates

      public EarthDataInfo appendWithDuplicates(EarthDataInfo appendInfo)
      Appends another info object to this one in duplicate preserving mode.
      Since:
      3.5.0
      See Also:
    • append

      public EarthDataInfo append(EarthDataInfo appendInfo, boolean duplicatePreserving)
      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.