-
Notifications
You must be signed in to change notification settings - Fork 19
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
IR tools #36
base: main
Are you sure you want to change the base?
IR tools #36
Conversation
@sosey @stscicrawford What is the process forward to merge this into wfc3tools? |
It will need to be reviewed -- if you can confirm it works how you would like, I'll provide a code by the end of the week as I think this was submitted as part of the hack day. |
I've left a few minor comments on here for review, but if there isn't time to address them, I would be okay to merge as is, but then open issues for them to be addressed in the future. It isn't required, but if there was any tests, it would be useful to add them as well. So if this is something that you would like available urgently, I would be okay to merge. |
|
||
"""Bookkeeping + call to calwf3 to make ima from raw, turning CRCORR switch off.""" | ||
|
||
### temporary rename of file |
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.
It might be better to use the temp file rather than giving it a specific name in the case where 'temp_'+rawfile might exist before hand
|
||
def _reprocess_raw_crcorr(raw_file): | ||
|
||
"""Bookkeeping + call to calwf3 to make ima from raw, turning CRCORR switch off.""" |
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.
Still would be good to have the input parameters listed here even for private functions
|
||
def _calc_avg(data, stats_method, sigma_clip, sigma, sigma_upper, sigma_lower, iters): | ||
""" Returns a mean or median from an array, with optional sigma clipping.""" | ||
if not sigma_clip: |
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 could be simplified with the following code:
mean, med, s = sigma_clipped_stats(data, sigma = sigma, sigma_lower = sigma_lower,
sigma_upper = sigma_upper, iters = iters)
if stats_method == 'median':
return med
return mean
And sigma_clip
is set to False
, then requiring iters=0
added ir_tools.py, with ramp-flattening function. will populate this with more functions (discussed on hack day) shortly.