Metadata-Version: 2.4
Name: pandoravisibility
Version: 2.1.0
Summary: A tool for calculating the visibility of targets from Pandora
License-Expression: BSD-3-Clause
License-File: licenses/DORADO_LICENSE.txt
License-File: licenses/LICENSE
License-File: licenses/README.md
License-File: licenses/m4opt_LICENSE.rst
Keywords: pandora,astronomy,spacecraft,visibility
Author: Tom Barclay
Author-email: barclay.astro@gmail.com
Maintainer: Joe P. Renaud
Maintainer-email: joseph.p.renaud@nasa.gov
Requires-Python: >=3.11,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Provides-Extra: plotting
Requires-Dist: astropy (>=7.0)
Requires-Dist: gaiaoffline (>=1.0.3,<2.0)
Requires-Dist: matplotlib (>=3.9,<4.0) ; extra == "plotting"
Requires-Dist: numpy (>=2.0)
Requires-Dist: sgp4 (>=2.25,<3.0)
Project-URL: Changelog, https://github.com/PandoraMission/pandora-visibility/blob/main/CHANGES.md
Project-URL: Homepage, https://github.com/PandoraMission/pandora-visibility
Project-URL: Issues, https://github.com/PandoraMission/pandora-visibility/issues
Project-URL: Repository, https://github.com/PandoraMission/pandora-visibility
Description-Content-Type: text/markdown

# pandora-visibility
<a href="https://github.com/pandoramission/pandora-visibility/actions/workflows/python-package.yml"><img src="https://github.com/pandoramission/pandora-visibility/actions/workflows/python-package.yml/badge.svg" alt="Test status"/></a>

Tool for calculating the visibility of targets from Pandora

See the docs/ folder for an example notebook on using this software.

### NIRDA trace check and the offline Gaia catalog
By default `Visibility.get_visibility(..., optimize_roll=True)` also rejects rolls where the NIRDA slitless traces of nearby stars land on the target's extraction aperture (`use_trace_sweep=True`, see `src/pandoravisibility/trace.py`). The nearby stars come from a local copy of Gaia DR3 managed by [gaiaoffline](https://github.com/christinahedges/gaiaoffline), which is installed with this package but whose database (~30 GB) must be downloaded once, as described in its README (a precomputed copy is on Zenodo). Without the database, construct `Visibility` with `use_trace_sweep=False`; the roll search then behaves as before.

The check takes `trace_contamination_tol` (default 1e-3, contaminating over target flux in the worst spectral channel), `nirda_roi_x` and `nirda_roi_y` (default 80 x 256, the flight ROI, with the target's pivot where it was measured on orbit; any other size centers the target's trace, keeping it within 225 columns of the right edge). Every other model setting (roll-to-detector mapping, trace extent, aperture, line-spread function, roll uncertainty, catalog depth) is a module constant at the top of `trace.py` or `star_field.py`. `trace.plot_trace` draws the simulated subarray at a given roll.

### Simulated VISDA star field
`visda.plot_visible_field` draws what the visible camera (VISDA) would see in one uncoadded 0.2 s frame at a given roll: the Gaia stars from `star_field.query_visible_field` (same gaiaoffline catalog), in the VisSci detector frame, with a red box on the target and a blue box on the field center. The field size (default 1056 x 1056 px), the target's pixel, both box sizes and the BP magnitude limit (default 16) are keyword arguments. The camera model (pixel scale, roll-to-detector mapping, Gaia-to-counts photometry, PSF, noise and saturation) is a set of module constants at the top of `visda.py`, calibrated on VisSci data from orbit. Both docs notebooks end with these fields.

### Acknowledgements
This project incorporates code from [m4opt](https://github.com/m4opt/m4opt/), which is licensed under the BSD 3-Clause License.

