Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
perrygreenfield committed Nov 22, 2023
1 parent f205bc5 commit c72f876
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
4 changes: 1 addition & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

- Improve documentation (part 1) [#483]

- other
^^^^^
- Replace ``pkg_resources`` with ``importlib.metadata``. [#478]
- Replace ``pkg_resources`` with ``importlib.metadata``. [#478]

0.19.0 (2023-09-15)
-------------------
Expand Down
11 changes: 6 additions & 5 deletions docs/gwcs/fits_analog.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _fits_equivalent_example
.. _fits_equivalent_example:

FITS Equivalent WCS Example
===========================
Expand Down Expand Up @@ -27,7 +27,7 @@ a FITS imaging WCS without distortion, defined in this FITS imaging header::
RADESYS = 'ICRS' / Equatorial coordinate system


The following imports are generally useful:
For this example the following imports are needed:

>>> import numpy as np
>>> from astropy.modeling import models
Expand Down Expand Up @@ -87,15 +87,16 @@ This WCS pipeline has only one step - from ``detector`` to ``sky``:
detector linear_transform
icrs None

To convert a pixel (x, y) = (1, 2) to sky coordinates, call the WCS object as a function:
Now we have a complete WCS object. The next example will use it to convert pixel
coordinates(1, 2) to sky coordinates:

>>> sky = wcsobj(1*u.pix, 2*u.pix, with_units=True)
>>> print(sky)
<SkyCoord (ICRS): (ra, dec) in deg
(5.52515954, -72.05190935)>

The :meth:`~gwcs.wcs.WCS.invert` method evaluates the :meth:`~gwcs.wcs.WCS.backward_transform`
if available, otherwise applies an iterative method to calculate the reverse coordinates.
The :meth:`~gwcs.wcs.WCS.invert` method evaluates the :meth:`~gwcs.wcs.WCS.backward_transform` to provide a mapping from sky coordinates to pixel coordinates
if available, otherwise it applies an iterative method to calculate the pixel coordinates.

>>> wcsobj.invert(sky)
(<Quantity 1. pix>, <Quantity 2. pix>)
2 changes: 2 additions & 0 deletions docs/gwcs/ifu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ First, import the usual packages.

Next, create the appropriate mapper object corresponding to the figure above:

>>> # Ignore the details of how this mask is constructed; they are using
>>> # array operations to generate the mask displayed for this example.
>>> y, x = np.mgrid[:1000, :500]
>>> fmask = (((-x + 0.01 * y + 0.00002 * y**2)/ 500) * 13 - 0.5) + 14
>>> mask = fmask.astype(np.int8)
Expand Down
6 changes: 2 additions & 4 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ There are two ways to save the WCS to a file:

- `Save a WCS object as a pure ASDF file`_

- `Save a WCS object as an ASDF extension in a FITS file`_


A step-by-step example of constructing an imaging GWCS object.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -171,7 +169,7 @@ default.
>>> tangent_projection = models.Pix2Sky_TAN()
>>> celestial_rotation = models.RotateNative2Celestial(30., 45., 180.)

For the last transformation, the 3 arguments are, respectively:
For the last transformation, the three arguments are, respectively:

- Celestial longitude (i.e., RA) of the fiducial point (e.g., (0, 0) in the input
spherical coordinates).
Expand All @@ -181,7 +179,7 @@ For the last transformation, the 3 arguments are, respectively:
always corresponds to a value of 180.

The more general case where the detector is not aligned with north, would have
a rotation transform after the pixelship and pixelscale transformations to
a rotation transform after the pixelshift and pixelscale transformations to
align the detector coordinates with north up.

The net transformation from pixel coordinates to celestial coordinates then
Expand Down

0 comments on commit c72f876

Please sign in to comment.