coconut_tools.magnetogram.Yaroslavsky_filter

Local Weighted Filtering Interface for Radial Magnetogram Field (Br)

This script applies a local adaptive filter based on spatial and radiometric proximity, using a Gaussian kernel controlled by alpha and Rn.

Author: Jose Murteira Cleaned and modularized by: Luis

Functions

filter_radial_field_weighted(Br, phi, theta, ...)

Apply local weighted filtering to radial magnetic field map.

process_config(config[, method_used])

Process a single-date or multi-date Yaroslavsky configuration.

process_magnetogram_date(config, target_date)

Process one target date with the local weighted filter.

coconut_tools.magnetogram.Yaroslavsky_filter.filter_radial_field_weighted(Br, phi, theta, alpha_factor, Rn, sig=0.0, write_gaussian_prepass=False)[source]

Apply local weighted filtering to radial magnetic field map.

Parameters:
  • Br (np.ndarray) – Input magnetic field map.

  • phi (np.ndarray) – 1D array of longitudes in radians.

  • theta (np.ndarray) – 1D array of latitudes in radians.

  • alpha_factor (float) – Alpha controlling kernel sharpness.

  • Rn (float) – Radius of neighborhood in physical units.

  • sig (float) – Sigma of optional Gaussian smoothing.

  • write_gaussian_prepass (bool) – Whether to export Gaussian-smoothed version.

Returns:

Filtered Br field.

Return type:

np.ndarray

coconut_tools.magnetogram.Yaroslavsky_filter.process_config(config, method_used='Yaroslavsky')[source]

Process a single-date or multi-date Yaroslavsky configuration.

Parameters:
  • config (dict[str, Any]) – Processing configuration.

  • method_used (str) – Method label included in output filenames.

Returns:

Per-date processing results.

Return type:

list[dict[str, Any]]

coconut_tools.magnetogram.Yaroslavsky_filter.process_magnetogram_date(config, target_date, method_used='Yaroslavsky', output_path_fig=None)[source]

Process one target date with the local weighted filter.

Parameters:
  • config (dict[str, Any]) – Processing configuration.

  • target_date – Date to process.

  • method_used (str) – Method label included in output filenames.

  • output_path_fig (str | None) – Diagnostic figure path.

Returns:

Paths and processing metadata.

Return type:

dict[str, Any]