Pysynphot: A Python Re Implementation of a Legacy App in Astronomy

Similar documents
Predicted Countrates for the UV WFC3 Calibration Subsystem using Deuterium Lamps

Flux Units and Line Lists

Herschel PACS ICC. The bandwidth of the PACS photometric system. Issue: 1.1

Exploring Data. Keck LRIS spectra. Handbook of CCD Astronomy by Steve Howell Chap. 4, parts of 6

Sky Brightness at the Hobby-Eberly Telescope

WFC3/UVIS Photometric Transformations

Updates to the COS/NUV Dispersion Solution Zero-points

Contributing to Astropy: A community Python library for astronomers

The magnitude system. ASTR320 Wednesday January 30, 2019

GLoBES. Patrick Huber. Physics Department VT. P. Huber p. 1

Light and Telescope 10/20/2017. PHYS 1411 Introduction to Astronomy. Guideposts (cont d.) Guidepost. Outline (continued) Outline.

AstroBITS: Open Cluster Project

OPTICAL PHOTOMETRY. Observational Astronomy (2011) 1

Light and Telescope 10/22/2018. PHYS 1403 Introduction to Astronomy. Reminder/Announcement. Chapter Outline. Chapter Outline (continued)

Fluxes. 1 March 2016

Photons. Observational Astronomy 2018 Part 1 Prof. S.C. Trager

Gemini Integration Time Calculators

The Galaxy Viewed at Very Short Time-Scales with the Berkeley Visible Image Tube (BVIT)

Foundations of Astronomy 13e Seeds. Chapter 6. Light and Telescopes

Open Cluster Research Project

You, too, can make useful and beautiful astronomical images at Mees: Lesson 3

Continuum Submillimetre Astronomy from UKIRT. Ian Robson UK ATC

Small-Scale Physical Properties of Nebulae in Nearby Disk Galaxies

A Library of the X-ray Universe: Generating the XMM-Newton Source Catalogues

APLUS: A Data Reduction Pipeline for HST/ACS and WFC3 Images

BetaDrizzle: A Redesign of the MultiDrizzle Package

1 A photometric probe for Pan-STARRS

Astr 323: Extragalactic Astronomy and Cosmology. Spring Quarter 2014, University of Washington, Željko Ivezić. Lecture 1:

Light and Telescope 3/4/2018. PHYS 1403 Introduction to Astronomy. Guideposts (cont d.) Guidepost. Outline (continued) Outline.

arxiv:astro-ph/ v1 17 Oct 2002

Astronomical "color"

Science Analysis Tools Design

1 The Preliminary Processing

Hubblecast Episode 91: What does the future hold for Hubble? Part I. Visual notes

Homework on Properties of Galaxies in the Hubble Deep Field Name: Due: Friday, April 8 30 points Prof. Rieke & TA Melissa Halford

Data Reduction - Optical / NIR Imaging. Chian-Chou Chen Ph319

Reduction procedure of long-slit optical spectra. Astrophysical observatory of Asiago

Reduced data products in the ESO Phase 3 archive (Status: 02 August 2017)

Calibration of ACS Prism Slitless Spectroscopy Modes

New physics is learnt from extreme or fundamental things

Homework #7: Properties of Galaxies in the Hubble Deep Field Name: Due: Friday, October points Profs. Rieke

Multi-wavelength Astronomy

Active Galactic Nuclei OIII

Telescopes (Chapter 6)

1. Why photons? 2. Photons in a vacuum

9. Evolution with redshift - z > 1.5. Selection in the rest-frame UV

Telescopes, Observatories, Data Collection

Performance Metrics for Computer Systems. CASS 2018 Lavanya Ramapantulu

Galaxy Metallicity: What Oxygen Tells Us About The Lifecycles of Galaxies Designed by Prof Jess Werk, modified by Marie Wingyee Lau

Sequence Obs ID Instrument Exposure uf Exposure f Date Observed Aimpoint (J2000) (ks) (ks) (α, δ)

Absolute Flux Calibration for STIS First-Order, Low-Resolution Modes

NICMOS Status and Plans

Photometric Systems. Neil Phillips 08 April Introduction 1. 2 Magnitudes and Colours 2

Problem Solving. radians. 180 radians Stars & Elementary Astrophysics: Introduction Press F1 for Help 41. f s. picture. equation.

Life Cycle of Stars. Photometry of star clusters with SalsaJ. Authors: Daniel Duggan & Sarah Roberts

