Skip to main content

A Python wrapper for the ESO TIPTOP adaptive optics PSF simulation microservice

Project description

TIPTOP-iPy

A Python wrapper for the ESO TIPTOP adaptive optics PSF simulation microservice.

$ pip install git+https://github.com/astronomyk/tiptop_ipy.git

Basic Usage

List the available instrument templates:

>>> from tiptop_ipy import TipTop

>>> TipTop.list_instruments()
['ANDES', 'ERIS', 'ERIS_LGS', 'HARMONI_SCAO', 'HarmoniLTAO_1', ...]

Create a TipTop object and generate a PSF:

>>> eris = TipTop("ERIS")
>>> result = eris.generate_psf()
>>> result.writeto("eris.fits", overwrite=True)

The result object provides convenient access to the PSF data:

>>> result.psf.shape
(1, 256, 256)

>>> result.strehl
array([0.891])

>>> result.fwhm
array([44.1])

Playing with parameters

Parameters are accessed using tuple indexing on the TipTop object:

>>> eris["atmosphere"]
{'Cn2Weights': [0.59, 0.02, ...], 'Cn2Heights': [30, 140, ...], 'Seeing': 0.8, ...}

>>> eris["atmosphere", "Seeing"]
0.8

Values can be updated using the same syntax. For example, we can ask TIPTOP to generate two PSFs (on-axis, 10" off-axis):

>>> eris["sources_science", "Zenith"] = [0, 10]
>>> eris["sources_science", "Azimuth"] = [0, 180]
>>> result = eris.generate_psf()

>>> result.plot()

To see what you've changed from the template defaults:

>>> eris.diff()
{'sources_science': {'Zenith': ([0], [0, 10]), 'Azimuth': ([0], [0, 180])}}

To reset back to the original template:

>>> eris.reset()

PSF FITS file format

The TIPTOP server returns a FITS file with 5 HDUs:

>>> eris = TipTop("ERIS")
>>> result = eris.generate_psf()
>>> result
TipTopResult(1 wavelength(s), 1 position(s), 5 HDUs, Strehl=0.891)

HDU 0: PrimaryHDU — header with config parameters and timing
HDU 1: ImageHDU   — PSF CUBE (N, FOV, FOV)
HDU 2: ImageHDU   — OPEN-LOOP PSF (FOV, FOV)
HDU 3: ImageHDU   — DIFFRACTION LIMITED PSF (FOV, FOV)
HDU 4: ImageHDU   — Radial profiles

Strehl ratios, FWHM values, and coordinates are read from the PSF CUBE header cards.

Documentation

Full documentation is available at tiptop-ipy.readthedocs.io.

For details on the TIPTOP configuration parameters, see the TIPTOP documentation.

For bug reports and feature requests, please use the GitHub issues page.

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

tiptop_ipy-0.2.0.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

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

tiptop_ipy-0.2.0-py3-none-any.whl (58.1 kB view details)

Uploaded Python 3

File details

Details for the file tiptop_ipy-0.2.0.tar.gz.

File metadata

  • Download URL: tiptop_ipy-0.2.0.tar.gz
  • Upload date:
  • Size: 35.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for tiptop_ipy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2a40e8a622d51ab205be797f67915df17c62482597cfaf142af93e48c8ba5e58
MD5 c953257bbf15f6bd98e0b522caf2f5a1
BLAKE2b-256 0e7a2bcc9702235e7e015f575d591997d4d6e24fcb4a31e39378a61403c0d1ba

See more details on using hashes here.

File details

Details for the file tiptop_ipy-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: tiptop_ipy-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 58.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for tiptop_ipy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ad16792afc87bccc86e049232a9624c6cf4eefb0b21e3b7e05864e0c7474152
MD5 277ac4ef43fe84a506ad56fcf8c23488
BLAKE2b-256 8a50281856ef5d58e0fe0b00f86f540695314b99bc9c837014347a19514ee725

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