adam.stk.io module

adam.stk.io.convertPointingsToSensorInterval(sensorFileName, intervalFileName, exposureStart, azimuth, elevation, epochStart, exposureEnd=None, exposureLength=None, verbose=True)

Builds a sensor pointing file and interval file for a series of sensor pointings.

WARNING TODO: Need azimuth and elevation for both start and end of exposure. See createSensorFile.

Parameters
  • sensorFileName (str) – Name to save sensor file to. Extension should not be included. (e.g., “SensorPointing”)

  • intervalFileName (str) – Name to save interval file to. Extension should not be included. (e.g., “IntervalList”)

  • exposureStart (~numpy.ndarray) – Exposure start times in seconds from epochStart. (e.g., “np.array([332, 367, …])”)

  • azimuth (~numpy.ndarray) – Azimuth angles in degrees. (e.g., “np.array([22.3454, 26.7565, …])”)

  • elevation (~numpy.ndarray) – Elevation angles in degrees. (e.g., “np.array([65.8922, 63.2398, …])”)

  • epochStart (str) – Time of epoch start. (e.g., “‘1 Jan 2022 00:00:00’”)

  • exposureEnd (~numpy.ndarray) – Exposure end times in seconds from epochStart. If not defined, will use static exposureLength to calculate exposure end times. (e.g., “np.array([362, 397, …])”)

  • exposureLength (float) – If exposure end times are None, calculate exposure end times with this static value (exposureEnd = exposureStart + exposureLength). (e.g., 30)

  • verbose (bool) – Print progress statements?

Returns

None

Raises

ValueError – If exposureLength and exposureEnd are None

adam.stk.io.convertPointingsToVectorInterval(vectorFileName, intervalFileName, exposureStart, ra, dec, epochStart, exposureEnd=None, exposureLength=None, verbose=True)

Builds a sensor pointing file and interval file for a series of sensor pointings.

Parameters
  • vectorFileName (str) – Name to save vector file to. Extension should not be included. (e.g., “VectorInput”)

  • intervalFileName (str) – Name to save interval file to. Extension should not be included. (e.g., “IntervalList”)

  • exposureStart (~numpy.ndarray) – Exposure start times in seconds from epochStart. (e.g., “np.array([332, 367, …])”)

  • ra (~numpy.ndarray) – Right ascension in degrees. (e.g., “np.array([22.3454, 26.7565, …])”)

  • dec (~numpy.ndarray) – Declination in degrees. (e.g., “np.array([65.8922, 63.2398, …])”)

  • epochStart (str) – Time of epoch start. (e.g., “‘1 Jan 2022 00:00:00’”)

  • exposureEnd (~numpy.ndarray) – Exposure end times in seconds from epochStart. If not defined, will use static exposureLength to calculate exposure end times. (e.g., “np.array([362, 397, …])”)

  • exposureLength (float) – If exposure end times are None, calculate exposure end times with this static value (exposureEnd = exposureStart + exposureLength). (e.g., 30)

  • verbose (bool) – Print progress statements?

Returns

None

Raises

ValueError – If exposureLength and exposureEnd are None

adam.stk.io.createIntervalFile(fileName, exposureStart, exposureEnd, epochStart, verbose=True)

Builds an STK interval file given a series of sensor pointing times.

Parameters
  • fileName (str) – Name to save interval file to. Extension should not be included. (e.g., “IntervalList”)

  • exposureStart (~numpy.ndarray) – Exposure start times in seconds from epochStart. (e.g., “np.array([332, 367, …])”)

  • exposureEnd (~numpy.ndarray) – Exposure end times in seconds from epochStart. (e.g., “np.array([362, 397, …])”)

  • epochStart (str) – Time of epoch start. (e.g., “‘1 Jan 2022 00:00:00’”)

  • verbose (bool) – Print progress statements?

Returns

None

adam.stk.io.createSensorFile(fileName, exposureStart, exposureEnd, azimuth, elevation, epochStart, verbose=True)

Builds an STK sensor file given a series of sensor pointings.

WARNING TODO: Need azimuth and elevation for both start and end of exposure.

Parameters
  • fileName (str) – Name to save sensor file to. Extension should not be included. (e.g., “SensorPointing”)

  • exposureStart (~numpy.ndarray) – Exposure start times in seconds from epochStart. (e.g., “np.array([332, 367, …])”)

  • exposureEnd (~numpy.ndarray) – Exposure end times in seconds from epochStart. (e.g., “np.array([362, 397, …])”)

  • azimuth (~numpy.ndarray) – Azimuth angles in degrees. (e.g., “np.array([22.3454, 26.7565, …])”)

  • elevation (~numpy.ndarray) – Elevation angles in degrees. (e.g., “np.array([65.8922, 63.2398, …])”)

  • epochStart (str) – Time of epoch start. (e.g., “‘1 Jan 2022 00:00:00’”)

  • verbose (bool) – Print progress statements?

Returns

None

adam.stk.io.createVectorFile(fileName, exposureStart, exposureEnd, ra, dec, epochStart, verbose=True)

Builds an STK vector file given a series of sensor pointings.

Parameters
  • fileName (str) – Name to save vector file to. Extension should not be included. (e.g., “VectorInput”)

  • exposureStart (~numpy.ndarray) – Exposure start times in seconds from epochStart. (e.g., “np.array([332, 367, …])”)

  • exposureEnd (~numpy.ndarray) – Exposure end times in seconds from epochStart. (e.g., “np.array([362, 397, …])”)

  • ra (~numpy.ndarray) – Right ascension in degrees. (e.g., “np.array([22.3454, 26.7565, …])”)

  • dec (~numpy.ndarray) – Declination in degrees. (e.g., “np.array([65.8922, 63.2398, …])”)

  • epochStart (str) – Time of epoch start. (e.g., “‘1 Jan 2022 00:00:00’”)

  • verbose (bool) – Print progress statements?

Returns

None

adam.stk.io.ephemeris_file_data_to_dataframe(stk_file_text) → pandas.core.frame.DataFrame

Given the text of an STK Ephemeris file, read it into a Pandas DataFrame.

Assumes the Ephemeris file has data in a sun centered ICRF frame with units of meters, seconds.

Parameters

stk_file_text (list[str]) – Contents of an STK Ephemeris file as an array of strings, one for each line

Returns

Data frame containing the cartesian position and velocity in the

JPL Ecliptic frame in units of kilometers, seconds, and the same time scale as the Ephemeris File

Return type

dataFrame (pd.DataFrame)

TODO:
  • Perform time frame transformations

  • Handle cases where units or frames could be different (but won’t handle all cases)