Skip to content

Commit

Permalink
1.0.0 (#28)
Browse files Browse the repository at this point in the history
* Adds package_settings module (multi-site support)

* Fixes bug when updating models without primary receiver data

* Raises pressure cut lower bound for P014 to 870 mbar

* Adds get_all_receiver_data function

* Fixes order of columns returned by measured_pwv

* Adds requirements.txt
  • Loading branch information
djperrefort committed Oct 27, 2018
1 parent fd69367 commit 95c1e4a
Show file tree
Hide file tree
Showing 24 changed files with 237,244 additions and 236,942 deletions.
73 changes: 0 additions & 73 deletions DEVELOPERS.md

This file was deleted.

2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ include README.md
include LICENSE.txt
include pwv_kpno/CONFIG.txt
graft pwv_kpno/site_data
graft pwv_kpno/sims_phosim
graft pwv_kpno/default_atmosphere
graft pwv_kpno/suomi_data
graft tests
75 changes: 4 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,15 @@
<br>
</h1>

<h4 align="center">
Providing models of the atmospheric transmission function at
Kitt Peak National Observatory
</h4>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[![release](https://img.shields.io/badge/version-0.12.1-blue.svg)]()
[![release](https://img.shields.io/badge/version-1.0.0-blue.svg)]()
[![python](https://img.shields.io/badge/python-2.7,%203.5,%203.6,%203.7-blue.svg)]()
[![license](https://img.shields.io/badge/license-GPL%20v3.0-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
[![Build Status](https://travis-ci.org/mwvgroup/pwv_kpno.svg?branch=master)](https://travis-ci.org/mwvgroup/pwv_kpno)
[![Coverage Status](https://coveralls.io/repos/github/mwvgroup/pwv_kpno/badge.svg?branch=master)](https://coveralls.io/github/mwvgroup/pwv_kpno?branch=master)
[![arxiv](https://img.shields.io/badge/astro--ph.IM-arXiv%3A1806.09701-B31B1B.svg)](https://arxiv.org/abs/1806.09701)

For package documentation and installation instructions, please see
[https://mwvgroup.github.io/pwv_kpno/](https://mwvgroup.github.io/pwv_kpno/)

## Overview

**pwv_kpno** is a Python package for modeling the atmospheric absorption due
to H<sub>2</sub>O at Kitt Peak National Observatory. It provides atmospheric
models from 3,000 to 12,000 Angstroms for years 2010 onward. Understanding atmospheric
effects is important when calibrating ground based astronomical observations.
Traditionally, determining the detailed atmospheric transmission function at a
given date and time required performing dedicated spectrographic observations.
**pwv_kpno** provides an alternative that can be performed at the user's
convenience.

Atmospheric absorption in the near-infrared is highly dependent on the column
density of precipitable water vapor (PWV). By measuring the delay of GPS
signals through the atmosphere, the [SuomiNet](http://www.suominet.ucar.edu)
project provides accurate PWV measurements for multiple, international
locations. The **pwv_kpno** package uses published SuomiNet data in conjunction
with MODTRAN models to determine the modeled atmospheric transmission function
at Kitt Peak in close to real time. The package also provides automated
retrieval and processing of SuomiNet data, allowing photometry to typically be
corrected within an hour of observation.

**pwv_kpno** is open source software released under the GNU General Public
License. Issues, pull requests, and feedback are welcome.

## How to Cite

If you use **pwv_kpno** as part of any published work or research, we ask that
you please use the following standard acknowledgement:

&nbsp;&nbsp;&nbsp;&nbsp;*This research made use of the pwv_kpno python package,*<br>
&nbsp;&nbsp;&nbsp;&nbsp;*an open source project that provides models for the*<br>
&nbsp;&nbsp;&nbsp;&nbsp;*atmospheric absorption due to precipitable water vapor*<br>
&nbsp;&nbsp;&nbsp;&nbsp;*in the near-infrared (Perrefort, Wood-Vasey et al. 2018)*<br>

If the publisher allows, you can also include a footnote with a link pointing
to the documentation page:
[https://mwvgroup.github.io/pwv_kpno/](https://mwvgroup.github.io/pwv_kpno/)

# Acknowledgements

This work is based in part on observations taken at Kitt Peak National
Observatory, National Optical Astronomy Observatory (NOAO Prop. IDs: 2011B-0482
and 2012B-0500; PI: Wood-Vasey), which is operated by the Association of
Universities for Research in Astronomy (AURA) under a cooperative agreement
with the National Science Foundation.

This work was supported in part by the US Department of Energy Office of Science
under DE-SC0007914.

# Additional Resources

- An up time monitor for the SuomiNet website can be found
[here](https://stats.uptimerobot.com/gn1xqsJvj)

- For more information on the Kitt Peak National Observatory, see
[www.noao.edu/kpno/](https://www.noao.edu/kpno/)

- To learn more about the SuomiNet project, see
[www.suominet.ucar.edu/overview.html](http://www.suominet.ucar.edu/overview.html)

- For an additional example on the correlation between GPS signals and
atmospheric modeling, see
[Blake and Shaw, 2011](https://arxiv.org/abs/1109.6703)
to H<sub>2</sub>O. For a full description of this package, including
documentation and usage examples, please see
[https://mwvgroup.github.io/pwv_kpno/](https://mwvgroup.github.io/pwv_kpno/)
51 changes: 42 additions & 9 deletions pwv_kpno/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,37 @@
# You should have received a copy of the GNU General Public License
# along with pwv_kpno. If not, see <http://www.gnu.org/licenses/>.

"""pwv_kpno provides models for the atmospheric transmission function at Kitt
Peak National Observatory due to precipitable water vapor. Models cover
wavelengths from 7,000 to 11,000 Angstroms for years 2010 onward. Documentation
is available online at https://mwvgroup.github.io/pwv_kpno/ or through the
standard python help function.
"""pwv_kpno provides models for the atmospheric transmission function due to
precipitable water vapor (PWV). Using PWV measurements published
by the SuomiNet project (https://www.suominet.ucar.edu), this package is
capable of returning the modeled PWV transmission for a given date, time, and
airmass at customizable geographic locations. By default, this functionality
is set to model Kitt Peak National Observatory. Default models cover
wavelengths from 3,000 to 12,000 Angstroms at a resolution of 0.05 Angstroms.
For more information on using this package, documentation is available online
at https://mwvgroup.github.io/pwv_kpno/ or through the standard python help
function.
An incomplete guide to getting started:
To model the effects of PWV absorption on a black body, see the
documentation for the `blackbody_with_atm` module:
>>> from pwv_kpno import blackbody_with_atm as bb_atm
To model the atmospheric transmission function, either for a known PWV
concentration or for a datetime at a particular location, see the `pw_atm`
module:
>>> from pwv_kpno import pwv_atm
To configure this package to model a custom geographical site, and to
modify other package settings, see the `package_settings` module:
>>> from pwv_kpno import package_settings
"""

from . import blackbody_with_atm
Expand All @@ -29,13 +55,20 @@

__authors__ = ['Daniel Perrefort']
__copyright__ = 'Copyright 2017, Daniel Perrefort'
__credits__ = ['Michael Wood-Vasey', 'Azalee Bostroem',
'Jessica Kroboth', 'Alexander Afanasyev']
__credits__ = [
'W. M. Wood-Vasey',
'K.Azalee Bostroem',
'Jessica Kroboth',
'Tom Matheson',
'Alexander Afanasyev',
]

__license__ = 'GPL V3'
__version__ = '0.12.1'
__version__ = '1.0.0'
__email__ = 'djperrefort@pitt.edu'
__status__ = 'Development'
__status__ = 'Release'

from .package_settings import settings as _settings

from .package_settings import settings as _settings

Expand Down
26 changes: 17 additions & 9 deletions pwv_kpno/_atm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
work done by Azalee Bostroem.
"""

from typing import Union

import numpy as np
import scipy.interpolate as interpolate
from astropy.table import Table
Expand All @@ -31,14 +33,14 @@

__license__ = 'GPL V3'
__email__ = 'djperrefort@pitt.com'
__status__ = 'Development'
__status__ = 'Release'


def _calc_num_density_conversion():
"""Calculate conversion factor from PWV to integrated number density
"""Calculate conversion factor from PWV * cross section to optical depth
Returns:
The conversion factor from PWV to number density in 1 / (mm * cm^2)
The conversion factor in units of 1 / (mm * cm^2)
"""

n_a = 6.02214129E23 # 1 / mol (Avogadro's constant)
Expand All @@ -53,8 +55,8 @@ def _calc_num_density_conversion():


def create_pwv_atm_model(mod_lambda, mod_cs, out_lambda):
# type: (np.ndarray, np.ndarray, np.ndarray) -> Table
"""Creates a table of conversion factors from PWV to number density
# type: (Union[list, np.ndarray], Union[list, np.ndarray], Union[list, np.ndarray]) -> Table
"""Creates a table of conversion factors from PWV to optical depth
Expects input and output wavelengths to be in same units. Expects modeled
cross sections to be in cm^2.
Expand All @@ -65,18 +67,24 @@ def create_pwv_atm_model(mod_lambda, mod_cs, out_lambda):
out_lambda (ndarray): Array of desired output wavelengths
Returns:
A table with columns 'wavelength' and '1/mm_cm_2'
A table with columns 'wavelength' and '1/mm'
"""

mod_cs = np.array(mod_cs)
if (mod_cs < 0).any():
raise ValueError('Cross sections cannot be negative.')

if np.array_equal(mod_lambda, out_lambda):
out_cs = mod_cs
out_cs = mod_cs # This function requires ndarray behavior

else:
interp_cs = interpolate.interp1d(mod_lambda, mod_cs)
out_cs = interp_cs(out_lambda)

pwv_num_density = out_cs * _calc_num_density_conversion()
out_table = Table([out_lambda, pwv_num_density],
names=['wavelength', '1/mm_cm_2'])
out_table = Table(
data=[out_lambda, pwv_num_density],
names=['wavelength', '1/mm']
)

return out_table

0 comments on commit 95c1e4a

Please sign in to comment.