Skip to content
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

Refactor of WCS pixelization operator #757

Merged
merged 5 commits into from
May 13, 2024
Merged

Refactor of WCS pixelization operator #757

merged 5 commits into from
May 13, 2024

Conversation

tskisner
Copy link
Member

This work is a superset of #727, and includes a larger reorganization of WCS projection support. One note: the WCS standard does not support Alt-Az / Az-El horizon coordinates. Currently the code uses the RA/DEC CTYPE for that case, but I am open to suggestions if there is some common convention for CTYPE in that case.

Changes in this PR include:

  • Move the application of source centering in the projection to a separate helper function in pointing_utils.py. Thanks to @gabrielecoppi for identifying this fix. Optionally use this new function when computing the scan range for autoscaling.

  • In PixelsWCS:

    • Add a new general class method that computes the WCS parameters.
    • Add support for SFL projection.
    • Allow projection traits to be changed in any order and only recompute the WCS if needed when exec() is called.
    • Default to a single submap, which is the most efficient choice for the common case of data distributed by detector and many observations co-incident on the sky.
  • In the PixelsWCS unit tests:

    • Ensure projection and plotting works for every supported projection type with both fixed parameters and autoscaling.
    • Test mapmaking in both normal mode and with source-centered projections in RA/DEC and Az/El.
  • In plot_wcs_maps:

    • Set the figure size based on the DPI and the actual size of the image in pixels.
    • Set the unhit pixels to gray.
    • Allow specifying the color map, and default to one of the perceptially uniform ones.

Some examples from unit tests showing projection and plotting defaults (input data was noise):
mapmaking_CAR_map fits_I
source_TAN_map fits_I
drone_SFL_map fits_I

@tskisner tskisner requested a review from keskitalo May 11, 2024 03:43
Copy link
Member

@keskitalo keskitalo left a comment

Choose a reason for hiding this comment

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

Looks good. Very happy to see these fixes.

- Move the application of source centering in the projection to a
  separate helper function in `pointing_utils.py`.  Thanks to
  @gabrielecoppi for identifying this fix.  Optionally use this
  new function when computing the scan range for autoscaling.

- In `PixelsWCS`:

  - Add a new general class method that computes the WCS parameters.
  - Add support for SFL projection.
  - Allow projection traits to be changed in any order and only
    recompute the WCS if needed when exec() is called.
  - Default to a single submap, which is the most efficient choice
    for the common case of data distributed by detector and many
    observations co-incident on the sky.

- In the PixelsWCS unit tests:

  - Ensure projection and plotting works for every supported
    projection type with both fixed parameters and autoscaling.
  - Test mapmaking in both normal mode and with source-centered
    projections in RA/DEC and Az/El.

- In `plot_wcs_maps`:

  - Set the figure size based on the DPI and the
    actual size of the image in pixels.
  - Set the unhit pixels to gray.
  - Allow specifying the color map, and default to one of the
    perceptially uniform ones.
@tskisner tskisner merged commit b1540cb into toast3 May 13, 2024
6 checks passed
@tskisner tskisner deleted the wcs_fixes branch May 13, 2024 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants