-
Notifications
You must be signed in to change notification settings - Fork 48
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
SCSB-111: Improve documentation #483
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #483 +/- ##
=======================================
Coverage 87.28% 87.28%
=======================================
Files 22 22
Lines 3821 3821
=======================================
Hits 3335 3335
Misses 486 486 ☔ View full report in Codecov by Sentry. |
>>> det2sky = shift_by_crpix | rotation | tan | celestial_rotation | ||
>>> det2sky.name = "linear_transform" | ||
|
||
Create a ``detector`` coordinate frame and a ``celestial`` ICRS frame. |
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.
Why do we need this detector
frame? Can't we just bunch all transforms together from detector all the way to the sky? Also, what is a "detector frame"? is it just the value of the name
argument in the Frame2D
initializer?
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.
Generally the frames are information containers - they hold the units on the axes, the names of the axes, the axes type and physical type. You could create a WCS without an input frame but some functionality will not be available. For example, if the transforms are defined with units, you will need to make sure the inputs are with units, so any time you pass input in the case above, the inputs need to have u.pix
attached to them. This can be annoying.
In addition the input frame does not always represent a detector and imo it's good to have the information on what inputs are expected.
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.
@nden comment should be added to the docs. My comment was intended to prompt a discussion/explanation about organization of the (gwcs) pipelines. For example, why do some pipelines have multiple steps (JWST WCS comes to mind)?
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 wonder if a paragraphs or two before this example outlining the general structure of a WCS object would be helpful. Any objection @nden?
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.
What if the current "Getting Started" is replaced by an earlier section:
Basic Structure of a GWCS Object
--------------------------------
The key concept to be aware of is that a GWCS Object consists of a pipeline
of steps; each step contains a transform (i.e., an Astropy model) that
converts the input coordinates of the step to the output coordinates of
the step. Furthermore, each step has an optional coordinate frame associated
with the step. The coordinate frame represents the input coordinate frame, not
the output coordinates. Most typically, the first step coordinate frame is
the detector pixel coordinates (the default). Since no step has a coordinate
frame for the output coordinates, it is necessary to append a step with no
transform to the end of the pipeline to represent the output coordinate frame.
For imaging, this frame typically references one of the Astropy standard
Sky Coordinate Frames of Reference. The GWCS frames also serve to hold the
units on the axes, the names of the axes and the physical type of the axis
(e.g., wavelength).
Since it is often useful to obtain coordinates in an intermediate frame of
reference, GWCS allows the pipeline to consist of more than one transform.
For example, for spectrographs, it is useful to have access to coordinates
in the slit plane, and in such a case, the first step would transform from
the detector to the slit plane, and the second step from the slit plane to
sky coordinates and a wavelength. Constructed this way, it is possible to
extract from the GWCS the needed transforms between identified frames of
reference.
The GWCS object can be saved to the ASDF format using the
`asdf <https://asdf.readthedocs.io/en/latest/>`__ package and validated
using `ASDF Standard <https://asdf-standard.readthedocs.io/en/latest/>`__
There are two ways to save the GWCS object to a files:
- `Save a WCS object as a pure ASDF file`_
@mcara does this address your comment?
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! This is a great introduction.
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 like this too.
Furthermore, each step has an optional coordinate frame associated with the step.
Is the frame optional? I thought it's required.
a GWCS Object consists of a pipeline of steps
Suggest adding linear
-> consists of a linear pipeline of steps
so that it's clear it's not an arbitrary graph.
docs/index.rst
Outdated
|
||
Create a transform which rotates the inputs using the ``PC matrix``. | ||
The more general case where the detector is not aligned with north, would have | ||
a rotation transform after the pixelship and pixelscale transformations to |
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.
a rotation transform after the pixelship and pixelscale transformations to | |
a rotation transform after the pixelshift and pixelscale transformations to |
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.
So modified, though I really like how pixelship sounds.
docs/index.rst
Outdated
- Adjusting pixel coordinates such that the center of the array has | ||
(0, 0) value (typical of most WCS definitions, but any pixel may | ||
be the reference that is tied to the sky reference, even the (0, 0) | ||
pixel, or even pixels outside of the detector). | ||
- Scaling pixels such that the center pixel of the array has the expected | ||
angular scale. (I.e., applying the plate scale) | ||
- Projecting the resultant coordinates onto the sky using the tangent | ||
projection. If the field of view is small, the inaccuracies resulting | ||
leaving this out will be small; however, this is generally applied. | ||
- Transforming the center pixel to the appropriate celestial coordinate | ||
with the approprate orientation on the sky. For simplicity's sake, | ||
we assume the detector array is already oriented with north up, and | ||
that the array has the appropriate parity as the sky coordinates. | ||
|
||
|
||
The detector has a 1000 pixel by 1000 pixel array. | ||
|
||
For simplicity, no units will be used, but instead will be implicit. |
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.
shouldn't this go into the example in fits_analog.rst
?
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.
Again, do you mean duplicating (with needed changes) it there rather than moving?
227cf7f
to
c72f876
Compare
>>> det2sky = shift_by_crpix | rotation | tan | celestial_rotation | ||
>>> det2sky.name = "linear_transform" | ||
|
||
Create a ``detector`` coordinate frame and a ``celestial`` ICRS frame. |
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 like this too.
Furthermore, each step has an optional coordinate frame associated with the step.
Is the frame optional? I thought it's required.
a GWCS Object consists of a pipeline of steps
Suggest adding linear
-> consists of a linear pipeline of steps
so that it's clear it's not an arbitrary graph.
Closes issues: