pysiaf

Handling of Science Instrument Aperture Files (SIAF) for space telescopes

https://github.com/spacetelescope/pysiaf

Science Score: 62.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
    Organization spacetelescope has institutional domain (www.stsci.edu)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.2%) to scientific vocabulary

Keywords

aperture astrometry focal-plane python stsci
Last synced: 10 months ago · JSON representation ·

Repository

Handling of Science Instrument Aperture Files (SIAF) for space telescopes

Basic Info
  • Host: GitHub
  • Owner: spacetelescope
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: main
  • Homepage: https://pysiaf.readthedocs.io
  • Size: 55.8 MB
Statistics
  • Stars: 15
  • Watchers: 11
  • Forks: 30
  • Open Issues: 53
  • Releases: 0
Topics
aperture astrometry focal-plane python stsci
Created over 8 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog License Code of conduct Citation

README.md

Build Status Documentation Status PyPI version PyPI - License DOI

pysiaf

Handling of Science Instrument Aperture Files (SIAF) for space telescopes. SIAF files contain detailed geometric focal plane descriptions and relationships for the science instruments. They are maintained in the JWST/HST PRD (Project Reference Database).
pysiaf is a python package to access, interpret, maintain, and generate SIAF, in particular for JWST. Tools for applying the frame transformations, plotting, comparison, and validation are provided.

Functionalities

  • Captures current PRD content, i.e. pysiaf includes a copy of the SIAF XML files. These are maintained to be synchronized with the PRD.
  • Transformations between the SIAF frames (Detector, Science, Ideal, Telelescope/V) are pre-loaded and easily accessible.
  • Tools for plotting, validation, and comparison of SIAF apertures and files.
  • Support for implementing transformations between celestial (RA, Dec) and telescope/V (V2, V3) coordinate systems is provided.
  • Input/output: reading SIAF XML, writing XML/Excel/csv etc.
  • Captures SI source data and code to generate the SIAF apertures
  • Standard python package with installation script, unit tests, documentation.
  • Supports working with HST SIAF (read-only).

Example usage

Check which PRD version is in use:
print(pysiaf.JWST_PRD_VERSION)

Frame transformations (det, sci, idl, tel are supported frames):
```` import pysiaf instrument = 'NIRISS'

# read SIAFXML
siaf = pysiaf.Siaf(instrument)  

# select single aperture by name
nis_cen = siaf['NIS_CEN']  

# access SIAF parameters
print('{} V2Ref = {}'.format(nis_cen.AperName, nis_cen.V2Ref))
print('{} V3Ref = {}'.format(nis_cen.AperName, nis_cen.V3Ref))

for attribute in ['InstrName', 'AperShape']:
    print('{} {} = {}'.format(nis_cen.AperName, attribute, getattr(nis_cen, attribute)))


# coordinates in Science frame
sci_x = np.array([0, 2047, 2047, 0])
sci_y = np.array([0, 0, 2047, 2047])  

# transform from Science frame to Ideal frame
idl_x, idl_y = nis_cen.sci_to_idl(sci_x, sci_y)

````
Plotting (only a small subset of options is illustrated):

```` import matplotlib.pyplot as plt

plt.figure(figsize=(4, 4), facecolor='w', edgecolor='k'); plt.clf()

# plot single aperture
nis_cen.plot()

# plot all apertures in SIAF
for aperture_name, aperture in siaf.apertures.items():
    aperture.plot()
plt.show()

# plot 'master' apertures from pysiaf.siaf import plotmasterapertures plt.figure(figsize=(8, 8), facecolor='w', edgecolor='k'); plt.clf() plotmasterapertures(markref=True) plt.show() # plot HST apertures siaf = pysiaf.Siaf('HST') aperturenames = ['FGS1', 'FGS2', 'FGS3', 'IUVIS1FIX', 'IUVIS2FIX', 'JWFC1FIX', 'JWFC2FIX']

plt.figure(figsize=(4, 4), facecolor='w', edgecolor='k')
for aperture_name in aperture_names:
    siaf[aperture_name].plot(color='r', fill_color='darksalmon', mark_ref=True)
