Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

cesm_hawc.simulation

cesm_hawc.simulation

source

Run the HAWC ALI simulator on WACCM columns.

Uses the ideal_dolp_imager configuration of hawcsimulator’s IdealALISimulator. Requires the [sim] extra.

Attributes

products_for

def products_for(run_l2: bool) -> tuple

source

Choose which simulator products to request.

Parameters

Returns

retrieval_wavelength_range

def retrieval_wavelength_range() -> tuple[float, float]

source

Return the wavelength range the L2 retrieval’s aerosol model covers.

Read from aliprocessing’s retrieval Mie database (aerosol_median_radius_db), building it on first use.

Returns

check_retrieval_wavelengths

def check_retrieval_wavelengths(wavelengths_nm) -> None

source

Check that wavelengths are within the L2 retrieval’s range.

Outside retrieval_wavelength_range(), the retrieval has no aerosol optical properties, so it would fit radiances it cannot model.

Parameters

Raises

run_ali_simulation_from_profiles

def run_ali_simulation_from_profiles(
    profiles: dict,
    alt_m: np.ndarray,
    sim_geometry: dict,
    *,
    simulator: 'IdealALISimulator | None' = None,
    products: tuple = DEFAULT_PRODUCTS,
    noise_model: ALINoiseModel,
    return_extinction: bool = False,
    truth_wavelengths_nm: np.ndarray | None = None,
)

source

Run the simulator on profiles that have already been extracted.

Use this when running many observations from one file: open one WACCMAtmosphere (and optionally one IdealALISimulator) and reuse them, rather than calling run_ali_simulation(), which reopens the file each time.

Parameters

Returns

Raises

run_ali_simulation

def run_ali_simulation(
    waccm_file: str,
    *,
    lat: float,
    lon: float,
    time_index: int = 0,
    sza_deg: float = 60.0,
    saa_deg: float = 0.0,
    obs_time: str | pd.Timestamp = '2035-01-01T12:00:00Z',
    wavelengths_nm: np.ndarray | None = None,
    alt_grid_m: np.ndarray | None = None,
    run_l2: bool = False,
    noise_model: ALINoiseModel,
) -> dict

source

Simulate one column of a WACCM history file at a fixed geometry.

Parameters

Returns

Raises

Examples

>>> from cesm_hawc.noise import default_noise_model
>>> result = run_ali_simulation(
...     "case.cam.h0.2035-02.nc", lat=30.6, lon=180.0,
...     run_l2=True, noise_model=default_noise_model(),
... )
>>> result["data"]["l2"]["stratospheric_aerosol_extinction_per_m"]