chandra-mta / Ocat_Flask_App

USINT Ocat written in the Python Flask Web Framework
0 stars 0 forks source link

Refactor check_mp_notes() notification #54

Closed william-aaron-CFA closed 2 months ago

william-aaron-CFA commented 2 months ago

Currently the check_mp_notes() in the ocatdatapage/send_notifications.py script sends out relevant notification emails to Mission Planning in the event an observation has a large coordinate shift, has parameter changes to an obsid scheduled in 10 days, or is in the active OR list. This function should also include a notification email in case of a target name change.

However, including the target name change option will be easier with a slight refactor of the notification email data structure from a list of lists to a python dictionary containing the relevant notification details.

https://github.com/chandra-mta/Ocat_Flask_App/blob/9cec1c4f35b3485db72bcde3d0728b6aadb45275/cus_app/ocatdatapage/send_notifications.py#L148-L240

This will also require a refactor of how the specific obsids requiring MP attention are checked. This is performed in the following code lines. https://github.com/chandra-mta/Ocat_Flask_App/blob/9cec1c4f35b3485db72bcde3d0728b6aadb45275/cus_app/ocatdatapage/update_data_record_file.py#L98-L109

https://github.com/chandra-mta/Ocat_Flask_App/blob/9cec1c4f35b3485db72bcde3d0728b6aadb45275/cus_app/ocatdatapage/submit_other_obsids.py#L145-L153

https://github.com/chandra-mta/Ocat_Flask_App/blob/9cec1c4f35b3485db72bcde3d0728b6aadb45275/cus_app/ocatdatapage/routes.py#L341-L360

william-aaron-CFA commented 2 months ago

Issue addressed in #55