API Reference

Note

This section documents the main API of the sft2d package.

Top-level functions exposed by sft2d/__init__.py:

sft2d.calculate_advection(field, ...)

Computes the advection of the magnetic field due to differential rotation and meridional flow.

sft2d.calculate_diffusion(field, ...)

Computes the diffusion of the magnetic field using a second-order central difference scheme.

sft2d.calculate_time_step(grid, diffusivity)

Calculates the maximum allowable time step based on the CFL condition for advection and diffusion.

sft2d.create_grid(n_theta, n_phi[, ...])

Creates a uniform grid in spherical polar coordinates (theta, phi).

sft2d.initialize_field(grid[, field_type])

Creates initial condition based on user choice (Dipole/Read from fits file).

sft2d.meridional_flow(grid[, peak_speed])

Creates meridional circulation profile based on the solar latitude.

sft2d.differential_rotation(grid[, ...])

Creates differential rotation profile based on the solar latitude.

sft2d.calculate_usflx(all_br_data, grid, ...)

Calculates the total unsigned magnetic flux of the surface magnetic fields for a given time duration.

sft2d.calculate_dm(all_br_data, grid, ...)

Calculates the axial dipole moment for a given time duration.

sft2d.calculate_polar_field(all_br_data, ...)

Calculates the polar magnetic flux for a given time duration.

sft2d.calculate_polar_flux(all_br_data, ...)

Compute the total polar flux in Maxwell (Mx) near the polar caps (20-degree extent).

sft2d.plot_bfly(bfly_sft, grid[, bmax, ...])

Plots the butterfly diagram of the surface magnetic field.

sft2d.plot_mag(b_data, grid[, bmax, ...])

Plots the magnetic field strength at the solar surface.