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

Prevent creation of WCS with (or insertion of) duplicate frames #178

Open
mcara opened this issue Sep 29, 2018 · 1 comment
Open

Prevent creation of WCS with (or insertion of) duplicate frames #178

mcara opened this issue Sep 29, 2018 · 1 comment

Comments

@mcara
Copy link
Member

mcara commented Sep 29, 2018

In spacetelescope/jwst#2629 (comment) @nden said:

all frame names in the pipeline must be unique

In this issue I propose that this be enforced when the WCS object is created or its pipeline modified.

Currently, when using the standard example from the [gWCS docs] modified to have two identical frames, it does not raise an exception: wcsobj = wcs.WCS([('det', det2sky), ('det', det2sky), ('sky', None)]). But the code does crash when attempting to evaluate forward transform:

In [19]: wcsobj(10,10)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-19-a8018916eccf> in <module>()
----> 1 wcsobj(10,10)

~/.../lib/python3.5/site-packages/gwcs/wcs.py in __call__(self, *args, **kwargs)
    242             kwargs['fill_value'] = np.nan
    243 
--> 244         if self.bounding_box is not None:
    245             # Currently compound models do not attempt to combine individual model
    246             # bounding boxes. Get the forward transform and assign the ounding_box to it

~/.../lib/python3.5/site-packages/gwcs/wcs.py in bounding_box(self)
    456         transform_0 = self.get_transform(frames[0], frames[1])
    457         try:
--> 458             bb = transform_0.bounding_box
    459         except NotImplementedError:
    460             return None

AttributeError: 'NoneType' object has no attribute 'bounding_box'

However, this 'bounding_box' error is not intuitive or directly pointing to the underlying issue.

@mcara mcara changed the title Prevent creation ow WCS with or insertion of duplicate frames Prevent creation of WCS with or insertion of duplicate frames Sep 29, 2018
@mcara mcara changed the title Prevent creation of WCS with or insertion of duplicate frames Prevent creation of WCS with (or insertion of) duplicate frames Sep 29, 2018
@stscijgbot
Copy link

This ticket is now being tracked at AL-28

@nden nden added this to the 1.0 milestone Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants