punchbowl.level3.f_corona_model#

Functions#

query_f_corona_model_source(→ list[str])

Create a list of files for later F corona model generation.

_zvalue_from_index(arr, ind)

Do math.

nan_percentile(→ numpy.ndarray)

Calculate the nan percentile faster of a 3D cube.

construct_f_corona_background(→ ndcube.NDCube)

Build f corona background 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.query_f_corona_model_source(polarizer: str, product: str, start_datetime: datetime.datetime, end_datetime: datetime.datetime) list[str]#

Create a list of files for later F corona model generation.

Creates a list of files based between a start date/time (start_datetime) and an end date/time (end_datetime) for a specified polarizer and PUNCH_product. The start and end times can both be input explicitly, individually, or derived from a mid time.

if start_datetime (datetime object) and an end_datetime(datetime object) are specified a list of files between those dates is produced for the specified polarizer and PUNCH_product.

Parameters:
  • polarizer (string [= 'clear', '-60', '60', '0' ]) – input a string specifying the type of polarizer to search for

  • product (string [= 'mosaic', 'nfi']) – product code to analyze

  • start_datetime (datetime) – input a start_datetime of interest.

  • end_datetime (datetime) – input a start_datetime of interest.

Returns:

file_list – returns a list of files over the specified period for the specified polarizer.

Return type:

[list]

punchbowl.level3.f_corona_model._zvalue_from_index(arr, ind)#

Do math.

Private helper function to work around the limitation of np.choose() by employing np.take(). arr has to be a 3D array ind has to be a 2D array containing values for z-indicies to take from arr See: http://stackoverflow.com/a/32091712/4169585 This is faster and more memory efficient than using the ogrid based solution with fancy indexing.

punchbowl.level3.f_corona_model.nan_percentile(arr: numpy.ndarray, q: list[float] | float) numpy.ndarray#

Calculate the nan percentile faster of a 3D cube.

punchbowl.level3.f_corona_model.construct_f_corona_background(data_list: list[str], layer: int) ndcube.NDCube#

Build f corona background 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.