ArrayTimeInterval

class ArrayTimeInterval(start=None, duration=None)[source]

Bases: object

Adapted from the c++ and java implementations.

Methods Summary

contains(atORati)

Checks if this ArrayTimeInterval “contains” either an ArrayTime or an ArrayTimeInterval.

containsArrayTime(at)

Checks if this ArrayTimeInterval “contains” the ArrayTime passed as a parameter.

containsArrayTimeInterval(ati)

Checks if this ArrayTimeInterval “contains” the one passed as a parameter.

equals(ati)

return True if and only if ati is an instance of ArrayTimeInterval and has the same start and duration values as this ArrayTimeInterval.

from1DBin()

Read the binary representations of a 1D array of ArrayTimeInterval from an EndianInput instance to set a 1D list of ArrayTimeInterval.

from2DBin()

Read the binary representations of a 2D array of ArrayTimeInterval from an EndianInput instance to set a 2D list of ArrayTimeInterval.

from3DBin()

Read the binary representations of a 3D array of ArrayTimeInterval from an EndianInput instance to set a 3D list of ArrayTimeInterval.

fromBin(eis)

Read the binary representation of an ArrayTimeInterval from an EndianInput instance and use the read values to set an ArrayTimeInterval.

getDuration()

return the duration of this ArrayTimeInterval as an Interval.

getDurationInDays()

return the duration of this ArrayTimeInterval as a number of days (float).

getDurationInNanoSeconds()

return the duration of this ArrayTimeInterval as a number of nanoseconds (int)

getInstance(stringList)

Retrieve two values from a list of strings and convert that to an ArrayTimeInterval

getMidPoint()

return the midpoint of this ArrayTimeInterval as an ArrayTIme.

getStart()

return the start time of this ArrayTimeInterval as an ArrayTime

getStartInMJD()

return the start time of this ArrayTimeInterval as an MJD (float).

getStartInNanoSeconds()

return the start time of this ArrayTimeInterval as a number of nanoseconds (int).

listTo1DBin(atiList, eout)

Write the binary representation of a 1D list of ArrayTimeInterval instances to an EndianOutput instance.

listTo2DBin(atiList, eout)

Write the binary representation of a 2D list of ArrayTimeInterval instances to an EndianOutput instance.

listTo3DBin(atiList, eout)

Write the binary representation of a 3D list of ArrayTimeInterval instances to an EndianOutput instance.

listToBin(atiList, eos)

Write a list of ArrayTimeInterval to the EndianOutput.

overlaps(ati)

Checks if this ArrayTimeInterval overlaps the one passed as a parameter.

readStartTimeDurationInBin()

Returns a boolean value whose meaning is defined as follows: True <=> the representation of ArrayTimeInterval object found in any binary table will be considered as (startTime, duration).

readStartTimeDurationInXML()

Returns a boolean value whose meaning is defined as follows: True <=> the representation of ArrayTimeInterval object found in any binary table will be considered as (startTime, duration).

setDuration(duration)

Set the duration of an ArrayTimeInterval.

setReadStartTimeDurationInBin(torf)

Defines how the representation of an ArrayTimeInterval found in subsequent reads of a document containing table exported in binary must be interpreted.

setReadStartTimeDurationInXML(torf)

Defines how the representation of an ArrayTimeInterval found in subsequent reads of a document containing table exported in XML must be interpreted.

setStart(start)

Set the start value of an ArrayTimeInterval.

toBin(eout)

Write the binary representation to an EndianOutput instance It successively writes midpoint and duration.

Methods Documentation

contains(atORati)[source]

Checks if this ArrayTimeInterval “contains” either an ArrayTime or an ArrayTimeInterval.

param atOrati is either an ArrayTime or an ArrayTimeInterval to be checked for the “contains” relationship. return True if and only if this contains at.

containsArrayTime(at)[source]

Checks if this ArrayTimeInterval “contains” the ArrayTime passed as a parameter.

param at the ArrayTime to be checked for the “contains” relationship. return True if and only if this contains at.

containsArrayTimeInterval(ati)[source]

Checks if this ArrayTimeInterval “contains” the one passed as a parameter.

param ati the ArrayTimeInterval to be checked for the “contains” relationship. return True if and only if this contains ati.

equals(ati)[source]

return True if and only if ati is an instance of ArrayTimeInterval and has the same start and duration values as this ArrayTimeInterval.

from1DBin()[source]

Read the binary representations of a 1D array of ArrayTimeInterval from an EndianInput instance to set a 1D list of ArrayTimeInterval. return a 1D list of ArrayTimeInterval

from2DBin()[source]

Read the binary representations of a 2D array of ArrayTimeInterval from an EndianInput instance to set a 2D list of ArrayTimeInterval. return a 1D list of ArrayTimeInterval

from3DBin()[source]

