Skip to content

Change withOrigin -> shiftOrigin for non-local WCS types#1085

Merged
rmjarvis merged 2 commits into
masterfrom
shiftOrigin
Jun 12, 2020
Merged

Change withOrigin -> shiftOrigin for non-local WCS types#1085
rmjarvis merged 2 commits into
masterfrom
shiftOrigin

Conversation

@rmjarvis
Copy link
Copy Markdown
Member

This is a quick hit to address issue #1073.

For non-local WCS types, the name withOrigin is deprecated in favor of shiftOrigin. The functionality hasn't changed, but the name withOrigin is only really appropriate for LocalWCS types. When the WCS already has a non-zero origin, then the action takes in really to shift the origin, not set a new value.

I kept the name withOrigin for local WCS types where I think it is more intuitive and accurately describes the action taken. Both names are available for LocalWCS types and they are equivalent.

I also updated the docs a bit to hopefully make the action that is happening here somewhat clearer.

@rmjarvis rmjarvis requested a review from beckermr June 11, 2020 19:18
Comment thread galsim/wcs.py
the origin position the same way the current WCS treats (x,y) = (0,0).
This function creates a new WCS instance (always a non-local WCS) that shifts the
origin by the given amount. In other words, it treats the image position ``origin``
the same way the current WCS treats (x,y) = (0,0).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last statement in this paragraph confuses me. I think it is technically correct, but the language throws me. IDK if there is anything to do about this though and I don't have a good suggestion.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the point I was trying to make is that the "origin" of the current wcs doesn't have to be (0,0). It is if it's local, but not necessarily otherwise. So whatever real position on the image is currently called (0,0), the new wcs will call that position origin, the argument being passed to this function. I'm not sure what would be a better sentence to explain that, but if you can think of something that would make that clearer, I'm game to change it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I’ve got nothing. I’d say merge the pr and I can make another later to change things if I think I can say it more clearly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. :)

Comment thread galsim/wcs.py
origin: The image coordinate position to use as the origin.
world_origin: The world coordinate position to use as the origin. Only valid if
origin: The image coordinate position to use for what is currently treated
as (0,0).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto here for language but again I don't have a better suggestion.

@rmjarvis rmjarvis merged commit aecea47 into master Jun 12, 2020
@rmjarvis rmjarvis deleted the shiftOrigin branch June 12, 2020 13:09
@rmjarvis rmjarvis added this to the v2.3 milestone Jun 12, 2020
@rmjarvis rmjarvis added base classes Related to GSObject, Image, or other base GalSim classes wcs Related to WCS coordinate transformations labels Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

base classes Related to GSObject, Image, or other base GalSim classes wcs Related to WCS coordinate transformations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants