sot / chandra_aca

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

Allow None input to convert_time_format_spk #163

Closed taldcroft closed 9 months ago

taldcroft commented 9 months ago

Description

This fixes an issue in convert_time_format_spk where it ended up wrapping None as a numpy array with object dtype. The subsequent code in CxoTime then did not recognize that as None and failed.

Interface impacts

None

Testing

Unit tests

chandra_aca/tests/test_aca_image.py .............. [ 7%] chandra_aca/tests/test_all.py ........................ [ 19%] chandra_aca/tests/test_attitude.py ............................................................. [ 50%] chandra_aca/tests/test_dark_model.py .... [ 52%] chandra_aca/tests/test_drift.py .......................... [ 65%] chandra_aca/tests/test_maude_decom.py ............... [ 72%] chandra_aca/tests/test_planets.py .............. [ 79%] chandra_aca/tests/test_psf.py ... [ 81%] chandra_aca/tests/test_residuals.py ss... [ 83%] chandra_aca/tests/test_star_probs.py ................................ [100%]

============================================ 196 passed, 2 skipped in 42.56s =============================================

Independent check of unit tests by Jean
- [x] Linux

### Functional tests
<!-- Describe and document results of any functional tests, otherwise leave the text below -->
No functional testing. Just an FYI that this issue is not a problem in `cxotime.convert_time_format`:

In [1]: from cxotime import convert_time_format

In [2]: convert_time_format(None, "secs") Out[2]: 818607256.278