Read the binary representations of a 3D array of ArrayTimeInterval from an EndianInput instance to set a 3D list of ArrayTimeInterval. return a 3D list of ArrayTimeInterval

static fromBin(eis)[source]

Read the binary representation of an ArrayTimeInterval from an EndianInput instance and use the read values to set an ArrayTimeInterval.

return an ArrayTimeInterval

Remember that it reads two long integers (64 bits). The first one is considered as the midpoint of the interval and the second one is the duration. If readStartTimeDurationInBin() is True then the first integer is interpreted as the start time, not the midpoint, of the interval.0

getDuration()[source]

return the duration of this ArrayTimeInterval as an Interval.

getDurationInDays()[source]

return the duration of this ArrayTimeInterval as a number of days (float).

getDurationInNanoSeconds()[source]

return the duration of this ArrayTimeInterval as a number of nanoseconds (int)

static getInstance(stringList)[source]

Retrieve two values from a list of strings and convert that to an ArrayTimeInterval

This is used when parsing ArrayTimeInterval lists from an XML representation to eventually construct a list of ArrayTimeInterval instances. The values are expected to be integers representing nanoseconds with the first value being either the midpoint or start of an interval and the second value being the duration. readStartTimeDurationInXML() is used to determine how that first value is interepreted.

Returns a tuple of (ArrayTimeInterval, stringList) where ArrayTimeInterval is the new ArrayTimeInterval created by this call and stringList is the remaining, unused, part of stringList after removing the first element.

getMidPoint()[source]

return the midpoint of this ArrayTimeInterval as an ArrayTIme.

The midpoint is defind as start + duration / 2

getStart()[source]

return the start time of this ArrayTimeInterval as an ArrayTime

getStartInMJD()[source]

return the start time of this ArrayTimeInterval as an MJD (float).

getStartInNanoSeconds()[source]

return the start time of this ArrayTimeInterval as a number of nanoseconds (int).

static listTo1DBin(atiList, eout)[source]

Write the binary representation of a 1D list of ArrayTimeInterval instances to an EndianOutput instance.

static listTo2DBin(atiList, eout)[source]

Write the binary representation of a 2D list of ArrayTimeInterval instances to an EndianOutput instance.

static listTo3DBin(atiList, eout)[source]

Write the binary representation of a 3D list of ArrayTimeInterval instances to an EndianOutput instance.

static listToBin(atiList, eos)[source]

Write a list of ArrayTimeInterval to the EndianOutput. The list may have 1, 2 or 3 dimensions.

overlaps(ati)[source]

Checks if this ArrayTimeInterval overlaps the one passed as a parameter. param ati the ArrayTimeInterval to be checked for overlapping. return True if and only if there is overlapping.

static readStartTimeDurationInBin()[source]

Returns a boolean value whose meaning is defined as follows: True <=> the representation of ArrayTimeInterval object found in any binary table will be considered as (startTime, duration). False <=> the representation of ArrayTimeInterval object found in any binary table will be considered as (midPoint, duration).

This returns a value found in this module outside of this class.

static readStartTimeDurationInXML()[source]

Returns a boolean value whose meaning is defined as follows: True <=> the representation of ArrayTimeInterval object found in any binary table will be considered as (startTime, duration). False <=> the representation of ArrayTimeInterval object found in any binary table will be considered as (midPoint, duration).

This returns a value found in this module outside of this class.

setDuration(duration)[source]

Set the duration of an ArrayTimeInterval.

duration man be an Interval defining the new duration, a float defining the duration in days, or an integer definining the duration in nanoseconds.

note if necessary the duration is clipped to the highest possible value given the start time of this ArrayTimeInterval.

static setReadStartTimeDurationInBin(torf)[source]

Defines how the representation of an ArrayTimeInterval found in subsequent reads of a document containing table exported in binary must be interpreted. The interpretation depends on the value of the argument torf : torf == True means that it must be interpreted as (startTime, duration) torf == False means that it must be interpreted as (midPoint, duration)

This sets a value found in this module outside of this class.

param b a boolean value.

static setReadStartTimeDurationInXML(torf)[source]

Defines how the representation of an ArrayTimeInterval found in subsequent reads of a document containing table exported in XML must be interpreted. The interpretation depends on the value of the argument torf : torf == True means that it must be interpreted as (startTime, duration) torf == false means that it must be interpreted as (midPoint, duration)

This sets a value found in this module outside of this class.

param torf is a bool value.

setStart(start)[source]

Set the start value of an ArrayTimeInterval.

start can be an ArrayTime, a float (used as a Modified Julian Date) or an integer (used as nanoseconds).

note the duration is left unchanged except that if necessary it’s clipped to the highest possible value given the new start time.

toBin(eout)[source]

Write the binary representation to an EndianOutput instance It successively writes midpoint and duration.