Performance of the NICMOS ETC Against Archived Data

Light Work Memo 4 rev 3: System Temperature Measurements July 7 1

Light and Optics. Light and Optics. Author: Sarah Roberts

TWO SMALL PIECES OF GLASS A Space Science Program for Grades 5-12

Hughes et al., 1998 ApJ, 505, 732 : ASCA. Westerlund, 1990 A&ARv, 2, 29 : Distance to LMC 1 ) ) (ergs s F X L X. 2 s 1. ) (ergs cm

WHAT PHOTOMETRIC PRECISION CAN I ACHIEVE? DAVID BOYD

Delivery of a new ACS SBC throughput curve for Synphot

Astrophysics I ASTR:3771 Fall 2014

Light: Transverse WAVE

Diffraction-Limited Imaging in the Visible On Large Ground-Based Telescopes. Craig Mackay, Institute of Astronomy, University of Cambridge.

A GUI FOR EVOLVE ZAMS

Data-driven models of stars

ASTR-1010: Astronomy I Course Notes Section VI

Measuring the Redshift of M104 The Sombrero Galaxy

Telescopes. Optical Telescope Design. Reflecting Telescope

Validity of the Analysis of Radiochromic Film Using Matlab Code

Spectral Analysis of High Resolution X-ray Binary Data

Intro to SQL. Two components. Data Definition Language (DDL): create table, etc. Data Manipulation Language (DML):

Galaxies 626. Lecture 10 The history of star formation from far infrared and radio observations

ACS CCDs UV and narrowband filters red leak check

The complex gravitational lens system B

Telescopes. Optical Telescope Design. Reflecting Telescope

Deep Surveys or How We Learn About the Early Universe When We Can t Measure All that Would Be Nice!

COS FUV Dispersion Solution Verification at the New Lifetime Position

Extraction of Point Source Spectra from STIS Long Slit Data

The Imaging Chain for X-Ray Astronomy

Road to GIS, PSE s past, present and future

Single-Photon Techniques for the Detection of Periodic Optical Signals

The Emission Spectra of Light

AGILE AGN Working Group S.Mereghetti - on behalf of the AGILE Team

An IDL Based Image Deconvolution Software Package

Results of Recent Multi-wavelength Campaign of SS433 arxiv:astro-ph/ v1 14 Jan 2005

GOODS/FORS2 Final Data Release: Version 3.0

summary of last lecture

EXPOSURE TIME ESTIMATION

Identifying High Redshift Dropouts. Abstract

6 Light from the Stars

Radio Astronomy Project. VLA and VLBA Observations of AGN

From DES to LSST. Transient Processing Goes from Hours to Seconds. Eric Morganson, NCSA LSST Time Domain Meeting Tucson, AZ May 22, 2017

Mass Estimates of Shear Selected Galaxy Clusters

Introduction to SDSS -instruments, survey strategy, etc

Detection of Exoplanets Using the Transit Method

CLASH MCT Program Progress Report. Progress Report on the CLASH Multi-Cycle Treasury Program By Marc Postman

FIVE FUNDED* RESEARCH POSITIONS

Characterizing the Gigahertz radio sky

Transcription:

Pysynphot: A Python Re Implementation of a Legacy App in Astronomy Vicki Laidler 1, Perry Greenfield, Ivo Busko, Robert Jedrzejewski Science Software Branch Space Telescope Science Institute Baltimore, MD 1 Computer Sciences Corporation, STScI

What is synthetic photometry? An attempt to simulate the expected detected count rate of photons given a model for the: Light from the source (star or galaxy) as a function of wavelength (a spectrum) Telescope, instrument, and detector A telescope collects light and magnifies it, but each time the light passes through a lens or bounces off a mirror, a little bit of light is lost. Filters deliberately exclude some wavelengths of light to look at scientifically interesting domains Spectrum * (Optics) = Different spectrum

Why? To help plan observations How long do I need to observe to find what I expect? Or what s the faintest source I can see in the time I have? For calibration Comparing the models vs observations of calibration sources Used to update the models In turn used to calibrate science data

* = * =

The Legacy Application: SYNPHOT Written in early 90 s within the IRAF system. Written in the SPP language Never heard of SPP? Task oriented system SYNPHOT is a package of tasks that generally have many parameters, use files as inputs, and print their results or generate new files Hard to use lower level functionality Has its own mini language for spectrum expressions IRAF is dying Need to rewrite SYNPHOT Chance to fix algorithmic problems

Problems? What problems? Some intrinsic to original architecture, some later identified: Single precision arithmetic Everything is an array Regardless of wavelength sampling choices some spectral features are poorly sampled No memory caching Steep learning curve for mini language Poor handling of redshifts

Solutions Use double precision arithmetic Take advantage of Object Oriented features Avoid lots of file to file operations. Objects as building blocks with easy to use UI Remain flexible on wavelength sampling Defer wavelength choices as long as possible Leave plotting and array manipulation to other software libraries. Use Python, of course

Pysynphot Objects SpectralElement (model telescope, lens or mirror) Know how to multiply themselves with other optics (to produce a CompositeSpectralElement (aka Bandpass) object Don t permit addition with other optics Know how to sample themselves appropriately in wavelength to capture all important structure. Know how to evaluate themselves at arbitrarily specified wavelengths (including arrays of wavelengths) Analytic or table driven models permitted FITS files (astronomer standard data file format) used for table models

SpectralElement Class Hierarchy

Pysynphot Objects (cont.) Spectrum (model star or galaxy): Have all characteristics of SpectralElements Except: Can be added to other sources (to produce a new source: CompositeSpectrum) Can be multiplied with optical objects (to produce a new source) Can t be multiplied with other sources Plus: Knows how to integrate itself (for total flux) Know how to represent its data in different units for: Flux Wavelength

Spectrum Class Hierarchy

Pysynphot Objects (cont.) Observation (simulates an observed spectrum) A Spectrum can collaborate with a Bandpass to produce an Observation cannot be further manipulated cannot be combined with anything else can be queried for interesting things it knows about itself knows how to bin its flux into a specified set of bins (integrate over each bin) eg, corresponding to the actual light distribution onto detector pixels for a particular instrument configuration Doing so accurately is important! Astronomers do not want to lose any flux

Use Python s OO Features Operator overloading to allow Python syntax to construct composite objects through Python expressions. No need for special expression language! User interface is Python Functionality of interest to the user is exposed via methods and properties Expressions only construct relationships, do no evaluation of fluxes or bandpasses. Results are only computed when asked for through a method. Use of properties provides consistent.wave,.flux UI regardless of how these quantities need to be calculated

provides smart wavelength handling Composite objects know their components Each component (SourceSpectrum or SpectralElement) knows its own wavelength sampling Integrations and samplings use union of all relevant wavelengths of combined object Thus the context of a component (whether alone, or as part of a composite) changes the sampling over which it will be integrated Narrow lines on wide spectrum no longer a problem

Spectrum = flux per wavelength, but Wavelength: Angstroms (Å), microns (µ ), nm, mm, cm, m, ev, kev, mev, Hz, khz, mhz, ghz Flux: F λ (ergs/s/cm 2 /Å), F ν (ergs/s/cm 2 /Hz), Janskys (Jy), millijansky (mjy) photons/s/cm 2 /Å, photons/s/cm 2 /Hz Counts Magnitudes (logarithmic; many varieties)

Handling units Transforming flux density between wavelength and frequency is not a simple scaling factor (dν = dλ /λ 2 ) WaveUnit and FluxUnit objects contain all necessary conversion code Internal representation always uses Angstroms (Å) for wavelength and photons/s/cm 2 /Å for Flux. Selection of units only changes how results are displayed, not how they are computed internally.

WaveUnit Class Hierarchy

FluxUnit Class Hierarchy

Benefits from Other Libraries Array manipulation provided by numpy No C extensions needed so far (computational load done by numpy) FITS table I/O provided by PyFITS Graphics provided by matplotlib/pylab synphot package included several plotting tasks we haven t written a single line of plotting code yet Test users all say Wow!

Conclusions The need to port a legacy application became an opportunity to improve it thus re implementation with new architecture, not simply port Python s OO features and available packages made the job much easier Python s ability to support functional style as well as OO is important in lowering the adoption barrier by astronomers

Status Already being used for one instrument s Exposure Time Calculator (SYNPHOT was too inaccurate) All Hubble ETCs will use it next year Commissioning process in progress compare pysynphot results to SYNPHOT, to build confidence/acceptance among SYNPHOT users Preliminary public release Nov 08 UI Documentation: Spring 09 release Scheduled v1.0 release: Aug 09