Giter Club home page Giter Club logo

Comments (6)

stscijgbot-jp avatar stscijgbot-jp commented on July 18, 2024

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.

stscijgbot-jp avatar stscijgbot-jp commented on July 18, 2024

Comment by Timothy Brandt on JIRA:

After a little more thought, I think that replacing 

https://github.com/spacetelescope/jwst/blob/a0cdad8b9ce9b9e3835bb1893ace205f40623798/jwst/extract_1d/extract1d.py#L805],

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.

stscijgbot-jp avatar stscijgbot-jp commented on July 18, 2024

Comment by David Law on JIRA:

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.

stscijgbot-jp avatar stscijgbot-jp commented on July 18, 2024

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 

# Evaluate the functions for source and (optionally) background limits,

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.

stscijgbot-jp avatar stscijgbot-jp commented on July 18, 2024

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.

stscijgbot-jp avatar stscijgbot-jp commented on July 18, 2024

Comment by Howard Bushouse on JIRA:

Fixed by #8586

from jwst.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.