| 1 |
.. _pysynphot-how-it-works: |
| 2 |
|
| 3 |
******************* |
| 4 |
How pysynphot works |
| 5 |
******************* |
| 6 |
|
| 7 |
The throughput calibration of the HST observatory is represented in a framework |
| 8 |
consisting of: |
| 9 |
|
| 10 |
* Component throughput files for every optical component (e.g., mirror, filter, |
| 11 |
polarizer, disperser, and detector). |
| 12 |
* A configuration table describing the allowed combinations of the components. |
| 13 |
|
| 14 |
In **pysynphot**, a particular observing mode is specified by a list of |
| 15 |
keywords, which might be familiar names of filters, detectors, and gratings. |
| 16 |
The keywords are used to trace the light path through the observatory via the |
| 17 |
configuration graph file (a.k.a. the TMG file) which helps translating the |
| 18 |
keyword list into a list of pointers to data files that contain the individual |
| 19 |
component throughput functions. |
| 20 |
The grand throughput function of the requested observing mode is then formed |
| 21 |
by multiplying together the individual component throughput at each wavelength. |
| 22 |
(See :ref:`pysynphot-appendixb`, :ref:`pysynphot-appendixc`, and |
| 23 |
:ref:`Diaz 2012 <synphot-ref-diaz2012>` for more details on the internal |
| 24 |
structure and functioning of the configuration graph and component throughput |
| 25 |
tables.) |
| 26 |
|
| 27 |
To retrieve a particular HST passband, you furnish the passband |
| 28 |
generator with a couple of keywords, for example, ``"wfc3,uvis2,f555w"``. |
| 29 |
The passband generator uses the keywords to trace a path through the graph |
| 30 |
file, multiplies together the component passbands it encounters along the way, |
| 31 |
and returns the passband evaluated on a particular wavelength grid. You can |
| 32 |
also generate passband in functional form (see :ref:`pysynphot-bandpass`). |
| 33 |
|
| 34 |
Passbands can then be convolved with spectral data to simulate HST |
| 35 |
observations of particular targets. Spectra may come from existing |
| 36 |
files containing lists of fluxes as a function of wavelength, or may be |
| 37 |
dynamically generated (individually or in combination) as simple blackbody, |
| 38 |
power-law, or continuum emission spectra of chosen temperatures and slopes |
| 39 |
(see :ref:`pysynphot-spectrum` and :ref:`pysynphot-appendixa`). |
| 40 |
|
| 41 |
Most **pysynphot** data I/O is done via FITS files with binary table |
| 42 |
extensions, but ASCII tables can also be used. The HST instrument graph (TMG), |
| 43 |
component lookup (a.k.a. TMC and TMT tables), and component throughput tables |
| 44 |
are all in FITS format. Input data files, such as passband throughput |
| 45 |
and spectral data files, may be in either FITS or ASCII format. |
| 46 |
|
| 47 |
|
| 48 |
.. _pysynphot-database: |
| 49 |
|
| 50 |
The pysynphot database |
| 51 |
====================== |
| 52 |
|
| 53 |
The **pysynphot** package is entirely data driven. That is, no information |
| 54 |
pertaining to the physical description of instruments or their |
| 55 |
throughput characteristics is contained within the software, but is |
| 56 |
instead contained within an external "database." These data must be |
| 57 |
available in order to run any **pysynphot** tasks. The data set contains |
| 58 |
the HST instrument graph, component lookup, and component throughput |
| 59 |
tables, which are maintained and stored within the HST Calibration |
| 60 |
Reference Data System (CRDS) at STScI. New versions of these tables |
| 61 |
are created whenever new or updated calibration information become |
| 62 |
available for the HST instruments. Users at STScI have automatic access |
| 63 |
to the **pysynphot** data set on all science computing clusters. |
| 64 |
Because the data set is not currently distributed along with this |
| 65 |
software, off-site users must retrieve and install it separately before |
| 66 |
they will be able to use **pysynphot**. This can be done in one of two ways: |
| 67 |
|
| 68 |
* TAR files: Every time a new **pysynphot** file is delivered to CRDS, |
| 69 |
a "snapshot" of the current **pysynphot** data set is copied into a |
| 70 |
few TAR files, which can then be retrieved, unpacked, and installed |
| 71 |
on your system. Instructions on how to do this can be found in |
| 72 |
:ref:`pysynphot-installation-setup`. This method offers the convenience of |
| 73 |
automatically creating the necessary directory tree for the data. |
| 74 |
* Individual CRDS files: An alternate method is to transfer the |
| 75 |
individual tables using HTTP (``ssb.stsci.edu/trds``) to STScI |
| 76 |
from the directories given also in :ref:`pysynphot-installation-setup`. |
| 77 |
|
| 78 |
The best method is perhaps a combination of the two: First-time |
| 79 |
installers may wish to use the "snapshot" TAR files to initially |
| 80 |
create and populate the directory structure, and then periodically |
| 81 |
check the CRDS area at STScI for updates to individual tables. |
| 82 |
|
| 83 |
The instrument graph and component lookup tables are contained in |
| 84 |
the ``mtab/`` subdirectory and are named ``*_tmg.fits``, ``*_tmc.fits``, |
| 85 |
and ``*_tmt.fits``. |
| 86 |
The component throughput tables are logically grouped into |
| 87 |
subdirectories of ``comp/`` corresponding to each of the HST |
| 88 |
instruments (``acs``, ``cos``, ``fgs``, ``foc``, ``fos``, ``hrs``, ``hsp``, |
| 89 |
``nicmos``, ``nonhst``, ``ota``, ``stis``, ``wfc3``, ``wfpc``, and ``wfpc2``). |
| 90 |
Component throughput table |
| 91 |
names contain a three digit suffix indicating their version number. |
| 92 |
You can determine which tables are new by comparing either their |
| 93 |
names or creation dates with the corresponding set of tables |
| 94 |
installed on your machine. |
| 95 |
|
| 96 |
|
| 97 |
.. _pysynphot-accuracy: |
| 98 |
|
| 99 |
How Accurate are the Synthetic Photometry Results from pysynphot? |
| 100 |
================================================================= |
| 101 |
|
| 102 |
Because the **pysynphot** package is entirely data driven, the accuracy |
| 103 |
of its results depends entirely on the accuracy of the bandpass |
| 104 |
sensitivity curves, and zero points in the **pysynphot** database. The |
| 105 |
accuracy of these values is dependent on the instrument and photometric |
| 106 |
system under consideration. |
| 107 |
|
| 108 |
As a general rule of thumb, synthetic photometry involving photometric |
| 109 |
systems that have been defined from the ground, or photometry that is |
| 110 |
given in ``vegamag``, should only be considered accurate to about 5%. The |
| 111 |
accuracy is a strong function of wavelength and in particular for the |
| 112 |
available HST Calibration spectra, the accuracy |
| 113 |
might be about 5% shortward of :math:`1700 \AA`, where IUE is used, |
| 114 |
and around 2% over the |
| 115 |
STIS range. The accuracy is > 5% at the longer IR wavelengths where |
| 116 |
the dust ring emission dominates (around 2 microns). |
| 117 |
|
| 118 |
Synthetic photometry with the stable HST instrumentation, flying above |
| 119 |
the atmosphere, when used in HST instrument natural systems, without |
| 120 |
reference to ``vegamag``, can achieve accuracy much better than 5%; for |
| 121 |
example, for ACS broad band filters it can be less or about 1% |
| 122 |
(:ref:`De Marchi et al. 2004 <synphot-ref-demarchi2004>`). |
| 123 |
For more details, see the Data Analysis section in the Data Handbooks |
| 124 |
for the respective HST instruments. |
| 125 |
|
| 126 |
|
| 127 |
.. _pysynphot-other-telescopes: |
| 128 |
|
| 129 |
Can pysynphot be Used for Other Telescopes? |
| 130 |
=========================================== |
| 131 |
|
| 132 |
Because the tasks in the **pysynphot** package are data driven, |
| 133 |
instrument observing modes can be changed and new instruments added |
| 134 |
without changing the software. To use **pysynphot** with non-HST |
| 135 |
instruments or components you would need to modify (or rebuild) |
| 136 |
only the instrument graph and component lookup tables. In addition, |
| 137 |
you also need to set the appropriate |
| 138 |
:ref:`telescope collecting area <pysynphot-area>`. |
| 139 |
|
| 140 |
For the tables, **pysynphot** requires: |
| 141 |
|
| 142 |
* One instrument graph table. |
| 143 |
* One component lookup table. |
| 144 |
* One thermal component lookup table (only needed for thermal |
| 145 |
background calculations for NICMOS and WFC3) |
| 146 |
* One throughput table for each telescope and instrument component |
| 147 |
that appears in the graph and component lookup tables. |
| 148 |
|
| 149 |
The names of the instrument graph and component lookup tables to |
| 150 |
be used by **pysynphot** are set by :func:`~pysynphot.refs.setref`. |
| 151 |
The names of the |
| 152 |
individual component throughput tables are contained in the component |
| 153 |
lookup table and are located automatically when needed. See |
| 154 |
:ref:`pysynphot-appendixc` for details on the structure of these tables. |
| 155 |
To build your own |
| 156 |
instrument graph and component lookup tables, it is perhaps the easiest to |
| 157 |
either start with a copy of the existing HST tables and modify or add |
| 158 |
to them, or at least use the HST tables as a model for your own tables. |
| 159 |
|
| 160 |
To make use of your own custom graph and component lookup tables, and telescope |
| 161 |
area in **pysynphot**, just change the relevant values in |
| 162 |
:func:`~pysynphot.refs.setref`. |