acdc.database.calculate_dark
Functions
Determine the extraction box for a given cenwave (1291 by default) and aperture (PSA by default). |
|
Pull solar data files from NOAA website. |
|
For an input dark dataset, record exposure information including observation time, observatory latitude & longitude. |
|
Parse solar data text files and return date and flux. |
|
Parse new NOAA solar data. |
|
- get_aperture_region(cenwave=1291, aperture='PSA', segments=['FUVA', 'FUVB'], life_adj=[1, 2, 3, 4, 5, 6])[source]
Determine the extraction box for a given cenwave (1291 by default) and aperture (PSA by default).
- Parameters:
cenwave (int) – Cenwave to look up.
aperture (str) – Aperture to look up.
- Returns:
cenwave (int) – Cenwave setting.
apertures (dict) – Dictionary where each key is segment, and the value is another dictionary where each key is lifetime position, and the value is a tuple with (xmin, xmax, ymin, ymax) representing the cenwave extraction box for that segment and LP combo.
- get_solar_data(solardir)[source]
Pull solar data files from NOAA website. Solar data is FTPd from NOAA and written to text files. (Taken from the STScI COS team”s dark monitor, dark_monitor.py, and modified. Original authors include Justin Ely, Mees Fix, Dzhuliya Dashtamirova.)
- Parameters:
solardir (str) – Directory to write the solar data files to.
- measure_darkrate(filename, apertures=None)[source]
For an input dark dataset, record exposure information including observation time, observatory latitude & longitude. Measure dark rate at specified regions of the COS FUV detector at a given time interval in order to accumulate enough counts for a measurement. (Taken from the STScI COS team”s dark monitor, dark_monitor.py, and modified. Original authors include Justin Ely, Mees Fix, Dzhuliya Dashtamirova.)
- Parameters:
filename (str) – Name of dark dataset.
apertures (dict) – Output from get_aperture_region(). This is passed in to avoid running get_aperture_region() many times within this function.
- Returns:
dark_df (
pandas.dataframe) – Pandas dataframe with information for each dark measurement.
- parse_solar_files(files)[source]
Parse solar data text files and return date and flux. (Taken from the STScI COS team”s dark monitor, dark_monitor.py, and modified. Original authors include Justin Ely, Mees Fix, Dzhuliya Dashtamirova.)
- Parameters:
files (str or array-like) – If a string, a check is done to see if string is a file or a directory to be globbed. If not a string, array-like is assumed.
- Returns:
date (
numpy.ndarray) – MJD of each solar flux measurement.flux (
numpy.ndarray) – Solar flux measurements.
- parse_solar_json(infile)[source]
Parse new NOAA solar data. Taken from: https://www.swpc.noaa.gov/products/solar-cycle-progression which leads to: https://services.swpc.noaa.gov/json/solar-cycle/observed-solar-cycle-indices.json