Weather utilities
Definition of the weather interface.
- weather.weather.PWV(site, form='exact', month='Apr', day=15, year=2015, path_to_weather='/Users/dpesce/Desktop/ngEHT/ngeht-sims-makeover/ngeht-sims/ngehtsim/weather_data')[source]
Retrieve the precipitable water vapor (PWV) information for a specified site.
- Parameters
site (str) – The name of the site
form (str) – The form of value to report; can be ‘mean’, ‘median’, ‘good’, ‘bad’, exact’, or ‘all’
day (str or int) – The day of the month for which to report weather; only used for form = ‘exact’
year (str or int) – The year for which to report weather; only used for form = ‘exact’
path_to_weather (str) – The file path for the top-level weather data directory
- Returns
The requested PWV value(s), in mm; if form = ‘all’, then returns a numpy.ndarray
- Return type
(float)
- weather.weather.brightness_temperature(site, form='exact', month='Apr', day=15, year=2015, freq=230.0, path_to_weather='/Users/dpesce/Desktop/ngEHT/ngeht-sims-makeover/ngeht-sims/ngehtsim/weather_data')[source]
Retrieve the zenith brightness temperature information for a specified site at a specified frequency.
- Parameters
site (str) – The name of the site
form (str) – The form of value to report; can be ‘mean’, ‘median’, ‘good’, ‘bad’, exact’, or ‘all’
day (str or int) – The day of the month for which to report weather; only used for form = ‘exact’
year (str or int) – The year for which to report weather; only used for form = ‘exact’
freq (float) – The observing frequency, in GHz
path_to_weather (str) – The file path for the top-level weather data directory
- Returns
The requested brightness temperature value(s), in K; if form = ‘all’, then returns a numpy.ndarray
- Return type
(float)
- weather.weather.brightness_temperature_spectrum(site, form='exact', month='Apr', day=15, year=2015, path_to_weather='/Users/dpesce/Desktop/ngEHT/ngeht-sims-makeover/ngeht-sims/ngehtsim/weather_data')[source]
Retrieve the zenith brightness temperature information for a specified site as a function of frequency.
- Parameters
site (str) – The name of the site
form (str) – The form of value to report; can be ‘mean’, ‘median’, ‘good’, ‘bad’, exact’, or ‘all’
day (str or int) – The day of the month for which to report weather; only used for form = ‘exact’
year (str or int) – The year for which to report weather; only used for form = ‘exact’
path_to_weather (str) – The file path for the top-level weather data directory
- Returns
The requested brightness temperature values; if form = ‘all’, then returns a 2D array
- Return type
- weather.weather.opacity(site, form='exact', month='Apr', day=15, year=2015, freq=230.0, path_to_weather='/Users/dpesce/Desktop/ngEHT/ngeht-sims-makeover/ngeht-sims/ngehtsim/weather_data')[source]
Retrieve the zenith opacity information for a specified site at a specified frequency.
- Parameters
site (str) – The name of the site
form (str) – The form of value to report; can be ‘mean’, ‘median’, ‘good’, ‘bad’, exact’, or ‘all’
day (str or int) – The day of the month for which to report weather; only used for form = ‘exact’
year (str or int) – The year for which to report weather; only used for form = ‘exact’
freq (float) – The observing frequency, in GHz
path_to_weather (str) – The file path for the top-level weather data directory
- Returns
The requested opacity value(s); if form = ‘all’, then returns a numpy.ndarray
- Return type
(float)
- weather.weather.opacity_spectrum(site, form='exact', month='Apr', day=15, year=2015, path_to_weather='/Users/dpesce/Desktop/ngEHT/ngeht-sims-makeover/ngeht-sims/ngehtsim/weather_data')[source]
Retrieve the zenith opacity information for a specified site as a function of frequency.
- Parameters
site (str) – The name of the site
form (str) – The form of value to report; can be ‘mean’, ‘median’, ‘good’, ‘bad’, exact’, or ‘all’
day (str or int) – The day of the month for which to report weather; only used for form = ‘exact’
year (str or int) – The year for which to report weather; only used for form = ‘exact’
path_to_weather (str) – The file path for the top-level weather data directory
- Returns
The requested opacity values; if form = ‘all’, then returns a 2D array
- Return type
- weather.weather.pressure(site, form='exact', month='Apr', day=15, year=2015, path_to_weather='/Users/dpesce/Desktop/ngEHT/ngeht-sims-makeover/ngeht-sims/ngehtsim/weather_data')[source]
Retrieve the surface pressure information for a specified site.
- Parameters
site (str) – The name of the site
form (str) – The form of value to report; can be ‘mean’, ‘median’, ‘good’, ‘bad’, exact’, or ‘all’
day (str or int) – The day of the month for which to report weather; only used for form = ‘exact’
year (str or int) – The year for which to report weather; only used for form = ‘exact’
path_to_weather (str) – The file path for the top-level weather data directory
- Returns
The requested pressure value(s), in mbar; if form = ‘all’, then returns a numpy.ndarray
- Return type
(float)
- weather.weather.read_binary_atm(filename, Ncomps=40)[source]
Read a stored weather data file containing either opacity or brightness temperature info.
- Parameters
- Returns
Several arrays containing the dates/times and PCA component coefficients
- Return type
- weather.weather.read_binary_weather(filename)[source]
Read a stored weather data file containing pressure, temperature, wind, or PWV info.
- Parameters
filename (str) – The name of the weather data file
- Returns
Several arrays containing the dates/times and weather values read from the file
- Return type
- weather.weather.reconstruct_spectrum_Tb(coeffs)[source]
Reconstruct a brightness temperature spectrum from PCA component coefficients.
- Parameters
coeffs (numpy.ndarray) – Array containing the PCA component coefficients
- Returns
Array containing the brightness temperature spectrum
- Return type
- weather.weather.reconstruct_spectrum_tau(coeffs)[source]
Reconstruct an opacity spectrum from PCA component coefficients.
- Parameters
coeffs (numpy.ndarray) – Array containing the PCA component coefficients
- Returns
Array containing the opacity spectrum
- Return type
- weather.weather.temperature(site, form='exact', month='Apr', day=15, year=2015, path_to_weather='/Users/dpesce/Desktop/ngEHT/ngeht-sims-makeover/ngeht-sims/ngehtsim/weather_data')[source]
Retrieve the surface temperature information for a specified site.
- Parameters
site (str) – The name of the site
form (str) – The form of value to report; can be ‘mean’, ‘median’, ‘good’, ‘bad’, exact’, or ‘all’
day (str or int) – The day of the month for which to report weather; only used for form = ‘exact’
year (str or int) – The year for which to report weather; only used for form = ‘exact’
path_to_weather (str) – The file path for the top-level weather data directory
- Returns
The requested temperature value(s), in K; if form = ‘all’, then returns a numpy.ndarray
- Return type
(float)
- weather.weather.windspeed(site, form='exact', month='Apr', day=15, year=2015, path_to_weather='/Users/dpesce/Desktop/ngEHT/ngeht-sims-makeover/ngeht-sims/ngehtsim/weather_data')[source]
Retrieve the windspeed information for a specified site.
- Parameters
site (str) – The name of the site
form (str) – The form of value to report; can be ‘mean’, ‘median’, ‘good’, ‘bad’, exact’, or ‘all’
day (str or int) – The day of the month for which to report weather; only used for form = ‘exact’
year (str or int) – The year for which to report weather; only used for form = ‘exact’
path_to_weather (str) – The file path for the top-level weather data directory
- Returns
The requested windspeed value(s), in m/s; if form = ‘all’, then returns a numpy.ndarray
- Return type
(float)