punchbowl.level3.f_corona_model#

Functions#

solve_qp_cube(input_vals, cube, n_nonnan_required, ...)

Fast solver for the quadratic programming problem.

model_fcorona_for_cube(→ tuple[numpy.ndarray, ...)

Model the F corona given a list of times and a corresponding data cube, .

construct_f_corona_background(→ tuple[ndcube.NDCube, ...)

Build f corona background model.

fill_nans_with_interpolation(→ numpy.ndarray)

Fill NaN values in an image using interpolation.

construct_full_f_corona_model(→ list[ndcube.NDCube])

Construct a full F corona model.

subtract_f_corona_background(→ ndcube.NDCube)

Subtract f corona background.

subtract_f_corona_background_task(→ ndcube.NDCube)

Subtracts a background f corona model from an observation.

create_empty_f_background_model(→ numpy.ndarray)

Create an empty background model.

Module Contents#

punchbowl.level3.f_corona_model.solve_qp_cube(input_vals: numpy.ndarray, cube: numpy.ndarray, n_nonnan_required: int = 7)#

Fast solver for the quadratic programming problem.

Parameters:
  • input_vals (np.ndarray) – array of times

  • cube (np.ndarray) – array of data

  • n_nonnan_required (int) – The number of non-nan values that must be present in each pixel’s time series. Any pixels with fewer will not be fit, with zeros returned instead.

Returns:

Array of coefficients for solving polynomial

Return type:

np.ndarray

punchbowl.level3.f_corona_model.model_fcorona_for_cube(xt: numpy.ndarray, cube: numpy.ndarray, min_brightness: float = 1e-16, smooth_level: float | None = 1, return_full_curves: bool = False) tuple[numpy.ndarray, numpy.ndarray] | tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]#

Model the F corona given a list of times and a corresponding data cube, .

Parameters:
  • xt (np.ndarray) – time array

  • cube (np.ndarray) – observation array

  • min_brightness (float) – pixels dimmer than this value are set to nan and considered empty

  • smooth_level (float | None) – If None, no smoothing is applied. Otherwise, the top and bottom smooth_level standard deviations of data are rejected.

  • return_full_curves (bool) – If True, this function returns the full curve fitted to the time series at each pixel and the smoothed data cube. If False (default), only the curve’s value at the central frame is returned, producing a model at one instant in time.

Returns:

  • np.ndarray – The F-corona model at the central point in time. If return_full_curves is True, this is instead the F-corona model at all points in time covered by the data cube

  • np.ndarray – The number of data points used in solving the F-corona model for each pixel of the output

  • np.ndarray – The smoothed data cube. Returned only if return_full_curves is True.

punchbowl.level3.f_corona_model.construct_f_corona_background(data_list: list[str], layer: int, smooth_level: float = 1.0) tuple[ndcube.NDCube, numpy.ndarray]#

Build f corona background model.

punchbowl.level3.f_corona_model.fill_nans_with_interpolation(image: numpy.ndarray) numpy.ndarray#

Fill NaN values in an image using interpolation.

punchbowl.level3.f_corona_model.construct_full_f_corona_model(filenames: list[str]) list[ndcube.NDCube]#

Construct a full F corona model.

punchbowl.level3.f_corona_model.subtract_f_corona_background(data_object: ndcube.NDCube, before_f_background_model: ndcube.NDCube, after_f_background_model: ndcube.NDCube) ndcube.NDCube#

Subtract f corona background.

punchbowl.level3.f_corona_model.subtract_f_corona_background_task(observation: ndcube.NDCube, before_f_background_model_path: str, after_f_background_model_path: str) ndcube.NDCube#

Subtracts a background f corona model from an observation.

This algorithm linearly interpolates between the before and after models.

Parameters:
  • observation (NDCube) – an observation to subtract an f corona model from

  • before_f_background_model_path (str) – path to a NDCube f corona background map before the observation

  • after_f_background_model_path (str) – path to a NDCube f corona background map after the observation

Returns:

A background subtracted data frame

Return type:

NDCube

punchbowl.level3.f_corona_model.create_empty_f_background_model(data_object: ndcube.NDCube) numpy.ndarray#

Create an empty background model.