CDFAstropy

class cdflib.epochs_astropy.CDFAstropy[source][source]

Bases: object

Class to encapsulate astropy time routines with CDF class.

Attributes Summary

increment

release

version

Methods Summary

breakdown(epochs)

breakdown_epoch(epochs)

breakdown_epoch16(epochs)

breakdown_tt2000(tt2000)

compute(datetimes)

convert_to_astropy(epochs[, format])

Convert CDF epochs to astropy time objects.

encode(epochs[, iso_8601])

findepochrange(epochs[, starttime, endtime])

parse(value)

Parses the provided date/time string(s) into CDF epoch value(s).

to_datetime(cdf_time)

unixtime(cdf_time)

Encodes the epoch(s) into seconds after 1970-01-01.

Attributes Documentation

increment = 0[source]
release = 7[source]
version = 3[source]

Methods Documentation

static breakdown(epochs)[source][source]
Parameters:

epochs (Time | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) –

Return type:

ndarray[Any, dtype[_ScalarType_co]]

static breakdown_epoch(epochs)[source][source]
Parameters:

epochs (Time) –

Return type:

ndarray[Any, dtype[_ScalarType_co]]

static breakdown_epoch16(epochs)[source][source]
Parameters:

epochs (Time) –

Return type:

ndarray[Any, dtype[_ScalarType_co]]

static breakdown_tt2000(tt2000)[source][source]
Parameters:

tt2000 (Time) –

Return type:

ndarray[Any, dtype[_ScalarType_co]]

static compute(datetimes)[source][source]
Parameters:

datetimes (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) –

Return type:

ndarray[Any, dtype[_ScalarType_co]]

static convert_to_astropy(epochs, format=None)[source][source]

Convert CDF epochs to astropy time objects.

Return type:

astropy.time.Time

Parameters:
static encode(epochs, iso_8601=True)[source][source]
Parameters:
Return type:

ndarray[Any, dtype[str_]]

static findepochrange(epochs, starttime=None, endtime=None)[source][source]
Parameters:
Return type:

Tuple[int, int]

static parse(value)[source][source]

Parses the provided date/time string(s) into CDF epoch value(s).

For CDF_EPOCH:

‘yyyy-mm-dd hh:mm:ss.xxx’ (in iso_8601). The string is the output from encode function.

For CDF_EPOCH16:

The string has to be in the form of ‘yyyy-mm-dd hh:mm:ss.mmmuuunnnppp’ (in iso_8601). The string is the output from encode function.

For TT2000:

The string has to be in the form of ‘yyyy-mm-dd hh:mm:ss.mmmuuunnn’ (in iso_8601). The string is the output from encode function.

Parameters:

value (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) –

Return type:

ndarray[Any, dtype[_ScalarType_co]]

static to_datetime(cdf_time)[source][source]
Parameters:

cdf_time (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) –

Return type:

Time

static unixtime(cdf_time)[source][source]

Encodes the epoch(s) into seconds after 1970-01-01. Precision is only kept to the nearest microsecond.

Parameters:

cdf_time (Time | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) –

Return type:

ndarray[Any, dtype[_ScalarType_co]]