Skip to content

Commit 28e35ce

Browse files
authored
Merge pull request #79 from spacetelescope/0.9.9.x
0.9.9 release
2 parents 621af3f + 72b9b60 commit 28e35ce

10 files changed

+24623
-60
lines changed

CODE_OF_CONDUCT.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Spacetelescope Open Source Code of Conduct
2+
3+
We expect all "spacetelescope" organization projects to adopt a code of conduct that ensures a productive, respectful environment for all open source contributors and participants. We are committed to providing a strong and enforced code of conduct and expect everyone in our community to follow these guidelines when interacting with others in all forums. Our goal is to keep ours a positive, inclusive, successful, and growing community. The community of participants in open source Astronomy projects is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences success and continued growth.
4+
5+
6+
As members of the community,
7+
8+
- We pledge to treat all people with respect and provide a harassment- and bullying-free environment, regardless of sex, sexual orientation and/or gender identity, disability, physical appearance, body size, race, nationality, ethnicity, and religion. In particular, sexual language and imagery, sexist, racist, or otherwise exclusionary jokes are not appropriate.
9+
10+
- We pledge to respect the work of others by recognizing acknowledgment/citation requests of original authors. As authors, we pledge to be explicit about how we want our own work to be cited or acknowledged.
11+
12+
- We pledge to welcome those interested in joining the community, and realize that including people with a variety of opinions and backgrounds will only serve to enrich our community. In particular, discussions relating to pros/cons of various technologies, programming languages, and so on are welcome, but these should be done with respect, taking proactive measure to ensure that all participants are heard and feel confident that they can freely express their opinions.
13+
14+
- We pledge to welcome questions and answer them respectfully, paying particular attention to those new to the community. We pledge to provide respectful criticisms and feedback in forums, especially in discussion threads resulting from code contributions.
15+
16+
- We pledge to be conscientious of the perceptions of the wider community and to respond to criticism respectfully. We will strive to model behaviors that encourage productive debate and disagreement, both within our community and where we are criticized. We will treat those outside our community with the same respect as people within our community.
17+
18+
- We pledge to help the entire community follow the code of conduct, and to not remain silent when we see violations of the code of conduct. We will take action when members of our community violate this code such as such as contacting [email protected] (all emails sent to this address will be treated with the strictest confidence) or talking privately with the person.
19+
20+
This code of conduct applies to all community situations online and offline, including mailing lists, forums, social media, conferences, meetings, associated social events, and one-to-one interactions.
21+
22+
Parts of this code of conduct have been adapted from the Astropy and Numfocus codes of conduct.
23+
http://www.astropy.org/code_of_conduct.html
24+
https://www.numfocus.org/about/code-of-conduct/

doc/rtd-pip-requirements

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ numpy
33
matplotlib
44
astropy-helpers
55
astropy
6-
scipy
6+
scipy>=0.18

doc/source/appendixa.rst

+35-35
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Stellar models:
2424
|:ref:`pysynphot-appendixa-ck04` |$PYSYN_CDBS/grid/ck04models |Yes |
2525
+-------------------------------------+-------------------------------+ |
2626
|:ref:`pysynphot-appendixa-kurucz1993`|$PYSYN_CDBS/grid/k93models | |
27+
+-------------------------------------+-------------------------------+ |
28+
|:ref:`pysynphot-appendixa-phoenix` |$PYSYN_CDBS/grid/phoenix | |
2729
+-------------------------------------+-------------------------------+--------------+
2830
|:ref:`pysynphot-appendixa-calspec` |$PYSYN_CDBS/calspec |No |
2931
+-------------------------------------+-------------------------------+ |
@@ -45,8 +47,6 @@ Non-stellar models:
4547
+-------------------------------------+-------------------------------+--------------+
4648
|Atlas/Catalog |Installation Path |Interpolatable|
4749
+=====================================+===============================+==============+
48-
|:ref:`pysynphot-appendixa-phoenix` |$PYSYN_CDBS/grid/phoenix |Yes |
49-
+-------------------------------------+-------------------------------+--------------+
5050
|:ref:`pysynphot-appendixa-bc95` |$PYSYN_CDBS/grid/bc95/templates|No |
5151
+-------------------------------------+-------------------------------+ |
5252
|:ref:`pysynphot-appendixa-kc96` |$PYSYN_CDBS/grid/kc96 | |
@@ -77,7 +77,7 @@ The atlas data files are organized in a similar naming convention as
7777
:ref:`pysynphot-appendixa-kurucz1993`, and are easily accessible using
7878
`~pysynphot.catalog.Icat` (also see :ref:`pysynphot-spec-atlas`).
7979

80-
The example below generates a spectrum with metallicity :math:`\log Z = +0.1`,
80+
The example below generates a spectrum with metallicity ``[M/H] = +0.1``,
8181
temperature :math:`T_{\textnormal{eff}} = 10000 \textnormal{K}`, and gravity
8282
:math:`\log g = 3.0`:
8383

