sot / chandra_aca

Chandra Aspect Camera Tools
https://sot.github.io/chandra_aca
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Add new functions to get Earth boresight angles and Earth block intervals #164

Closed taldcroft closed 8 months ago

taldcroft commented 8 months ago

Description

This provides a new function to get the angle from the Chandra ACA boresight to the Earth limb and Earth center over a date range. It also provides the Earth opening angle at the same time sampling.

It also adds a simple convenience function to get time intervals when the boresight to limb angle is below a certain value (10 deg by default).

Interface impacts

Adds two new functions. This PR is a requirement for https://github.com/sot/kalman_watch/pull/11.

Testing

Unit tests

chandra_aca/tests/test_aca_image.py .............. [ 6%] chandra_aca/tests/test_all.py ........................ [ 18%] chandra_aca/tests/test_attitude.py ............................................................. [ 49%] chandra_aca/tests/test_dark_model.py .... [ 50%] chandra_aca/tests/test_drift.py .......................... [ 63%] chandra_aca/tests/test_maude_decom.py .................. [ 72%] chandra_aca/tests/test_planets.py ............... [ 80%] chandra_aca/tests/test_psf.py ... [ 81%] chandra_aca/tests/test_residuals.py ss... [ 84%] chandra_aca/tests/test_star_probs.py ................................ [100%]

================================================== 200 passed, 2 skipped in 44.01s ==================================================



Independent check of unit tests by [REVIEWER NAME]
- [ ] [PLATFORM]:

### Functional tests
<!-- Describe and document results of any functional tests, otherwise leave the text below -->
#### From this PR
<img width="578" alt="image" src="https://github.com/sot/chandra_aca/assets/348089/c4026bae-4973-4adc-b2f1-b06cb8d2eb8e">

#### From MATLAB MCC
<img width="600" alt="image" src="https://github.com/sot/chandra_aca/assets/348089/e20cf8c5-40a5-421a-98c4-2020a959ecf1">
javierggt commented 8 months ago

I ran the tests and went over the code and it looks reasonable to me. The things I pointed out are trivial, basically improving a docstring and adding one small test.

The third comment (moving np.sawpaxes into the call to np.einsum) is your call.

taldcroft commented 8 months ago

@javierggt - I addressed your comments in f1a501c. And I noticed a comment mistake which is fixed in 733d4e6.