ax = plt.gca()
ax.set_aspect('equal')
ax.invert_yaxis()
plt.show()

````

Documentation

The primary reference for a description of JWST SIAF is Cox & Lallo, 2017, JWST-STScI-001550: Description and Use of the JWST Science Instrument Aperture File, available at https://jwst.stsci.edu/documentation/technical-documents.

pysiaf is documented at https://pysiaf.readthedocs.io/

Citation

If you find this package useful, please consider citing the Zenodo record using the DOI badge above. Please find additional citation instructions in CITATION.

Disclaimer

All parameter values in pysiaf are subject to change. JWST values are preliminary until the JWST observatory commissioning has concluded.

Distortion and other transformations in pysiaf are of sufficient accuracy for operations, but do not necessarily have science-grade quality. For instance, generally only one filter solution is carried per aperture. For science-grade transformations, please consult the science pipelines and their reference files (see https://jwst-docs.stsci.edu/jwst-data-reduction-pipeline)

For science observation planning, the focal plane geometry implemented in the latest APT (http://www.stsci.edu/hst/proposing/apt) takes precedence.
The STScI Telescopes Branch provides full support of pysiaf for S&OC operational systems only.

Contributing

Please open a new issue or new pull request for bugs, feedback, or new features you would like to see. If there is an issue you would like to work on, please leave a comment and we will be happy to assist. New contributions and contributors are very welcome!
Do you have feedback and feature requests? Is there something missing you would like to see? Please open an issue or send an email to the maintainers. This package follows the Space Telescope Code of Conduct strives to provide a welcoming community to all of our users and contributors.

The following describes the typical work flow for contributing to the pysiaf project (adapted from JWQL): 0. Do not commit any sensitive information (e.g. STScI-internal path structures, machine names, user names, passwords, etc.) to this public repository. Git history cannot be erased. 1. Create a fork off of the spacetelescope pysiaf repository on your personal github space. 2. Make a local clone of your fork. 3. Ensure your personal fork is pointing upstream to https://github.com/spacetelescope/pysiaf 4. Open an issue on spacetelescope pysiaf that describes the need for and nature of the changes you plan to make. This is not necessary for minor changes and fixes. 5. Create a branch on that personal fork. 6. Make your software changes. 7. Push that branch to your personal GitHub repository, i.e. to origin. 8. On the spacetelescope pysiaf repository, create a pull request that merges the branch into spacetelescope:master. 9. Assign a reviewer from the team for the pull request. 10. Iterate with the reviewer over any needed changes until the reviewer accepts and merges your branch. 11. Delete your local copy of your branch.

Installation

This package is supported in python 3.10+

pip install pysiaf

Clone the repository:
git clone https://github.com/spacetelescope/pysiaf
Install pysiaf:
cd pysiaf
pip install .

Install in Develop Mode pip install -e .

Known installation issues

If you get an error upon
import pysiaf
that traces back to
import lxml.etree as ET
and states
ImportError [...] Library not loaded: libxml2.2.dylib Reason: Incompatible library version: etree.[...] requires version 12.0.0 or later, but libxml2.2.dylib provides version 10.0.0,
this can probably be fixed by downgrading the version of lxml, e.g.
pip uninstall lxml
pip install lxml==3.6.4

pyqt5 installation issues: If using MacOS Mojave, it causes matplotlib to fail without pyqt5. Please take appropriate action to make sure pyqt5 is installed for

Owner

  • Name: Space Telescope Science Institute
  • Login: spacetelescope
  • Kind: organization
  • Email: help@stsci.edu
  • Location: Baltimore, MD

STScI is operated by AURA for NASA

Citation (CITATION)

If you use `pysiaf` for work/research presented in a publication (whether directly,
or as a dependency to another package), we recommend and encourage the following acknowledgment:

  This research made use of pysiaf, an open source Python package for Handling of
  Science Instrument Aperture Files (SIAF) for space telescopes (Sahlmann et al, 2019).

where (Sahlmann et al, 2019) is a citation of the Zenodo record, e.g.:

@software{johannes_sahlmann_2019_3516964,
  author       = {Johannes Sahlmann and
                  Shannon Osborne and
                  Colin Cox and
                  charlesrp and
                  David Law and
                  Marshall Perrin and
                  marthaboyer and
                  Joseph Hunkeler},
  title        = {{spacetelescope/pysiaf: Introduce check against
                   online version}},
  month        = oct,
  year         = 2019,
  publisher    = {Zenodo},
  version      = {v0.5.1},
  doi          = {10.5281/zenodo.3516964},
  url          = {https://doi.org/10.5281/zenodo.3516964}
}

GitHub Events

Total
  • Create event: 6
  • Release event: 1
  • Issues event: 9
  • Watch event: 1
  • Delete event: 3
  • Member event: 2
  • Issue comment event: 39
  • Push event: 16
  • Pull request review comment event: 4
  • Pull request review event: 25
  • Pull request event: 36
  • Fork event: 3
Last Year
  • Create event: 6
  • Release event: 1
  • Issues event: 9
  • Watch event: 1
  • Delete event: 3
  • Member event: 2
  • Issue comment event: 39
  • Push event: 16
  • Pull request review comment event: 4
  • Pull request review event: 25
  • Pull request event: 36
  • Fork event: 3

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 3
  • Total pull requests: 14
  • Average time to close issues: 12 days
  • Average time to close pull requests: 7 months
  • Total issue authors: 3
  • Total pull request authors: 6
  • Average comments per issue: 1.67
  • Average comments per pull request: 1.29
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 4
Past Year
  • Issues: 3
  • Pull requests: 13
  • Average time to close issues: 12 days
  • Average time to close pull requests: about 2 months
  • Issue authors: 3
  • Pull request authors: 5
  • Average comments per issue: 1.67
  • Average comments per pull request: 0.62
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 4
Top Authors
Issue Authors
  • Witchblade101 (3)
  • Hellseher (1)
  • tapastro (1)
  • braingram (1)
  • JarronL (1)
Pull Request Authors
  • mfixstsci (11)
  • Witchblade101 (6)
  • mperrin (5)
  • dependabot[bot] (4)
  • zacharyburnett (3)
  • mgennaro (3)
  • pbennet (1)
  • tonysohn (1)
  • Russell-Ryan (1)
  • jhunkeler (1)
  • drlaw1558 (1)
  • WilliamJamieson (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (4) github_actions (4) enhancement (1) source-data-update (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 21,562 last-month
  • Total docker downloads: 39
  • Total dependent packages: 15
  • Total dependent repositories: 31
  • Total versions: 53
  • Total maintainers: 4
pypi.org: pysiaf

Handling of Science Instrument Aperture Files (SIAF) for space telescopes

  • Documentation: https://pysiaf.readthedocs.io/
  • License: BSD 3-Clause License Copyright (c) 2018, Space Telescope Science Institute, AURA All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  • Latest release: 0.24.1
    published over 1 year ago
  • Versions: 53
  • Dependent Packages: 15
  • Dependent Repositories: 31
  • Downloads: 21,562 Last month
  • Docker Downloads: 39
Rankings
Dependent packages count: 0.8%
Downloads: 2.3%
Average: 2.4%
Dependent repos count: 2.6%
Docker downloads count: 4.0%
Last synced: 10 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
docs/requirements.txt pypi
  • matplotlib *
  • numpy *
  • scipy *
  • sphinx_automodapi *
  • stsci_rtd_theme *
requirements.txt pypi
  • astropy >=4.3.1
  • lxml >=4.6.4
  • matplotlib >=3.4.3
  • numpy >=1.21.4
  • numpydoc >=1.1.0
  • openpyxl >=3.0.9
  • requests >=2.26.0
  • scipy >=1.7.2
setup.py pypi
  • astropy >=4.3.1
  • lxml >=4.6.4
  • matplotlib >=3.4.3
  • numpy >=1.21.4
  • numpydoc >=1.1.0
  • openpyxl >=3.0.9
  • requests >=2.26.0
  • scipy >=1.7.2