Source code for pyampp.util.config

import os

# Match the HMI/GX/IDL convention used in WCS_RSUN and LoadGXmodel:
# 69600000000 cm = 6.96e8 m.
[docs] IDL_HMI_RSUN_CM = 6.96e10
[docs] IDL_HMI_RSUN_M = 6.96e8
[docs] def get_base_directory(): """ Get the base directory depending on the OS. """ home_dir = os.path.expanduser('~') return os.path.join(home_dir, 'pyampp')
[docs] def setup_directories(): """ Create and return the necessary directories for the package. """ base_dir = get_base_directory() # Define subdirectories within the base directory sample_data_dir = os.path.join(base_dir, 'sample') download_dir = os.path.join(base_dir, 'jsoc_cache') gxmodel_dir = os.path.join(base_dir, 'gx_models') # Ensure these directories exist os.makedirs(sample_data_dir, exist_ok=True) os.makedirs(download_dir, exist_ok=True) os.makedirs(gxmodel_dir, exist_ok=True) return sample_data_dir, download_dir, gxmodel_dir
[docs] def aia_euv_passbands(): """ Return the passbands for the SDO/AIA instrument. """ return ['94', '131', '171', '193', '211', '304', '335']
[docs] def aia_uv_passbands(): """ Return the passbands for the SDO/AIA instrument. """ return ['1600', '1700']
[docs] def hmi_b_segments(): """ Return the segments for the HMI magnetogram. """ return ['field', 'inclination', 'azimuth', 'disambig']
[docs] def jsoc_notify_email(): """ Return the email address for JSOC notifications. """ return os.environ.get("PYAMPP_JSOC_NOTIFY_EMAIL", "suncasa-group@njit.edu")
[docs] def hmi_b_products(): """ Return the products for the HMI magnetogram. """ return ['br', 'bp', 'bt']
# Set up the directories when this module is imported SAMPLE_DATA_DIR, DOWNLOAD_DIR, GXMODEL_DIR = setup_directories()
[docs] AIA_EUV_PASSBANDS = aia_euv_passbands()
[docs] AIA_UV_PASSBANDS = aia_uv_passbands()
[docs] JSOC_NOTIFY_EMAIL = jsoc_notify_email()
[docs] HMI_B_SEGMENTS = hmi_b_segments()
[docs] HMI_B_PRODUCTS = hmi_b_products()