::: content
[;{.source}]{.comments} {.source}[; NOSA HEADER START{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; The contents of this file are subject to the terms of the NASA Open {.source}]{.comments} {.source}[; Source Agreement (NOSA), Version 1.3 only (the "Agreement"). You may {.source}]{.comments} {.source}[; not use this file except in compliance with the Agreement.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; You can obtain a copy of the agreement at{.source}]{.comments} {.source}[; docs/NASA_Open_Source_Agreement_1.3.txt{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; See the Agreement for the specific language governing permissions{.source}]{.comments} {.source}[; and limitations under the Agreement.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; When distributing Covered Code, include this NOSA HEADER in each{.source}]{.comments} {.source}[; file and include the Agreement file at {.source}]{.comments} {.source}[; docs/NASA_Open_Source_Agreement_1.3.txt. If applicable, add the {.source}]{.comments} {.source}[; following below this NOSA HEADER, with the fields enclosed by {.source}]{.comments} {.source}[; brackets "[]" replaced with your own identifying information: {.source}]{.comments} {.source}[; Portions Copyright [yyyy] [name of copyright owner]{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; NOSA HEADER END{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; Copyright (c) 2010-2024 United States Government as represented by the {.source}]{.comments} {.source}[; National Aeronautics and Space Administration. No copyright is claimed {.source}]{.comments} {.source}[; in the United States under Title 17, U.S.Code. All Other Rights Reserved.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[;+{.source}]{.comments} {.source}[; This class is an IDL representation of the TimeInterval element from {.source}]{.comments} {.source}[; the{.source}]{.comments} {.source}[; <a href="https://cdaweb.gsfc.nasa.gov/">Coordinated Data Analysis {.source}]{.comments} {.source}[; System</a> (CDAS) and{.source}]{.comments} {.source}[; <a href="http://sscweb.gsfc.nasa.gov/">Satellite Situation Center</a>{.source}]{.comments} {.source}[; (SSC) XML schemas.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; Notes:{.source}]{.comments} {.source}[; <ol>{.source}]{.comments} {.source}[; <li>This class exists in both the CDAS and SSC web service IDL{.source}]{.comments} {.source}[; libraries. They should be kept identical to void incompatiblities{.source}]{.comments} {.source}[; for clients that use both libraries simultaneously.</li>{.source}]{.comments} {.source}[; </ol>{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @copyright Copyright (c) 2010-2024 United States Government as {.source}]{.comments} {.source}[; represented by the National Aeronautics and Space Administration.{.source}]{.comments} {.source}[; No copyright is claimed in the United States under Title 17,{.source}]{.comments} {.source}[; U.S.Code. All Other Rights Reserved.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @author B. Harris{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[;+{.source}]{.comments} {.source}[; Creates an SpdfTimeInterval object.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @param start {in} {type=string/julday}{.source}]{.comments} {.source}[; start time of interval. Value may be either an{.source}]{.comments} {.source}[; <a href="https://en.wikipedia.org/wiki/ISO_8601">{.source}]{.comments} {.source}[; ISO 8601</a> date/time string or a julday value.{.source}]{.comments} {.source}[; @param stop {in} {type=string/julday}{.source}]{.comments} {.source}[; stop time of interval. Value may be either an{.source}]{.comments} {.source}[; <a href="https://en.wikipedia.org/wiki/ISO_8601">{.source}]{.comments} {.source}[; ISO 8601</a> date/time string or a julday value.{.source}]{.comments} {.source}[; @returns reference to an SpdfTimeInterval object.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::init:source}function SpdfTimeInterval::init, $ start, stop compile_opt idl2 self.cdawebFormat = $ '(I4, "/", I02, "/", I02, " ", I02, ":", I02, ":", I02)' self.iso8601Format = $ '(I4, "-", I02, "-", I02, "T", I02, ":", I02, ":", F06.3, "Z")' self.shortIso8601Format = $ '(I4, 1X, I2, 1X, I2, 1X, I2, 1X, I2, 1X, F06.3)' self.basicIso8601Format = $ '(I4, I02, I02, "T", I02, I02, I02, "Z")' if (size(start, /type) eq 7) then begin self.start = self->getJulDayFromIso8601(start) endif else begin self.start = start endelse if size(stop, /type) eq 7 then begin self.stop = self->getJulDayFromIso8601(stop) endif else begin self.stop = stop endelse return, self end {.source}[;+{.source}]{.comments} {.source}[; Performs cleanup operations when this object is destroyed.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::cleanup:source}pro SpdfTimeInterval::cleanup compile_opt idl2 end {.source}[;+{.source}]{.comments} {.source}[; Get the start value.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @returns julday start value.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::getStart:source}function SpdfTimeInterval::getStart compile_opt idl2 return, self.start end {.source}[;+{.source}]{.comments} {.source}[; Sets the start value.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @param value {in} {type=julday} new value{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::setStart:source}pro SpdfTimeInterval::setStart, $ value compile_opt idl2 self.start = value end {.source}[;+{.source}]{.comments} {.source}[; Get the stop value.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @returns julday stop value.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::getStop:source}function SpdfTimeInterval::getStop compile_opt idl2 return, self.stop end {.source}[;+{.source}]{.comments} {.source}[; Sets the stop value.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @param value {in} {type=julday} new value{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::setStop:source}pro SpdfTimeInterval::setStop, $ value compile_opt idl2 self.stop = value end {.source}[;+{.source}]{.comments} {.source}[; Converts the given ISO 8601 time value string into the {.source}]{.comments} {.source}[; corresponding julday value.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @param value {in} {type=string}{.source}]{.comments} {.source}[; ISO 8601 date/time value{.source}]{.comments} {.source}[; @returns julday value corresponding to the given iso8601 value.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::getJulDayFromIso8601:source}function SpdfTimeInterval::getJulDayFromIso8601, $ value compile_opt idl2 {.source}[; compile_opt static (idl 8.3) except for self.iso8601Format constant{.source}]{.comments}iso8601 = value if strlen(value) eq 10 then begin iso8601 = value + ' 00:00:00' endif reads, iso8601, format=self.shortIso8601Format, $ year, month, day, hour, minute, second return, julday(month, day, year, hour, minute, second) end{.source}[;+{.source}]{.comments} {.source}[; Converts the given julday value into the corresponding ISO 8601 {.source}]{.comments} {.source}[; time value string.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @param value {in} {type=string}{.source}]{.comments} {.source}[; julday value.{.source}]{.comments} {.source}[; @keyword basicFormat {in} {optional} {type=boolean} {default=false}{.source}]{.comments} {.source}[; Indicates whether the "basic" (minimal field separators) ISO 8601{.source}]{.comments} {.source}[; format is to be returned.{.source}]{.comments} {.source}[; @returns ISO 8601 date/time value corresponding to the given {.source}]{.comments} {.source}[; julday value.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::getIso8601FromJulDay:source}function SpdfTimeInterval::getIso8601FromJulDay, $ value, $ basicFormat = basicFormat compile_opt idl2 {.source}[; compile_opt static (idl 8.3) except for self.iso8601Format constant{.source}]{.comments}format = self.iso8601Format if keyword_set(basicFormat) && basicFormat then begin format = self.basicIso8601Format endif caldat, value, month, day, year, hour, minute, second return, string(year, month, day, hour, minute, second, $ format=format) end{.source}[;+{.source}]{.comments} {.source}[; Get the start value.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @keyword basicFormat {in} {optional} {type=boolean} {default=false}{.source}]{.comments} {.source}[; Indicates whether the "basic" (minimal field separators) ISO 8601{.source}]{.comments} {.source}[; format is to be returned.{.source}]{.comments} {.source}[; @returns start value as an ISO 8601 string.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::getIso8601Start:source}function SpdfTimeInterval::getIso8601Start, $ basicFormat = basicFormat compile_opt idl2 return, self->getIso8601FromJulDay(self.start, basicFormat=basicFormat) end {.source}[;+{.source}]{.comments} {.source}[; Get the stop value.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @keyword basicFormat {in} {optional} {type=boolean} {default=false}{.source}]{.comments} {.source}[; Indicates whether the "basic" (minimal field separators) ISO 8601{.source}]{.comments} {.source}[; format is to be returned.{.source}]{.comments} {.source}[; @returns stop value as an ISO 8601 string.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::getIso8601Stop:source}function SpdfTimeInterval::getIso8601Stop, $ basicFormat = basicFormat compile_opt idl2 return, self->getIso8601FromJulDay(self.stop, basicFormat=basicFormat) end {.source}[;+{.source}]{.comments} {.source}[; Get the start value.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @returns start value as an cdaweb format string.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::getCdawebStart:source}function SpdfTimeInterval::getCdawebStart compile_opt idl2 caldat, self.start, month, day, year, hour, minute, second return, string(year, month, day, hour, minute, second, $ format=self.cdawebFormat) end {.source}[;+{.source}]{.comments} {.source}[; Get the stop value.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @returns stop value as an cdaweb format string.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::getCdawebStop:source}function SpdfTimeInterval::getCdawebStop compile_opt idl2 caldat, self.stop, month, day, year, hour, minute, second return, string(year, month, day, hour, minute, second, $ format=self.cdawebFormat) end {.source}[;+{.source}]{.comments} {.source}[; Determines if the start time is less than the stop time.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @returns true if the start time is less than the stop time.{.source}]{.comments} {.source}[; Otherwise false.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::isStartLessThanStop:source}function SpdfTimeInterval::isStartLessThanStop compile_opt idl2 return, self.start lt self.stop end {.source}[;+{.source}]{.comments} {.source}[; Determines if this interval is larger than one day.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @returns true if this interval is larger than one day.{.source}]{.comments} {.source}[; Otherwise false.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::isGreaterThan1Day:source}function SpdfTimeInterval::isGreaterThan1Day compile_opt idl2 return, (self.stop - self.start) gt 1 end {.source}[;+{.source}]{.comments} {.source}[; Prints a textual representation of this object.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::print:source}pro SpdfTimeInterval::print compile_opt idl2 print, 'TimeInterval: ', self->getIso8601Start(), ' to ', $ self->getIso8601Stop() end {.source}[;+{.source}]{.comments} {.source}[; Creates a TimeInterval element using the given XML DOM document with the{.source}]{.comments} {.source}[; values of this object.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @param doc {in} {type=IDLffXMLDOMDocument}{.source}]{.comments} {.source}[; document in which to create the TimeInterval element.{.source}]{.comments} {.source}[; @returns a reference to a new IDLffXMLDOMElement representation of{.source}]{.comments} {.source}[; this object.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval::createDomElement:source}function SpdfTimeInterval::createDomElement, $ doc compile_opt idl2 timeIntervalElement = doc->createElement('TimeInterval') startElement = doc->createElement('Start') ovoid = timeIntervalElement->appendChild(startElement) startTextNode = doc->createTextNode(self->getIso8601Start()) ovoid = startElement->appendChild(startTextNode) endElement = doc->createElement('End') ovoid = timeIntervalElement->appendChild(endElement) endTextNode = doc->createTextNode(self->getIso8601Stop()) ovoid = endElement->appendChild(endTextNode) return, timeIntervalElement end {.source}[;+{.source}]{.comments} {.source}[; Defines the SpdfTimeInterval class.{.source}]{.comments} {.source}[;{.source}]{.comments} {.source}[; @field start julday start value of interval.{.source}]{.comments} {.source}[; @field stop julday stop value of interval.{.source}]{.comments} {.source}[; @field cdawebFormat constant format string for a "cdaweb" time format.{.source}]{.comments} {.source}[; @field iso8601Format constant format string for an ISO 8601 value.{.source}]{.comments} {.source}[; @field shortIso8601Format short version of a constant format string {.source}]{.comments} {.source}[; for an ISO 8601 value.{.source}]{.comments} {.source}[; @field basicIso8601Format constant format string for a "basic" (minimal{.source}]{.comments} {.source}[; field separators) ISO 8601 value.{.source}]{.comments} {.source}[;-{.source}]{.comments} {.source}[]{#SpdfTimeInterval__define:source}pro SpdfTimeInterval__define compile_opt idl2 struct = { SpdfTimeInterval, $ start:0d, $ stop:0d, $ cdawebFormat:'', $ iso8601Format:'', $ shortIso8601Format:'', $ basicIso8601Format:'' $ } end {.source}
:::