-
Notifications
You must be signed in to change notification settings - Fork 107
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
define origin
and world_origin
for CelestialWCS classes?
#1260
Comments
origin
and world_origin
for CelestialWCS classes?
Yes, center is that point, and yes it's largely undocumented. It's not a general WCS property for all CelestialWCS classes -- it's specific to the GSFitsWCS class. So you can't rely on it if you are using
You certainly can do that. But neither of those has any requisite connection to the center of the tangent plane projection, so that's just a choice you can make. |
I must have made a typo when checking this last night! Here is what I see:
so we do have |
|
Oh, right. Yeah, world_origin isn't a thing for CelestialWCS objects. Just Euclidean ones. I forgot about that. I guess we could define world_origin to be wcs.toWorld(wcs.origin). But I'm not sure how useful that is, and it's not necessarily the center of the projection. If you make it via |
Yeah origin is set to a dummy value in the code. It should probably raise since using the dummy value is almost always wrong and will give unexpected results. |
All the origin/world_origin stuff is really just to make sure we can recenter images (e.g. |
Right yes. crval and crpix are the fits conventions for these things. I think I expected
I agree that we cannot use the convention that the projection center for the tagent plane is world_origin for all celestial WCSs. So maybe a small change in API would be to
|
I'm fine with that. I can't remember the reasoning behind the current implementation, but if someone want to track through the unit tests to see what breaks if origin = crpix, I don't have a problem with that. I think world_origin=center isn't something we can guarantee always though after possible calls to newOrigin. Could be wrong though.
That's not particularly feasible for the other possible CelestialWCS classes. But you could do it for GSFitsWCS and RaDecFunction I think. Or if you want to try to figure out how to make a best-effort attempt for AstropyWCS and PyAstWCS, you could do that and raise an exception if it's too obfuscated to figure out. (Which I think will be the case for some wcs types.) |
@sidneymau and I were working on some DES stuff and ran into an issue where we need the point on the sphere about which a given a WCS uses the projection. We found that the
GSFitsWCS
class defines a.center
property (but that its value was(0, 0)
which did not make much sense to us).However, ignoring that
.center
was a bit funny in our case, as far as I can tell.center
is the point we want but is largely undocumented?origin
andworld_origin
attributes are not definedIs there a reason we couldn't set
origin
toCRPIX
or similar and setworld_origin
to the tangent point on the sphere?The text was updated successfully, but these errors were encountered: