Skip to content
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

Set acq stats processing to continue on individual obsid exceptions #291

Merged
merged 2 commits into from
Feb 15, 2024

Conversation

jeanconn
Copy link
Contributor

@jeanconn jeanconn commented Feb 1, 2024

Description

Skip any Exceptions in nominal processing over obsids. The acq stats processing maneuver and dwell times don't make sense for obsid 62650 (causing IndexError) and it isn't worth the redesign of the code just now.

Interface impacts

Testing

Unit tests

  • Linux

Independent check of unit tests by [REVIEWER NAME]

  • [PLATFORM]:

Functional tests

This is the error in flight/master on the nsm / post-nsm obsid:

Skipping obsid 29211: No starcheck catalog found for 29211
Processing obsid 62620
Traceback (most recent call last):
  File "/proj/sot/ska3/flight/lib/python3.10/site-packages/mica/stats/update_acq_stats.py", line 503, in calc_stats
    raise ValueError
ValueError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/proj/sot/ska3/flight/share/mica/update_acq_stats.py", line 6, in <module>
    update_acq_stats.main()
  File "/proj/sot/ska3/flight/lib/python3.10/site-packages/mica/stats/update_acq_stats.py", line 709, in main
    update(opt)
  File "/proj/sot/ska3/flight/lib/python3.10/site-packages/mica/stats/update_acq_stats.py", line 691, in update
    obsid_info, acq_stats, star_info, catalog, temp = calc_stats(obsid)
  File "/proj/sot/ska3/flight/lib/python3.10/site-packages/mica/stats/update_acq_stats.py", line 511, in calc_stats
    multi = multi_manvr.select_overlapping(events.obsids(obsid=obsid))
  File "/proj/sot/ska3/flight/lib/python3.10/site-packages/kadi/events/models.py", line 341, in select_overlapping
    start = DateTime(events[0].tstart) - 30
IndexError: list index out of range

This code is awkward to setup to test, so I just made a local edit to change the "table_file" to a local h5 file, copied the current acq stats h5 to that, and confirmed that an update runs over the NSM obsid(s).

ska3-jeanconn-fido> python mica/stats/update_acq_stats.py 
Processing obsid 29211
Found obsid manvr at 2024:025:12:58:55.648
Found dwell at 2024:025:13:04:07.760
Skipping obsid 29211: No starcheck catalog found for 29211
Processing obsid 62620
Skipping obsid 62620: list index out of range
Processing obsid 43761
...
Processing obsid 27349
Found obsid manvr at 2024:035:00:31:34.176
Found dwell at 2024:035:01:12:27.513
calculating statistics
arranging stats into tabular data
saving stats to h5 table
Processing obsid 65522
Skipping obsid 65522: list index out of range
ska3-jeanconn-fido> 

@jeanconn jeanconn marked this pull request as ready for review February 1, 2024 18:39
@jeanconn jeanconn changed the title Set acq stats processing to continue on IndexError Set acq stats processing to continue on individual obsid exceptions Feb 1, 2024
@jeanconn jeanconn merged commit 359a9d7 into master Feb 15, 2024
@jeanconn jeanconn deleted the nsm-2024024 branch February 15, 2024 15:03
This was referenced Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants