2. Accessing PWV Data

In order to model the PWV absorption for a given date and time, SuomiNet data for that date must be available on your local machine. By default, each release of pwv_kpno contains all necessary SuomiNet data from 2010 through the end of the previous year. Access to the locally available PWV data is available through the pwv_atm module.

2.1. Checking For Available Data

To check what years of SuomiNet data are locally available, use the available_data function.

pwv_kpno.pwv_atm.available_data()[source]

Return a list of years for which SuomiNet data has been downloaded

Return a list of years for which SuomiNet data has been downloaded to the local machine. Note that this list includes years for which any amount of data has been downloaded. It does not indicate if additional data has been released by SuomiNet for a given year that is not locally available.

Returns:A list of years with locally available SuomiNet data

2.1.1. Examples:

1
2
3
4
>>> from pwv_kpno import pwv_atm
>>> pwv_atm.available_data()

  [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017]

2.2. Updating Data

To download new SuomiNet data to your local machine, use the update_models function. This function will download new data from the SuomiNet web server, and use that data to update the modeled precipitable water vapor for Kitt Peak National Observatory.

pwv_kpno.pwv_atm.update_models(year=None, timeout=None)[source]

Download data from SuomiNet and update the locally stored PWV model

Update the modeled PWV column density for Kitt Peak by downloading new data releases from the SuomiNet website. If a year is provided, use only data for that year. If not, download any published data that is not available on the local machine.

Parameters:
  • year (int) – A Year from 2010 onward
  • timeout (float) – Optional seconds to wait while connecting to SuomiNet
Returns:

A list of years for which models where updated

2.2.1. Examples:

To ensure that the PWV data for pwv_kpno is up to date run:

1
2
3
4
>>> from pwv_kpno import pwv_atm
>>> pwv_atm.update_models()

  [2017, 2018]

If desired, pwv_kpno can be forced to (re)download SuomiNet data for a specific year:

1
2
3
>>> pwv_atm.update_models(2010)

  [2010]

2.3. Measured PWV Data

Data that has been downloaded from SuomiNet can be accessed using the measured_pwv function.

pwv_kpno.pwv_atm.measured_pwv(year=None, month=None, day=None, hour=None)[source]

Return an astropy table of PWV measurements taken by SuomiNet

Return an astropy table of precipitable water vapor (PWV) measurements taken by the SuomiNet project. Columns are named using the SuomiNet IDs for different locations and contain PWV measurements for that location in millimeters. Results can be optionally refined by year, month, day, and hour.

Parameters:
  • year (int) – The year of the desired PWV data
  • month (int) – The month of the desired PWV data
  • day (int) – The day of the desired PWV data
  • hour (int) – The hour of the desired PWV data in 24-hour format
Returns:

An astropy table of measured PWV values in mm

2.3.1. Examples:

To retrieve all SuomiNet data available on the local machine as an astropy table:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
>>> from pwv_kpno import pwv_atm
>>> pwv_atm.measured_pwv()

           date       KITT KITT_err P014 P014_err SA46 SA46_err SA48 ...
           UTC         mm     mm     mm     mm     mm     mm     mm  ...
  ------------------- ---- -------- ---- -------- ---- -------- ---- ...
  2010-01-01 00:15:00   --       --  3.6    0.125  4.2    0.125  4.7 ...
  2010-01-01 00:45:00   --       --  3.7    0.125  4.0    0.125  4.7 ...
  2010-01-01 01:15:00   --       --  3.7    0.025  3.4    0.125  3.6 ...
               ...     ...      ...  ...      ...  ...      ...  ... ...

To retrieve SuomiNet data taken on a specific date, specify the desired datetime using keyword arguments. Note in the below example that there is no data available from the SA48 receiver for this date:

1
2
3
4
5
6
7
8
9
>>> pwv_atm.measured_pwv(year=2016, month=11, day=14)

           date       KITT KITT_err P014 P014_err SA46 SA46_err SA48 ...
           UTC         mm     mm     mm     mm     mm     mm     mm  ...
  ------------------- ---- -------- ---- -------- ---- -------- ---- ...
  2016-11-14 00:15:00  4.7    1.025  6.9    0.525  9.8    0.725   -- ...
  2016-11-14 00:45:00  4.3    1.025  6.7    0.425  9.9    0.525   -- ...
  2016-11-14 01:15:00  3.9    0.925  6.7    0.425  9.7    0.525   -- ...
               ...     ...      ...  ...      ...  ...      ...  ... ...

Note: If no SuomiNet data is available at all during the specified datetime, then the returned table will be empty.

2.4. Modeled PWV Data

To retrieve the modeled PWV level at Kitt Peak National Observatory, use the modeled_pwv function.

pwv_kpno.pwv_atm.modeled_pwv(year=None, month=None, day=None, hour=None)[source]

Return an astropy table of the modeled PWV at Kitt Peak

Return a model for the precipitable water vapor level at Kitt Peak as an astropy table. PWV measurements are reported in units of millimeters. Results can be optionally refined by year, month, day, and hour.

Parameters:
  • year (int) – The year of the desired PWV data
  • month (int) – The month of the desired PWV data
  • day (int) – The day of the desired PWV data
  • hour (int) – The hour of the desired PWV data in 24-hour format
Returns:

An astropy table of modeled PWV values in mm

2.4.1. Examples:

To retrieve the entire PWV model from 2010 onward:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
>>> from pwv_kpno import pwv_atm
>>> pwv_atm.modeled_pwv()

           date       pwv   pwv_err
           UTC         mm      mm
  ------------------- ----- -------
  2010-01-01 00:15:00 1.55    1.227
  2010-01-01 00:45:00 1.532   1.225
  2010-01-01 01:15:00 1.178   1.175
                  ...   ...     ...

To retrieve the modeled PWV level for November 14th, 2016:

1
2
3
4
5
6
7
8
9
>>> pwv_atm.modeled_pwv(year=2016, month=11, day=14)

           date       pwv pwv_err
           UTC         mm    mm
  ------------------- --- -------
  2016-11-14 00:15:00 4.7   1.025
  2016-11-14 00:45:00 4.3   1.025
  2016-11-14 01:15:00 3.9   0.925
                  ... ...    ...

2.5. PWV For a Given Date

For convenience, users can interpolate from the modeld PWV concentration at Kitt Peak using the pwv_date function. Note that this function does not return an uncertainty on the measured value.

pwv_kpno.pwv_atm.pwv_date(date, airmass=1)[source]

Returns the modeled PWV column density at Kitt Peak for a given date

Interpolate from the modeled PWV column density at Kitt Peak and return the PWV column density for a given datetime and airmass.

Parameters:
  • date (datetime) – The date of the desired PWV column density
  • airmass (float) – The airmass along line of sight
Returns:

The modeled PWV column density for Kitt Peak

2.5.1. Examples:

To retrieve the modeled PWV level for November 14, 2016 at 11:06 AM:

1
2
3
4
5
6
>>> from datetime import datetime
>>> from pwv_kpno import pwv_atm
>>> import pytz
>>>
>>> date = datetime(2016, 11, 14, 11, 6, tzinfo=pytz.utc)
>>> pwv = pwv_atm.pwv_date(date)