From 39ed6dbba09a8cceaebbc16cb0e34938a8e5a2e0 Mon Sep 17 00:00:00 2001 From: Javier Gonzalez Date: Wed, 30 Aug 2023 14:58:43 -0400 Subject: [PATCH] in agasc supplement processing, only consider observations before the last dwell in kadi.events --- agasc/supplement/magnitudes/star_obs_catalogs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agasc/supplement/magnitudes/star_obs_catalogs.py b/agasc/supplement/magnitudes/star_obs_catalogs.py index f2d0fa6c..00c47ad7 100644 --- a/agasc/supplement/magnitudes/star_obs_catalogs.py +++ b/agasc/supplement/magnitudes/star_obs_catalogs.py @@ -6,7 +6,8 @@ from astropy import table from chandra_aca.transform import yagzag_to_pixels -from kadi import commands +from kadi import commands, events +from cxotime import CxoTime STARS_OBS = None @@ -43,6 +44,9 @@ def get_star_observations(start=None, stop=None, obsid=None): star_obs.add_index(['mp_starcat_time']) + max_time = CxoTime(events.dwells.all().table[-1]['stop']) + star_obs = star_obs[star_obs['obs_start'] <= max_time] + return star_obs