Skip to main content

LBT/LBC point-source exposure-time calculator

Project description

rretc

The Rapid Response Exposure Time Calculator is an exposure-time calculator for point sources observed with LBT/LBC.

Installation

Install (no dependencies) with:

pip install rretc

Install the optional command-line interface with:

pip install "rretc[cli]"

Python API

The package exposes five functions:

from rretc import msat, nexp, snr, texp, tsat

conditions = {
    "magnitude": 22.0,
    "band": "g",
    "moon_zd": 60.0,
    "moon_phase": 0.0,
    "moon_elongation": 90.0,
    "aperture": 2.25,
    "airmass": 1.3,
    "site_quality": "ultra-clean",
    "seeing": 0.75,
}

count = nexp(100.0, 60.0, **conditions)
seconds = texp(10, 100.0, **conditions)
achieved = snr(60.0, 10, **conditions)

saturation_conditions = {
    key: value
    for key, value in conditions.items()
    if key not in {"magnitude", "aperture"}
}
saturation_time = tsat(18.0, **saturation_conditions)
saturation_magnitude = msat(10.0, **saturation_conditions)

nexp returns the minimum exposure count for a target SNR and exposure duration; texp returns the minimum exposure duration for a target SNR and exposure count; and snr computes the SNR for an exposure stack. texp returns math.inf if the requested SNR is above the systematic-noise limit for the specified number of exposures. tsat returns the exposure time at which the peak pixel saturates; msat returns the corresponding saturation magnitude for a proposed exposure time. Both use 90% of the detector full-well capacity. msat returns math.nan when sky and dark current alone saturate the pixel.

Command line

The CLI requires click or the cli installation extra (pip install ".[cli]"). It provides one subcommand for each API operation and prints one numeric value:

rretc nexp --snr 100 --texp 60 \
  --magnitude 22 --band g --moon-zd 60 --moon-phase 0 \
  --moon-elongation 90 --aperture 2.25

rretc texp --nexp 10 --snr 100 \
  --magnitude 22 --band g --moon-zd 60 --moon-phase 0 \
  --moon-elongation 90 --aperture 2.25

rretc snr --texp 60 --nexp 10 \
  --magnitude 22 --band g --moon-zd 60 --moon-phase 0 \
  --moon-elongation 90 --aperture 2.25

rretc tsat --magnitude 18 --band V --moon-zd 70 --moon-phase 0.75 \
  --moon-elongation 90

rretc msat --texp 10 --band V --moon-zd 70 --moon-phase 0.75 \
  --moon-elongation 90

Run rretc COMMAND --help for all options.

Inputs and assumptions

  • Supported bands are U, B, V_B, V, R, I, u, g, r_B, r, i, and z.
  • Magnitudes are finite values, Vega for Johnson-Cousins bands and AB for Sloan bands.
  • Exposure times are seconds. Lunar angles are degrees. Seeing and aperture are arcseconds.
  • Saturation calculations use the central pixel, so tsat and msat do not take an aperture.
  • moon_phase ranges from 0 for new Moon to 1 for full Moon.
  • moon_zd >= 90 places the Moon below the horizon.
  • Site profiles are standard, dry, and ultra-clean.
  • Default airmass is 1.3, default site quality is ultra-clean, and default seeing is 0.75 arcseconds.

The lunar sky model follows Krisciunas & Schaefer, PASP 103, 1033 (1991). The lunar airmass approximation follows Young, Applied Optics 33, 1108 (1994).

Testing and development

Install with:

pip install . --group dev

Run tests with:

python -m pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rretc-0.1.1.tar.gz (35.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rretc-0.1.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file rretc-0.1.1.tar.gz.

File metadata

  • Download URL: rretc-0.1.1.tar.gz
  • Upload date:
  • Size: 35.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.17.1 {"ci":null,"cpu":"x86_64","distro":{"id":"jammy","libc":{"lib":"glibc","version":"2.35"},"name":"Ubuntu","version":"22.04"},"implementation":{"name":"CPython","version":"3.12.13"},"installer":{"name":"hatch","version":"1.17.1"},"openssl_version":"OpenSSL 3.0.2 15 Mar 2022","python":"3.12.13","system":{"name":"Linux","release":"5.15.0-185-generic"}} HTTPX2/2.5.0

File hashes

Hashes for rretc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3866d8d08435aa848e1b35506c275f7b3c53c8fc56dd38d088631c628655e7b4
MD5 4f7f7234a95b41856411ba69ea16e4cb
BLAKE2b-256 e52fce5b65a89af1ba7700259aa6013a7986eca20b48401004f73c73a6b39d3a

See more details on using hashes here.

File details

Details for the file rretc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: rretc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.17.1 {"ci":null,"cpu":"x86_64","distro":{"id":"jammy","libc":{"lib":"glibc","version":"2.35"},"name":"Ubuntu","version":"22.04"},"implementation":{"name":"CPython","version":"3.12.13"},"installer":{"name":"hatch","version":"1.17.1"},"openssl_version":"OpenSSL 3.0.2 15 Mar 2022","python":"3.12.13","system":{"name":"Linux","release":"5.15.0-185-generic"}} HTTPX2/2.5.0

File hashes

Hashes for rretc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e43795c29f3e02bebd1dcb685485640504d0eceda02f2f4d7b357b0db1562917
MD5 112aae3f0bd784f6d3727bc52cdb854c
BLAKE2b-256 60f47252c670acff21283ab2980def56aec90bbf33a204b083df7906cca31344

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page