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

HRC swap to B-side electronics #1

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

HRC swap to B-side electronics #1

wants to merge 21 commits into from

Conversation

malgosias
Copy link
Contributor

This branch contains updates related to the HRC swap to B-side electronics. In summary:

  • Replace 2SHLDART with 2SHLDBRT and 2DETART with 2DETBRT on Snapshot page
  • Add 5 new MSIDs (2PRBSCR, 2N15VBVL, 2P15VBVL, 2P05VBVL, 2P24VBVL) to the Snapshot page
  • Add relevant subroutines to send alerts on the new 5 MSIDS
  • Add a test package for snapshot

I also removed a number of obsolete commented lines from the code to make the code easier to read.

The following files most likely can be removed from the package (please confirm):

  • check_state_alerts.pm
  • check_state_noalerts.pm
  • snaps2_alerts.par
  • snaps2_noalerts.par

Needs to be added:

  • tests folder with test telemetry to work with the test package

open MAIL, "|mailx -s 'BRIT check email now' sot_red_alert\@cfa.harvard.edu";
#open MAIL, "|mailx -s BRIT msobolewska\@cfa.harvard.edu";
#open MAIL, "|mail msobolewska\@cfa.harvard.edu";
#open MAIL, "|more"; #debug
open FILE, $afile;
while (<FILE>) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto here, where does this while loop end?

my $afile = "./.aacccdptalert";
my $tfile = "./.aacccdptwait";
my $afile = ".aacccdptalert";
my $tfile = ".aacccdptwait";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we are no longer sending alerts for high temperature ccd then do we need this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to be decided. Similarly, we also no longer send alerts for tank pressure.

return $color;
}


sub send_tank_red {
my $obstime = ${$hash{PMTANKP}}[0];
if (! time_curr($obstime)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these two lines are commented out in check_state_test.pm, what's the reason for the difference here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are commented in check_state_test.pm so that we can test with old telemetry.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So they will be un-commented when we the changes are made?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In check_state_test we always had these lines commented, I think? The idea was to be able to test on fabricated telemetry. In check_state.pm these lines are un-commented so that the alert checking happens only when real time data is flowing. In check_state_sim.pm (to be added for the SIMs) these lines will be un-commented, TEST in the subject and body of the messages will be replaced with SIM, and the mailing lists will be the same as in check_state.pm. Does is make sense?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been using check_state_test.pm anytime we've had an anomaly and during recovery didn't need to send out alerts. check_state_no_alerts.pm is written in a way that still sends out alerts - I'm not sure what the original intention behind this was. It's fine for test to have the lines uncommented, will it still function if set during an anomaly? Or will we have to have a different way of not sending out alerts?

Copy link

@linamaria11 linamaria11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did my best to look for typos/spelling but all the msids started to float together when I got to snap_format.pm - I think they look good though. Do you have a sample of the resulting snapshot page?

@@ -1208,18 +1425,16 @@ sub send_tank_yellow {
if (! time_curr($obstime)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto comment under send_tank_yellow

return $color;
}


sub send_tank_red {
my $obstime = ${$hash{PMTANKP}}[0];
if (! time_curr($obstime)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So they will be un-commented when we the changes are made?

snap_format.pm Outdated

$s .= sprintf " OBSID %5d EPState %4s\n",
${$h{COBSRQID}}[1], ${$h{EPSTATE}}[1];
$s .= sprintf "%52 sOBSID %5d EPState %4s\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it okay for the %52 and s to be separated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No.. Thanks! Good catch.

@malgosias
Copy link
Contributor Author

Added:

  • test telemetry with and without violations in the tests/ subfolders
  • test.pm module
  • snapshot_test.pl script to be executed each time we modify any of the snapshot scripts to confirm that everything works as intended. New tests can be added if required.

tests/ folder contains chandra.snapshot and snarc.html files that are a product of test_snap_format_write_txt() and test_snap_format_write_txt() in snapshot_test.pl, respectively. Ultimately, these two files should not be a part of this distribution because they are just a result of a test but I included them here for now so that the new formatting of the snapshot page can be reviewed.

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