Metadata-Version: 2.1
Name: PyDIET
Version: 0.9.4
Summary: CFHT's Direct Imaging Exposure Time calculator (PyDIET)
Keywords: astronomy,CFHT,imaging
Author-Email: Emmanuel Bertin <bertin@cfht.hawaii.edu>
License: MIT License
         
         Copyright (c) 2024 Emmanuel Bertin
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
         
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Project-URL: Repository, https://github.com/astromatic/pydiet
Project-URL: Homepage, https://www.cfht.hawaii.edu
Project-URL: Documentation, https://astromatic.github.io/pydiet
Requires-Python: >=3.10
Requires-Dist: astropy>=5.0
Requires-Dist: backports.strenum
Requires-Dist: fastapi>=0.74
Requires-Dist: httpx<0.29,>=0.28
Requires-Dist: jinja2>=3.1.2
Requires-Dist: numpy>=1.22
Requires-Dist: pillow>=11.0
Requires-Dist: platformdirs>=3.4.0
Requires-Dist: pydantic>=2.2
Requires-Dist: pydantic-settings>=2.2
Requires-Dist: python-multipart
Requires-Dist: scipy>=1.15
Requires-Dist: setuptools
Requires-Dist: specutils>=1.18.0
Requires-Dist: synphot>=1.5.0
Requires-Dist: tomli>=1.1.0; python_version < "3.11"
Requires-Dist: uvicorn[standard]>=0.30
Provides-Extra: test
Requires-Dist: mypy; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Provides-Extra: doc
Requires-Dist: autodoc_pydantic>=2.2.0; extra == "doc"
Requires-Dist: sphinx>=7.0; extra == "doc"
Requires-Dist: sphinx-rtd-theme>=1.2; extra == "doc"
Requires-Dist: sphinxcontrib-bibtex>=2.4.0; extra == "doc"
Requires-Dist: sphinx-js>=3.2.2; extra == "doc"
Description-Content-Type: text/markdown

# PyDIET

[![Documentation](https://github.com/astromatic/pydiet/actions/workflows/doc.yml/badge.svg)](https://astromatic.github.io/pydiet/)
[![Tests](https://github.com/astromatic/pydiet/actions/workflows/tests.yml/badge.svg)](https://github.com/astromatic/pydiet/actions/workflows/tests.yml)
[![codecov](https://codecov.io/gh/astromatic/pydiet/graph/badge.svg?token=t3ZeGLnWTD)](https://codecov.io/gh/astromatic/pydiet)

PyDIET is [CFHT](https://www.cfht.hawaii.edu)'s new [Direct Imaging Exposure Time calculator](https://pydiet.cfht.hawaii.edu).

<p>
  <img src="https://github.com/astromatic/pydiet/blob/main/docs/src/figures/pydiet.jpg" alt="Screenshot" width="640"/>
</p>

## Important
PyDIET is still in testing phase.
The authors reserve the right to modify, update, or discontinue any aspect of the package at any time without notice.
This includes, but is not limited to, changes in instrument models, calibration data, algorithms, or implementation details, which may result in differences in the outputs produced by PyDIET over time.

The authors shall not be liable for any direct, indirect, incidental, consequential, or special damages arising out of or in connection with the use of, or inability to use PyDIET including but not limited to errors in calculations, scientific results, or observational planning.

## Installing

### pip/pipx

```
git clone https://github.com/astromatic/pydiet
cd pydiet
pip install .
```

### Docker
To build a Dockerfile for installing pyDiet:
```
docker build -t pydiet:latest -f docker/Dockerfile .
```
Run, get a shell, and python venv
```
docker run -tid --name pydiet pydiet
docker exec -ti pydiet "/bin/bash"
source venv_pydiet/bin/activate
```
## Executing (locally)

```
pydiet -b
```

## Customizing
PyDIET can easily be adapted to other astronomical imagers by simply editing the [``data/data_config.toml``](https://github.com/astromatic/pydiet/blob/main/src/pydiet/data/data_config.toml) file in [TOML](https://toml.io) format, and supplying [pysynphot-compliant](https://pysynphot.readthedocs.io/en/latest/using_pysynphot.html#pysynphot-io) transmission/emission [FITS](https://en.wikipedia.org/wiki/FITS) files for the various parts of the instrument chain.
Use the provided [``utils/extract_filter.py`` script](https://github.com/astromatic/pydiet/blob/main/utils/extract_filter.py) to convert ASCII tables to pysynphot-compliant FITS format.

The web interface can easily be customized to accomodate one or several instruments through query form and result display [templates](https://github.com/astromatic/pydiet/tree/main/src/pydiet/templates).

