Skip to content
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

Setting a specified transition wavelength in coadd.abut() #3

Open
nkerman opened this issue Mar 25, 2021 · 1 comment
Open

Setting a specified transition wavelength in coadd.abut() #3

nkerman opened this issue Mar 25, 2021 · 1 comment
Labels
enhancement New feature or request hlsp

Comments

@nkerman
Copy link

nkerman commented Mar 25, 2021

Idea:

Users would benefit from being able to choose the point at which two abutted spectra transition from the lower-λ (A) to longer-λ spectrum (B)

Problem:

At present, the transition wavelength is always decided by the function, find_transition_wavelength, which chooses the center of the overlap.

This is less than ideal, as often you would get a better abutted spectrum by using A for the vast majority of the overlap.

Potential Fix:

This does not have to be automatic within the wrapper (that would be great, but there's a lot of variables and data-dependent decisions). Instead, the user should be able to do this piecewise, i.e.

imports...
initialize SegmentList, make WL array, coadd (or use convenience function to do these steps)
abut1 = abut(blue, middle, transition_wl=1400)
abut2 = abut(abut1, red, transition_wl=2000)

Where the abut function checks for a user-specified transition wavelength, before using find_transition_wavelength, i.e.

def abut(product_short, product_long,    transition_wvln = None):
    # check for user trans_wvln:
    if transition_wvln:
        # check it's in the right region:
        if (user_trans_wvln>product_long.min) & user_trans_wvln<product_short.max):
            transition_wvln =  user_trans_wvln
        else: # user specified a wvln outside of the overlap
            print(‘invalid wvln specified’)
            exit
    else: # user didn't try to specify a transition wvln
        transition_wvln = get_transition_wvln()

@jotaylor (who helped draft this idea) @stscirij

@nkerman
Copy link
Author

nkerman commented Apr 15, 2021

I implemented a really quick version of this that seems to work! Happy to talk and see if it's compatible, and just add it in if you want.

One strange thing I've noticed is that when there's a specified transition wavelength, there's usually-but-not-always the same sampling rate discontinuity at the transition seen when the transition is automatically chosen. I can't seem to figure out why it isn't ALWAYS there, but it seems to be some multiple of the sample rates combined.

Please see the fig.
Screen Shot 2021-04-15 at 17 15 42

@jotaylor jotaylor added enhancement New feature or request hlsp labels Jan 25, 2022
@jotaylor jotaylor transferred this issue from another repository Feb 7, 2022
tapastro pushed a commit to tapastro/ullyses that referenced this issue May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hlsp
Projects
None yet
Development

No branches or pull requests

2 participants