kevin218 / Eureka

Eureka! is a data reduction and analysis pipeline intended for time-series observations with JWST.
https://eurekadocs.readthedocs.io/
MIT License
58 stars 45 forks source link

[Enhancement]: Further clarify manual_clip conventions on ECF documentation page #531

Closed astroRez closed 1 year ago

astroRez commented 1 year ago

FAQ check

Instrument

Light curve fitting (Stages 4-6)

What happened?

If trying to clip the indices for several lists, during Stage 5 manual clipping, the indices will shift.

For example, if you're trying to clip every tenth index:

You would expect the clipping to behave as it did in Stages 3 & 4, where the indices to be clipped would be designated as [[10,10], [20,20], [30,30]]. However, to achieve this example clipping, at the moment, the indices need to be specified as [[10,11], [19,20], [28,29]].

Error traceback output

No response

What operating system are you using?

No response

What version of Python are you running?

No response

What Python packages do you have installed?

No response

Code of Conduct

taylorbell57 commented 1 year ago

So the relevant lines of the code are: https://github.com/kevin218/Eureka/blob/43c4a2363d57d211a9e7f11975faa771ff1cb15b/src/eureka/lib/util.py#L142-L146

From these lines, I can tell that the bug you mention is not actually present (we flag all the requested indices, and then remove them so that we don't need to worry about shifting indices).

Where I think your confusion arises is how to specify the indices you want to clip, and I do think our documentation page could be a bit clearer about this. If you want to clip the 10th and 20th integrations, these would be indices 9 and 19 (since python uses zero-indexing). And the manual_clip start and end values are used to slice a numpy array, so they follow the same convention of inclusive start index and exclusive end index. In other words, to trim the 10th and 20th integrations, you would set manual_clip to [[9,10], [19,20]].

I'll clarify that a bit more on the documentation page here.