-
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
wfc3tools incorrect parameter symmetry #22
Comments
Resolves spacetelescope#22 Signed-off-by: Michele De La Pena <[email protected]>
You should verify, but my memory is that the C executables only accept a single file as input (either a observation or an association table). The pyraf wrapper used stsci.tools to parse the input and feed that to the executables. In python, I think the better sequence is to make a list of images to be processed and call the executable on that list. I think the docs are misleading and they should be updated; The code was probably made explicit with the |
Do wfc3tools use hstcal? The code in calwf3 calls c_imtopen, which accepts a string that can include multiple file names, separated by a blank or comma. |
I'm fuzzy, but wfc3tools is calling the individual executables. The c_imtopen is called higher up in the C pipeline to do the parsing of multiple filenames and feeds that down, or creates and association file (again, I'd have to go look at the code again to verify, but that's what is in my head) |
It's possible calwf3.e does something different that the later stage executables since it's called high up |
I think wrappers (of this kind) should be thin, sometimes even "wafer thin". So, if the underlying exec accepts a list, the list should be passed through so as to not alter functionality symmetry, now or in the future. I know there is a mindset to treat the python tools as the primary entity, especially by INS who use them, but they're not and nor should they be. Now if the underlying exec doesn't accept lists then we could add this functionality to the Python wrappers. I would still argue that this functionality should go in the C code base, but either way that's not covered by this issue - but instead this one spacetelescope/hstcal#179. |
I believe that the calwf3 exec only accepts 1 filename, and it expects multiple observations to come in the form of an asn table, this was historically mandated by the project. The subroutines may accept more, those have been extremely rarely used by anyone even inside the cal teams. My memory is the change here was made for consistency of calling the routines in this package. wfc3tools is meant to be used as the pythonic interface into the C executables, not the primary interface. If the team has decided they'd rather go back to using lists of files as input to the subroutines from the wrapper, make sure that the docs are explicit in the calling differences between calwf3 and the subs. Functionality to accept lists of files doesn't need to be added to the wrappers, users should call the executable from their list of files. |
The one component (at least for STIS) where it has been important for the calxxx function to accept a list (actually a blank or comma-separated-value string) is calstis2, cosmic-ray rejection. For WFC3, calwf3/wf3ccd/mainccd.c calls c_imtopen with that string as input. |
For wfc3, the IR channel does cosmic ray rejection inside the ramp for a single image. In UVIS, the CR rejection is done with drizzle after exiting calwf3. I remember the calwf3 executable calling a separate routine (procccd or procir) to run the subroutines directly, meaning the executables for the subroutines have a different entrance, through their main, and it's only that entrance that calls c_imtopen. For example, you can only access the list input functionality if you call wf3ccd.e from the shell standalone, which was built from its main, and give it the files it expects, it then loops the call to wf3ccd from the list. calwf3 just calls WF3ccd on the single file. |
For STIS it's often used to do cosmic-ray rejection on a collection of bias or dark files, e.g. 40 files. |
I think the teams prefer to do cosmic-ray rejection in different ways. However, they can currently call the subroutines to do regular calibration. None of the calwf3 subroutines perform cosmic-ray rejection in uvis. |
Thanks to folks for all the historical perspective! Indeed, |
Updated wf3rej.py on my private Git branch (issue22_inputlist) and offered this version for testing to the internal user. The response on 05 July 2018: I need to follow up with the team to determine how they would like the tools to work. |
Spoke to Deputy Lead of WFC3 and asked her to read over this issue to understand the general topic. If necessary, the issue can be raised at the next team meeting in order to determine if the current behavior should remain as it is or should be reconciled to the behavior of the C tools. |
Is there any update on how this issue will be handled? I rely heavily on the ability to process an input list of images with
|
I will email and talk with the Deputy Lead of WFC3 today or as soon as I can get a few minutes with her. |
I got a response that Sylvia will review the issue this week so she and I can talk in an informed way. |
Ok, great! Thanks @mdlpstsci! |
After consultation with @SMBaggett (who also discussed this with HSTMO), this issue has been given the permission to proceed. It is understood this issue may also be applicable to some, if not all, of the other WFC3 tools. |
Some of the
wf3tools
(Python) present a different interface than their C counterparts. The Python wrappers which exhibit this behavior should be updated to reflect the underlying C interface.For example,
wf3rej.py
has explicit checking for input lists and raises an exception if a list is passed in as this shows here.The documentation implies input lists are allowed.
This can be fixed by removing the check and exception. The underlying C executable,
wf3rej.e
, can handle input lists, but it requires the input to be a CSV string. This needs to be fixed in the Python wrapper (e.g., here in wf3rej.py)should be
This was introduced in #13.
Code Changes
List is also evident in other tools and should be addressed.
calwf3.pyDoc Changes
The text was updated successfully, but these errors were encountered: