-
Notifications
You must be signed in to change notification settings - Fork 43
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
Claw monitor migrate #1492
Claw monitor migrate #1492
Conversation
Hello @york-stsci, Thank you for updating ! Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated at 2024-02-20 16:13:52 UTC |
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.
Hey @york-stsci this looks good to me.
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 looks great to me - thanks a lot for getting this switched over to django models, the documentation with examples on how to work with them is especially useful.
Perhaps more relevant for the next PR, but I do store nans for the total_bkg if the JBT tool fails for whatever reason - do you know if django can store nans ok in the float columns, or should I switch it to something else?
As I recall, the "nan" value is explicitly defined in the IEEE double-precision floating point standard (which is the floating-point value that all of our database tables use), so it's possible that we might have to convert it from |
@@ -319,13 +331,12 @@ def process(self): | |||
'stddev': float(stddev), | |||
'frac_masked': len(segmap_orig[(segmap_orig != 0) | (dq & 1 != 0)]) / (segmap_orig.shape[0] * segmap_orig.shape[1]), | |||
'skyflat_filename': os.path.basename(self.outfile), | |||
'doy': float(doy), | |||
'total_bkg': float(total_bkg), | |||
# 'doy': float(doy), |
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.
Any reason for commenting these out?
@@ -158,8 +157,9 @@ def claw_monitor(request): | |||
template = "claw_monitor.html" | |||
|
|||
# Get all recent claw stack images from the last 10 days | |||
query = session.query(NIRCamClawStats.expstart_mjd, NIRCamClawStats.skyflat_filename).order_by(NIRCamClawStats.expstart_mjd.desc()).all() | |||
df = pd.DataFrame(query, columns=['expstart_mjd', 'skyflat_filename']) | |||
query = NIRCamClawStats.objects # .filter(expstart_mjd__gte=(Time.now().mjd - 10)) |
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 am assuming we will want to remove the comment this after the first run?
Migrates the claw monitor to using the django models. This is an initial PR, with a second to follow which will add the new columns to the claw monitor.