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

Regression in pixel to world mapping for lookup tables #341

Closed
nmearl opened this issue Dec 19, 2020 · 1 comment
Closed

Regression in pixel to world mapping for lookup tables #341

nmearl opened this issue Dec 19, 2020 · 1 comment

Comments

@nmearl
Copy link
Collaborator

nmearl commented Dec 19, 2020

Looks like this change introduced an issue when using Tabular1D lookup tables:

Testing the code block below

def gwcs_from_array(array):
    coord_frame = cf.CoordinateFrame(naxes=1,
                                     axes_type=('SPECTRAL',),
                                     axes_order=(0,))
    spec_frame = cf.SpectralFrame(unit=array.unit, axes_order=(0,))

    forward_transform = Tabular1D(np.arange(len(array)),
                                          lookup_table=array)
    forward_transform.inverse = Tabular1D(
        array, lookup_table=np.arange(len(array)))

    tabular_gwcs = GWCS(forward_transform=forward_transform,
                                input_frame=coord_frame,
                                output_frame=spec_frame)

    return tabular_gwcs

for gwcs 0.15 yields

In [3]: wcs = gwcs_from_array(np.arange(100) * u.AA)

In [4]: wcs.pixel_to_world([10, 11])
Out[4]: <Quantity [10., 11.] Angstrom>

and for gwcs 0.16 yields

In [3]: wcs = gwcs_from_array(np.arange(100) * u.AA)

In [4]: wcs.pixel_to_world([10, 11])
Out[4]: <Quantity 10. Angstrom>
@nden
Copy link
Collaborator

nden commented Dec 20, 2020

Change that caused regression was reverted and a new patch release is out - 0.16.1

@nden nden closed this as completed Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants