Skip to content

Correct sky_pos and local_wcs in photon op tests - #484

Merged
welucas2 merged 2 commits into
LSSTDESC:mainfrom
welucas2:u/welucas2/correct-photon-op-tests
Jan 17, 2025
Merged

welucas2 merged 2 commits into
LSSTDESC:mainfrom
welucas2:u/welucas2/correct-photon-op-tests

Conversation

@welucas2

Copy link
Copy Markdown
Collaborator

Some of the photon op tests appear not to be self-consistent: the sky_pos and local_wcs are set independently though both should actually be derived from the image's WCS and the object position within it. This wouldn't be an issue except that the incoming PR #424 implements a new XyToV which is self-consistent through use of the img_wcs alone and so breaks the regression tests here. This PR updates the tests to calculate the the sky_pos and local_wcs together from the image_pos and img_wcs.

Note this isn't an issue in the photon ops themselves, just in the test method. This also changes the expected photon position centre in the regression tests from (-564.5, -1431.4) to (-960.28, -308.09). This is borne out in the tests in PR #424 using the new XyToV implementation which preserves these results.

…cs and image_pos. This changes expected values in the regression tests.

@rmjarvis rmjarvis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks William. This all looks right to me. Just one small suggestion.

Comment thread tests/test_photon_ops.py
Comment on lines 649 to +655
},
]
},
"sky_pos": create_test_img_wcs(
boresight=galsim.CelestialCoord(1.1047934165124105 * galsim.radians, -0.5261230452954583 * galsim.radians),
rottelpos=np.pi / 3 * galsim.radians
).toWorld(image_pos),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Slightly cleaner here would be to define boresight once outside the config, and then use both "boresight": boresight above in photon_ops and use that same value here for the boresight parameter. Otherwise there are two places where a bunch of random numbers need to be visually confirmed to match up.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks Mike, nice spot! I've made that change now.

@welucas2

Copy link
Copy Markdown
Collaborator Author

Merging as agreed at yesterday's meeting.

@welucas2
welucas2 merged commit a96345c into LSSTDESC:main Jan 17, 2025
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.

2 participants