-
Notifications
You must be signed in to change notification settings - Fork 41
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
update getViewWCS to adapt to projection #119
Conversation
Also possible to add in this PR:
|
I don't know, usage of happy-dom is new, perhaps @bmatthieu3 can help.
There is already a setFrame method actually. For symmetry, I suggest keeping setFrame (in order not to break existing API) and adding setCooFrame as an alias. |
Or we could just rename getCooFrame in getFrame? |
This involve less changes, thus let's do that! |
Should be all good now? :) EDIT: Nope. We have issues with a few projections. |
New commits add the following stuff:
|
src/js/ProjectionEnum.js
Outdated
ZEA: {id: 4, fov: 360}, /* Equal-area */ | ||
FEYE: {id: 5, fov: 190}, | ||
AIR: {id: 6, fov: 360}, | ||
TAN: {id: 1, fov: 180, longName: "gnomonic"}, /* Gnomonic projection */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have chosen maybe something like: 'name' or 'label' instead of 'longName'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was kinda un-inspired. "label" sounds perfect thanks 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In table 12 of WCS FITS paper ( https://arxiv.org/pdf/astro-ph/0207413.pdf ), the 3-letters code is called code and the name is called projection name 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but then I'd need to rename the code into "code" because everywhere else it's "name" for us. Do we do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, let's keep it as you update it.
I think we can merge ? |
I am merging this. It would have been great to run some test asserting some wcs are good (a planetary one, with different projection). But this involve to much deep diving into how jsdom/happy-dom can mock webgl2 canvas. This is for another future PR |
This is an adaptation of the method
getViewWCS
so that is also works for projections that are not "SIN".What's new
new in API:
This new function returns the current cooFrame of the view. The retruned values can be "J2000", "J2000d", "Galactic" and are taken from the label returned by
aladin.view.cooframe
What changed
now adapts to the projection and coordinate system in the keys
CTYPE1
andCTYPE2
rather than always returningRA---SIN
andDEC
What needs to be reviewed
Check that this is the expected output. Example:
"Galactic"
"J2000d"