kadi.commands.observations.get_observations#

kadi.commands.observations.get_observations(start=None, stop=None, *, obsid=None, obsid_sched=None, scenario=None, cmds=None, starcat_date=None, event_filter=None, **obs_filter)#

Get observations corresponding to input parameters.

The start, stop, starcat_date, obsid, and obsid_sched parameters serve as matching filters on the list of observations that is returned. In addition, you can filter on any of the observation parameters, for instance source or simpos, by passing those as keyword arguments.

obsid_sched is the original scheduled ObsID for an observation. This can differ from obsid after an SCS-107 when the observing loads stop. This is only available for observations after the APR1420B loads.

Over the mission there are thousands of instances of multiple observations with the same obsid, so this function always returns a list of observation parameters even when obsid is specified. This most frequently occurs after any unexpected stoppage of the observing loads (SCS-107) which therefore cancels subsequent obsid commanding. In many cases you can just use the first element.

Examples:

>>> from kadi.commands import get_observations
>>> obs = get_observations(obsid=8008)[0]
>>> obs
{'obsid': 8008,
'simpos': 92904,
'obs_stop': '2007:002:18:04:28.965',
'manvr_start': '2007:002:04:31:48.216',
'targ_att': (0.149614271, 0.490896707, 0.831470649, 0.21282047),
'npnt_enab': True,
'obs_start': '2007:002:04:46:58.056',
'prev_att': (0.319214732, 0.535685207, 0.766039803, 0.155969017),
'starcat_date': '2007:002:04:31:43.965',
'starcat_idx': 147908,
'source': 'DEC2506C'}

>>> obs_all = get_observations()  # All observations in commands archive

# Might be convenient to handle this as a Table
>>> from astropy.table import Table
>>> obs_all = Table(obs_all)

>>> from kadi.commands import get_observations
>>> get_observations(starcat_date='2022:001:17:00:58.521')
[{'obsid': 23800,
'simpos': 75624,
'obs_stop': '2022:002:01:24:53.004',
'manvr_start': '2022:001:17:01:02.772',
'targ_att': (0.177875061, 0.452625075, 0.827436517, 0.280784286),
'npnt_enab': True,
'obs_start': '2022:001:17:33:53.255',
'prev_att': (0.116555575, -0.407948573, -0.759717367, 0.492770009),
'starcat_date': '2022:001:17:00:58.521',
'starcat_idx': 171677,
'source': 'DEC3021A'}]
Parameters:
startCxoTime-like, None

Start time (default=beginning of commands)

stopCxoTime-like, None

Stop time (default=end of commands)

obsidint, None

Return observations matching requested ObsID

obsid_schedint, None

Return observations matching requested scheduled ObsID from the as-planned loads. This can differ from obsid after an SCS-107. This is only available for observations after the APR1420B loads.

scenariostr, None

Scenario

cmdsCommandTable, None

Use this command table instead of querying the archive

starcat_dateCxoTime-like, None

Date of the observation’s star catalog

event_filtercallable, list of callable, None

Callable function or list of callable functions that takes an Event Table as input and returns a boolean mask with same length as Table. If None, no filtering is done.

**obs_filterdict

Additional filters on the observation parameters. The keys should be parameter names, for instance source or simpos.

Returns:
list of dict

Observation parameters for matching observations.