Comments (6)
Comment by Timothy Brandt on JIRA:
6/16/24 @ 15:30: I updated the accompanying notebook with a few more example sets of limits, deleted the duplicate issue on GitHub, and made a slight update to the issue. It looks like if any set of limits is entirely contained within another set, the results may be incorrect. I do not know if results can be incorrect more generally. It is a bit difficult for me to follow the logic of the original routine, but it seems like it may assume that both the lower and the upper limits of the sequence of intervals are both in ascending order after sorting by the lower limits only, which is equivalent to assuming that no interval is entirely contained within any other interval. If this assumption ever breaks in the JWST pipeline then incorrect results, and incorrect extracted spectra, may follow.
from jwst.
Comment by Timothy Brandt on JIRA:
After a little more thought, I think that replacing
with
pint[1] = max(interval[1], pint[1])
will fix the issue. That should avoid any concerns about breaking anything else, as it just removes an unacknowledged assumption from the function that could result in surprising behavior that would be hard to track down. David Law, I know you are on break for the next few days, but if this sounds good I will create a pull request to close the issue.
from jwst.
Timothy Brandt Please do create a PR.
It would be useful to hear from Howard Bushouse what the history of this routine is. It looks like a clear bug, but since I'm not sure offhand what kind of segments this routine typically gets called with it would be good to get a better picture of this before changing it.
from jwst.
Comment by Timothy Brandt on JIRA:
David Law I created the pull request. My sense is that this function is usually called with only one or two sets of limits, either for the extraction region for a slit (one set; two numbers) or for a background region (probably two sets; four numbers). In both cases I think this bug would be unlikely to cause problems, so my expectation is that this bug has never actually impacted data reductions. These limits are computed in the 100 or so lines following
jwst/jwst/extract_1d/extract1d.py
Line 124 in 10501f2
from polynomial functions defining slit boundaries and background regions, which I assume are defined and maintained by the instrument teams. It would be great for Howard Bushouse to weigh in.
from jwst.
Comment by Howard Bushouse on JIRA:
David Law Timothy Brandt Honestly I have no idea as to why the current code was written that way - most likely because the author never envisioned anyone using multiple regions that were contained within one another.
from jwst.
Comment by Howard Bushouse on JIRA:
Fixed by #8586
from jwst.
Related Issues (20)
- Ramp fitting runtime in RN variance calculation
- Make "OLS_C" the default algorithm for ramp fitting HOT 2
- jwst 1.14.1 patch release HOT 1
- Consider saving intermediate product for WFSS processing in MAST HOT 1
- Resample parameters in outlier detection don't have same limits as in resample
- Add regression test for MIRI emicorr step HOT 1
- Implement pipeline changes necessary to work with data-release style processing HOT 1
- Remove python implementation of OLS ramp fitting HOT 2
- CR showers code excessive flagging in MRS bright sources HOT 2
- Bug in OLS_C ramp fitting under certain conditions HOT 2
- Separate resample_spec parameters from resample step
- NIRCam ERR measurements (from photutils) of same source are inconsistent depending on the pixel scale of the mosaic HOT 26
- emicorr cycle documentation
- Split OutlierDetectionStep into multiple steps
- absolute derivitive calculation in outlier detection has edge effects HOT 2
- outlier detection weight_type ignored for tso and coron modes
- resampling during outlier_detection generates unused products
- Make source_catalog output compatible with tweakreg
- outlier detection fails due to missing `array_shape` when run outside pipeline HOT 1
- New error in imaging level 3 in pipeline 1.15.0: tweakreg parameter changes are needed for NIRISS.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jwst.