@@ -112,7 +112,7 @@ absolute flux is needed, the model spectrum must be
112112

113113
The following example shows the header from one of the atlas data files.
114114
This file contains all the models for a star of metallicity
115-
:math:`\log Z = 0.0` (``p00``) and effective temperature
115+
``[M/H] = 0.0`` (``p00``) and effective temperature
116116
:math:`T_{\textnormal{eff}} = 8000 \textnormal{K}` (``8000``), which cover a
117117
range of gravities from :math:`\log g = +1.0` (``g10``) to
118118
:math:`\log g = +5.0` (``g50``).
@@ -157,7 +157,7 @@ HISTORY and effective temperature but different gravity.
157157

158158
The example below shows you how to manually select the flux for a specific
159159
model characterized by a given metallicity, effective temperature, and gravity.
160-
The filename ``kp01_10000`` means :math:`\log Z = +0.1` (``p01``) and
160+
The filename ``kp01_10000`` means ``[M/H] = +0.1`` (``p01``) and
161161
:math:`T_{\textnormal{eff}} = 10000 \textnormal{K}` (``10000``). The column
162162
name ``g30`` means :math:`\log g = 3.0`:
163163

@@ -173,6 +173,36 @@ The easier way to to use `~pysynphot.catalog.Icat` (also see
173173
>>> sp = S.Icat('k93models', 10000, 0.1, 3.0)
174174

175175

176+
.. _pysynphot-appendixa-phoenix:
177+
178+
Phoenix Models
179+
==============
180+
181+
The ``$PYSYN_CDBS/grid/phoenix`` directory contains models provided by
182+
`F. Allard et al. <http://perso.ens-lyon.fr/france.allard/>`_
183+
and can be found in the
184+
`Star, Brown Dwarf, and Planet Simulator <http://phoenix.ens-lyon.fr/simulator/index.faces>`_. They use static, spherical symmetric, 1D simulations to completely
185+
describe the atmospheric emission spectrum. The models account for the
186+
formation of molecular bands, such as those of water vapor, methane, or
187+
titanium dioxide, solving for the transfer equation over more than 20,000
188+
wavelength points on average, producing synthetic spectra with 2 Angstroms
189+
resolution. The line selection is repeated at each iteration of the model
190+
until it has converged and the thermal structure obtained. The models here
191+
are calculated with a cloud model, valid across the entire parameter range.
192+
See
193+
`Phoenix models README file <http://www.stsci.edu/hst/observatory/crds/SIfileInfo/pysynphottables/index_phoenix_models_html>`_
194+
for more details.
195+
The atlas data files are organized in a similar naming convention as
196+
:ref:`pysynphot-appendixa-kurucz1993`, and are easily accessible using
197+
`~pysynphot.catalog.Icat` (also see :ref:`pysynphot-spec-atlas`).
198+
199+
The example below generates a spectrum with metallicity ``[M/H] = +0.1``,
200+
temperature :math:`T_{\textnormal{eff}} = 10000 \textnormal{K}`, and gravity
201+
:math:`\log g = 3.0`:
202+
203+
>>> sp = S.Icat('phoenix', 10000, 0.1, 3.0)
204+
205+
176206
.. _pysynphot-appendixa-calspec:
177207

178208
HST Calibration Spectra
@@ -398,36 +428,6 @@ The example below loads a source spectrum of spectral type G0V from the atlas:
398428
>>> sp = S.FileSpectrum(filename)
399429

400430

401-
.. _pysynphot-appendixa-phoenix:
402-
403-
Phoenix Models
404-
==============
405-
406-
The ``$PYSYN_CDBS/grid/phoenix`` directory contains models provided by
407-
`F. Allard et al. <http://perso.ens-lyon.fr/france.allard/>`_
408-
and can be found in the
409-
`Star, Brown Dwarf, and Planet Simulator <http://phoenix.ens-lyon.fr/simulator/index.faces>`_. They use static, spherical symmetric, 1D simulations to completely
410-
describe the atmospheric emission spectrum. The models account for the
411-
formation of molecular bands, such as those of water vapor, methane, or
412-
titanium dioxide, solving for the transfer equation over more than 20,000
413-
wavelength points on average, producing synthetic spectra with 2 Angstroms
414-
resolution. The line selection is repeated at each iteration of the model
415-
until it has converged and the thermal structure obtained. The models here
416-
are calculated with a cloud model, valid across the entire parameter range.
417-
See
418-
`Phoenix models README file <http://www.stsci.edu/hst/observatory/crds/SIfileInfo/pysynphottables/index_phoenix_models_html>`_
419-
for more details.
420-
The atlas data files are organized in a similar naming convention as
421-
:ref:`pysynphot-appendixa-kurucz1993`, and are easily accessible using
422-
`~pysynphot.catalog.Icat` (also see :ref:`pysynphot-spec-atlas`).
423-
424-
The example below generates a spectrum with metallicity :math:`\log Z = +0.1`,
425-
temperature :math:`T_{\textnormal{eff}} = 10000 \textnormal{K}`, and gravity
426-
:math:`\log g = 3.0`:
427-
428-
>>> sp = S.Icat('phoenix', 10000, 0.1, 3.0)
429-
430-
431431
.. _pysynphot-appendixa-bc95:
432432

433433
Bruzual-Charlot Atlas

doc/source/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ References
261261

262262
.. _synphot-ref-greenfield2007:
263263

264-
* `Greenfield, P. & Jedrzejewski, R. 2007, Using Python for Interactive Data Analysis (Baltimore, MD: STScI) <http://stsdas.stsci.edu/perry/pydatatut.pdf>`_
264+
* `Greenfield, P. & Jedrzejewski, R. 2007, Using Python for Interactive Data Analysis (Baltimore, MD: STScI) <http://ssb.stsci.edu/perry/pydatatut.pdf>`_
265265

266266
.. _synphot-ref-gunn2001:
267267

@@ -301,7 +301,7 @@ References
301301

302302
.. _synphot-ref-laidler2009:
303303

304-
* `Laidler, V. 2009, TSR 2009-01: Pysynphot Commissioning Report (Baltimore, MD: STScI) <http://stsdas.stsci.edu/tsr/2009_01/>`_
304+
* `Laidler, V. 2009, TSR 2009-01: Pysynphot Commissioning Report (Baltimore, MD: STScI) <http://ssb.stsci.edu/tsr/2009_01/>`_
305305

306306
.. _synphot-ref-laidler2008:
307307

doc/source/spectrum.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ you want, as shown in the example above.
266266
However, three of the atlases (:ref:`pysynphot-appendixa-ck04`,
267267
:ref:`pysynphot-appendixa-kurucz1993`, and :ref:`pysynphot-appendixa-phoenix`)
268268
have a grid of basis spectra which are indexed for various combinations of
269-
effective temperature (:math:`T_{\textnormal{eff}}`) in Kelvin, log metallicity
270-
(:math:`\log Z`), and log surface gravity (:math:`\log g`). They are best
269+
effective temperature (:math:`T_{\textnormal{eff}}`) in Kelvin, metallicity
270+
(``[M/H]``), and log surface gravity (:math:`\log g`). They are best
271271
accessed with a special `~pysynphot.catalog.Icat` class.
272272
You may specify any combination of the properties, so long as each is
273273
within the allowed range, which differs from atlas to atlas. For example,
@@ -277,7 +277,7 @@ which means that no spectrum can be constructed for effective temperatures
277277
below 3499 K or above 50001 K (i.e., an exception will be raised).
278278
The example below obtains the spectrum for a
279279
:ref:`pysynphot-appendixa-kurucz1993` model with
280-
:math:`T_{\textnormal{eff}} = 6000 \; \textnormal{K}`, :math:`\log Z = 0`, and
280+
:math:`T_{\textnormal{eff}} = 6000 \; \textnormal{K}`, ``[M/H] = 0``, and
281281
:math:`\log g = 4.3`:
282282

283283
>>> sp = S.Icat('k93models', 6440, 0, 4.3)

pysynphot/catalog.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
55
Spectra are constructed from basis spectra which are indexed for various
66
combinations of effective temperature (:math:`T_{\\textnormal{eff}}`),
7-
metallicity (:math:`Z`), and log surface gravity (:math:`\\log g`).
7+
metallicity (``[M/H]``), and log surface gravity (:math:`\\log g`).
88
The user may specify any combination of :math:`T_{\\textnormal{eff}}`,
9-
:math:`Z`, and :math:`\\log g` so long as each parameter is within the range
9+
``[M/H]``, and :math:`\\log g` so long as each parameter is within the range
1010
for that parameter defined by the catalog.
1111
1212
For example, the :ref:`pysynphot-appendixa-ck04` catalog contains spectra for
@@ -96,7 +96,7 @@ def __init__(self,catdir,Teff,metallicity,log_g):
9696
self.parameter_names = ['Teff','metallicity','log G']
9797

9898
filename = locations.CAT_TEMPLATE.replace('*',catdir)
99-
self.name="%s(Teff=%g,z=%g,logG=%g)"%(catdir,Teff,metallicity,log_g)
99+
self.name="%s(Teff=%g,metallicity=%g,logG=%g)"%(catdir,Teff,metallicity,log_g)
100100

101101
if filename in CATALOG_CACHE:
102102
indices = CATALOG_CACHE[filename]
@@ -204,6 +204,11 @@ def _getSpectrum(self, parlist, basename):
204204
os.path.join(basename,filename))
205205
sp = spectrum.TabularSourceSpectrum(filename, fluxname=column)
206206

207+
totflux = sp.integrate()
208+
if not N.isfinite(totflux) or totflux <= 0:
209+
raise exceptions.ParameterOutOfBounds(
210+
"Parameter '{0}' has no valid data.".format(parlist))
211+
207212
result = []
208213
for member in parlist:
209214
result.append(member)

0 commit comments

Comments
 (0)