-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use commands v2 for AGASC supplement update #135
Conversation
This is just a WIP but it looks like I ran into a little trouble running it on my laptop:
Is "out of overflow pages" the same as out of memory? This doesn't need to run on my laptop but interesting. |
Though I suppose I'm really not sure if my comment about "out of overflow pages" belongs here or on sot/kadi#221 . |
this error comes straight from the kadi function, so it should be there. Still, it sounds like something to consider in the kadi PR. |
ah, but not necessarily, because I am not using the |
The bit about the HASH error is now at sot/kadi#252. This shouldn't be considered a blocker on this PR but it will require attention. |
sot/kadi#252 has been closed by sot/kadi#253. I confirm that the crash that @jeanconn noted no longer occurs. With no cache file I ran the following. It took 4 minutes, but ran without problems. The second time running took 17 seconds.
I don't understand the design of this module which is reading every star catalog in the entire mission every time, but that is out of scope here. |
STARS_OBS_MAP = None | ||
STARS_OBS_NP = None | ||
|
||
def get_star_observations(start=None, stop=None, obsid=None, join_keys=['starcat_date', 'obsid']): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to have join_keys
as a free parameter that can be specified? If this function is really returning a table of unique "star obs" records as defined in the rest of the agasc
code, then nothing but join_keys=['starcat_date', 'obsid']
will work.
Related, add a docstring here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the join keys into the function.
STARS_OBS_NP = None | ||
|
||
def get_star_observations(start=None, stop=None, obsid=None, join_keys=['starcat_date', 'obsid']): | ||
from kadi import commands |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import doesn't need to be local.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it out of the function. This import indeed needed to be local when kadi was django based, because of the multi-process option.
observations = observations[~observations['starcat_date'].mask] | ||
# the following line removes manual commands | ||
observations = observations[observations['source'] != 'CMD_EVT'] | ||
observations['idx'] = np.arange(len(observations)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this idx
column doing? If it is needed later on then add a comment here about why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed it
_load_startcat_commands(tstop) | ||
_load_observed_catalogs() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useful for testing this PR, but at this point all the commands V1 functionality can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was completely removed.
I ran this branch and ran the testing notebook with a few of my own checks, and I think this is basically ready modulo the minor comments. |
… v2 does not get rid of non-normal-pointing times
Following up on the original sanity check from @jeanconn -
It works! |
# Check that the association is correct. | ||
dt = CxoTime(dwells['manvr_start'][idxs]) - CxoTime(STARCAT_CMDS['mp_starcat_time']) | ||
ok = (dt.sec > 1) & (dt.sec < 1200) | ||
with commands.conf.set_temp('commands_version', '2'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed any more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good pending fix of that commands V2 conf set command and some sort of sanity check after that.
Description
This PR completely removes all uses of timelines and kadi commands v1.
A preliminary exploration of the differences in the two observation lists (from commands v1 and v2) can be found here. We went over that notebook a while ago, and since then kadi commands v2 became the standard, so at this point we trust that the observations are properly defined.
to do:
test_obs_status.py::test_override
fails.Interface impacts
The columns of
star_obs_catalogs.STARS_OBS
will change (see notebook).Consequently the columns in
mag_stats_obsid.fits
file also change. This file can be updated during promotion by running the following script on it:Testing
Comprehensive functional test is described below.
Unit tests
Independent check of unit tests by [REVIEWER NAME]
Functional tests
--multi-process
option failed in master, not in the branch.--report
option. I did not fix it because: a) it might be related to the safe mode, b) it is unrelated to this PR because it failed in both cases.mag_stats_obsid.fits
file to remove thetimeline_id
column:timeline_id
column frommag_stats_obsid.fits
:No level 0 data
in v2 (AGASC 896538696, OBSID 26758)