-
Notifications
You must be signed in to change notification settings - Fork 5
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
Two new functions to handle limit strings, minor viz fixes for xija_gui_fit #112
Conversation
… as get the color associated with the limit line
…ogram plot visualization
@taldcroft Wanted to see if you had any comments on this. |
xija/gui_fit/plots.py
Outdated
if limit == "unit": | ||
continue | ||
lines.append( | ||
draw_line(limits[limit], color=get_limit_color(limit)) |
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 think this should pay attention to the limit units (indeed many of them are not degC).
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.
@taldcroft what do you want it to do exactly? This loop is to draw the lines and since the "unit"
item is in the same dict as the limit definitions, it needs to skip over it which is the reason for lines 170-171.
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.
E.g the limits for the PFTANK2T model are in degF, but the models are always computed and calculated in degC. Maybe I'm missing the code, but somewhere along the way the limit values need to be converted degC.
This is ready for review again. |
xija/gui_fit/plots.py
Outdated
if limit == "unit": | ||
continue | ||
lines.append( | ||
draw_line(limits[limit], color=get_limit_color(limit)) |
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.
E.g the limits for the PFTANK2T model are in degF, but the models are always computed and calculated in degC. Maybe I'm missing the code, but somewhere along the way the limit values need to be converted degC.
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 now!
Description
Based on the new limit scheme implemented in sot/chandra_models#75, this PR implements two new functions in xija,
get_limit_spec
andget_limit_color
.get_limit_spec
takes a limit of the form<system>.<type>.<direction>.<qualifier>
and returns a dict with these names as the keys:which gives
This may have other uses eventually, but it was useful for
get_limit_color
, which uses it to assign colors for the various limits.get_limit_color
is used byxija_gui_fit
to assign limit line colors, but I'll be using andget_limit_spec
andget_limit_color
inacis_thermal_check
and ACISpy.Functional testing consisted of running
xija_gui_fit
for every model inchandra_models
with limits and making sure that the limit lines appeared correctly in thedata__time
,resid__data
, and histogram plots.This PR also fixes a number of minor visualization issues with
xija_gui_fit
.Testing
Fixes #