Geomagnetic cutoff rigidity#
This notebook demonstrates how to compute the vertical geomagnetic cutoff rigidity at a given geographic location by backtracing charged particles through the geomagnetic field.
The key idea is to perform backtracing of charged particles in a realistic geomagnetic field model (IGRF). For a given geographic location and a set of trial rigidities, each trajectory is classified as:
allowed (the particle can reach the location from outside the magnetosphere), or
forbidden (the particle is blocked/trapped and does not reach the location from outside).
This allowed/forbidden pattern as a function of rigidity is often called a cutoff barcode, and the transition region is the penumbra.
Workflow overview:
Define the magnetospheric magnetic field model (IGRF) and basic simulation parameters.
For a grid of rigidities, launch backtraced trajectories and classify them as “allowed” or “forbidden” based on the exit/termination condition (a rigidity “barcode”).
Derive penumbra parameters from the barcode:
R_min,R_eff,R_max.Build a global map of effective cutoff rigidity using a coarse scan and then refine it locally.
Expected output:
A barcode (allowed/forbidden vs rigidity) for a chosen point (Moscow in this example), with values of
R_min,R_eff,R_maxin GV.A coarse and a refined world map of
R_effon a latitude/longitude grid.
from datetime import datetime
import matplotlib.pyplot as plt
import numpy as np
from gtsimulation.pusher import BunemanBorisSimulator
from gtsimulation.common import Regions, Units
from gtsimulation.magnetic_field.magnetosphere import Gauss
from gtsimulation.particle import generator, Flux
Simulation settings: field model and integration parameters#
Here we define the global simulation configuration used throughout the notebook:
date and region settings for the magnetospheric field model,
the IGRF model configuration (core field, specific version),
integration time step and total integration time,
geometric break conditions (e.g., stop when reaching
R_minorR_max),output settings (
save) to store only the trajectory coordinates (to keep outputs lightweight).
Expected outcome: a consistent setup that can be reused to compute a rigidity “barcode” for many rigidities and locations.
date = datetime(2025, 1, 1)
region = Regions.Magnetosphere
b_field = Gauss(model="IGRF", version=14, model_type="core", date=date)
medium = None
use_decay = False
nuclear_interaction = None
total_time = 5 # total time [s]
dt = 1e-3 # time step [s]
n_steps = int(total_time / dt)
break_conditions = {"Rmin": 1 * Units.RE, "Rmax": 30 * Units.RE}
save = [1, {"Coordinates": True, "Velocities": False}]
output = None
verbose = 0
Vertical rigidity barcode for a single location (Moscow example)#
This section computes a vertical cutoff barcode for a chosen site:
convert geodetic coordinates (lon/lat/alt) to geocentric Cartesian coordinates,
build a set of particles with different rigidities but identical initial position and vertical direction,
backtrace trajectories and label each rigidity as “allowed” or “forbidden” based on the termination code.
Expected output:
a boolean array (barcode) over rigidity,
numerical estimates of
R_min,R_eff,R_max,a 1D barcode plot with these values marked.
from pyproj import Transformer
lla_to_geo = Transformer.from_crs(
{"proj": "longlat", "ellps": "WGS84"},
{"proj": "geocent", "ellps": "WGS84"}
)
def get_vertical_barcode(lon, lat, alt, rigidity_array):
r = lla_to_geo.transform(lon, lat, alt * 1e3, radians=False)
v = np.array([
np.cos(np.deg2rad(lon)) * np.cos(np.deg2rad(lat)),
np.sin(np.deg2rad(lon)) * np.cos(np.deg2rad(lat)),
np.sin(np.deg2rad(lat))
])
energy_array = np.sqrt((rigidity_array * 1e3) ** 2 + 938.7 ** 2) - 938.7
particle = Flux(
Spectrum=generator.spectrum.UserInput(energy=energy_array * Units.MeV),
Distribution=generator.distribution.UserInput(
R0=np.tile(r, (rigidity_array.size, 1)),
V0=np.tile(v, (rigidity_array.size, 1))
),
Names="anti_proton",
Nevents=rigidity_array.size
)
simulator = BunemanBorisSimulator(
Bfield=b_field,
Region=region,
Medium=medium,
Particles=particle,
InteractNUC=nuclear_interaction,
UseDecay=use_decay,
Date=date,
Step=dt,
Num=n_steps,
BreakCondition=break_conditions,
Save=save,
Output=output,
Verbose=verbose
)
track_list = simulator()[0]
barcode = np.array([track["BC"]["WOut"] == 8 for track in track_list])
return barcode
rigidity_array = np.arange(1.6, 2.801, 0.002)
barcode = get_vertical_barcode(37.32, 55.47, 20, rigidity_array)
def bin_edges_from_centers(x):
e = np.empty(x.size + 1, dtype=x.dtype)
e[1:-1] = (x[:-1] + x[1:]) / 2
e[0] = x[0] - (x[1] - x[0]) / 2
e[-1] = x[-1] + (x[-1] - x[-2]) / 2
return e
def get_penumbra_parameters(rigidity_array, barcode):
rigidity_edges = bin_edges_from_centers(rigidity_array)
if np.all(barcode):
return rigidity_edges[0], rigidity_edges[0], rigidity_edges[0]
if np.all(~barcode):
return rigidity_edges[-1], rigidity_edges[-1], rigidity_edges[-1]
idx_true = np.flatnonzero(barcode)
i_min = idx_true[0]
r_min = rigidity_edges[i_min]
idx_false = np.flatnonzero(~barcode)
i_max = idx_false[-1]
r_max = rigidity_edges[i_max + 1]
widths = rigidity_edges[i_min + 1 : i_max + 2] - rigidity_edges[i_min : i_max + 1]
allowed_width = widths[barcode[i_min : i_max + 1]].sum()
r_eff = r_max - allowed_width
return r_min, r_eff, r_max
r_min, r_eff, r_max = get_penumbra_parameters(rigidity_array, barcode)
print('R_min =', r_min, 'GV')
print('R_eff =', r_eff, 'GV')
print('R_max =', r_max, 'GV')
R_min = 1.9310000000000005 GV
R_eff = 2.103000000000002 GV
R_max = 2.2810000000000006 GV
fig = plt.figure(figsize=(10, 1))
ax = fig.subplots()
rigidity_edges = bin_edges_from_centers(rigidity_array)
ax.pcolormesh(rigidity_edges, np.array([0, 1]), np.array(barcode)[np.newaxis, :], cmap='binary_r', vmin=0, vmax=1)
ax.plot([r_min, r_min], [0, 1], 'r')
ax.plot([r_max, r_max], [0, 1], 'r')
ax.plot([r_eff, r_eff], [0, 1], 'b')
ax.set_yticks([])
ax.set_xlabel('Rigidity [GV]')
plt.show()
Effective cutoff rigidity map (global scan)#
This part demonstrates how to build a global map of the effective vertical cutoff rigidity R_eff:
define a latitude/longitude grid,
compute the barcode and
R_effat each grid node,visualize results on a world map projection.
Expected output: a world map of R_eff (in GV), showing higher cutoffs near the equator and lower cutoffs toward the poles.
# !pip install joblib tqdm_joblib cartopy
from joblib import Parallel, delayed
from tqdm_joblib import tqdm_joblib
import cartopy.crs as ccrs
from mpl_toolkits.axes_grid1 import make_axes_locatable
/home/rustam/Software/GTsimulation/.venv/lib/python3.14/site-packages/tqdm_joblib/__init__.py:4: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from tqdm.autonotebook import tqdm
lon_grid = np.arange(-180, 161, 20)
lat_grid = np.arange(-70, 71, 10)
r_grid = np.empty((lat_grid.size, lon_grid.size))
Coarse map: fast scan on a wide rigidity grid#
To get a quick global overview, we compute R_eff on a coarse rigidity grid (here 0.5 GV step).
With such a step, fine penumbra structure is typically not resolved, but the result is sufficient to estimate typical cutoff levels at different locations.
To reduce runtime, the computation is parallelized over grid points.
Expected output: a coarse global map of R_eff.
rigidity_array = np.arange(0.5, 19.51, 0.5)
def worker(i_lon, i_lat):
barcode = get_vertical_barcode(lon_grid[i_lon], lat_grid[i_lat], 400, rigidity_array)
_, r_eff, _ = get_penumbra_parameters(rigidity_array, barcode)
return i_lon, i_lat, r_eff
tasks = [(i, j) for i in range(lon_grid.size) for j in range(lat_grid.size)]
with tqdm_joblib(total=len(tasks)):
res = Parallel(n_jobs=-1)(delayed(worker)(i, j) for i, j in tasks)
for i_lon, i_lat, v in res:
r_grid[i_lat, i_lon] = v
0%| | 0/270 [00:00<?, ?it/s]
0%|▋ | 1/270 [00:10<46:06, 10.28s/it]
1%|█▎ | 2/270 [00:10<19:24, 4.34s/it]
1%|██▋ | 4/270 [00:10<07:27, 1.68s/it]
3%|████▋ | 7/270 [00:10<03:22, 1.30it/s]
3%|██████ | 9/270 [00:11<02:17, 1.89it/s]
4%|███████▎ | 11/270 [00:11<01:44, 2.47it/s]
5%|████████▋ | 13/270 [00:12<01:34, 2.72it/s]
6%|██████████ | 15/270 [00:12<01:11, 3.58it/s]
6%|███████████▎ | 17/270 [00:12<00:54, 4.66it/s]
7%|█████████████▎ | 20/270 [00:12<00:37, 6.74it/s]
8%|██████████████▋ | 22/270 [00:12<00:35, 7.00it/s]
9%|████████████████▋ | 25/270 [00:12<00:25, 9.56it/s]
10%|██████████████████ | 27/270 [00:13<00:37, 6.52it/s]
11%|███████████████████▎ | 29/270 [00:13<00:37, 6.49it/s]
11%|████████████████████▋ | 31/270 [00:13<00:31, 7.62it/s]
12%|██████████████████████ | 33/270 [00:13<00:25, 9.24it/s]
13%|███████████████████████▎ | 35/270 [00:14<00:24, 9.71it/s]
14%|█████████████████████████▉ | 39/270 [00:14<00:16, 13.70it/s]
15%|███████████████████████████▎ | 41/270 [00:14<00:28, 8.04it/s]
16%|████████████████████████████▋ | 43/270 [00:15<00:27, 8.40it/s]
17%|██████████████████████████████ | 45/270 [00:15<00:25, 8.91it/s]
17%|███████████████████████████████▎ | 47/270 [00:15<00:22, 9.82it/s]
18%|████████████████████████████████▋ | 49/270 [00:15<00:23, 9.46it/s]
19%|██████████████████████████████████▋ | 52/270 [00:15<00:19, 11.35it/s]
20%|████████████████████████████████████ | 54/270 [00:16<00:18, 11.56it/s]
21%|█████████████████████████████████████▎ | 56/270 [00:16<00:27, 7.67it/s]
21%|██████████████████████████████████████▋ | 58/270 [00:16<00:28, 7.50it/s]
22%|████████████████████████████████████████ | 60/270 [00:16<00:26, 8.04it/s]
23%|██████████████████████████████████████████ | 63/270 [00:17<00:20, 10.34it/s]
24%|███████████████████████████████████████████▎ | 65/270 [00:17<00:18, 11.21it/s]
25%|████████████████████████████████████████████▋ | 67/270 [00:17<00:16, 12.32it/s]
26%|██████████████████████████████████████████████ | 69/270 [00:17<00:16, 12.53it/s]
26%|███████████████████████████████████████████████▎ | 71/270 [00:18<00:35, 5.68it/s]
27%|████████████████████████████████████████████████▋ | 73/270 [00:18<00:27, 7.06it/s]
29%|███████████████████████████████████████████████████▎ | 77/270 [00:18<00:20, 9.31it/s]
29%|████████████████████████████████████████████████████▋ | 79/270 [00:18<00:19, 9.67it/s]
30%|██████████████████████████████████████████████████████▋ | 82/270 [00:19<00:17, 10.82it/s]
31%|████████████████████████████████████████████████████████ | 84/270 [00:19<00:19, 9.59it/s]
32%|█████████████████████████████████████████████████████████▎ | 86/270 [00:19<00:23, 7.75it/s]
32%|██████████████████████████████████████████████████████████ | 87/270 [00:20<00:31, 5.72it/s]
34%|████████████████████████████████████████████████████████████▋ | 91/270 [00:20<00:18, 9.44it/s]
35%|██████████████████████████████████████████████████████████████▋ | 94/270 [00:20<00:16, 10.87it/s]
36%|████████████████████████████████████████████████████████████████ | 96/270 [00:20<00:16, 10.85it/s]
36%|█████████████████████████████████████████████████████████████████▎ | 98/270 [00:21<00:19, 8.84it/s]
37%|██████████████████████████████████████████████████████████████████▎ | 100/270 [00:21<00:30, 5.49it/s]
38%|████████████████████████████████████████████████████████████████████▎ | 103/270 [00:22<00:22, 7.33it/s]
39%|█████████████████████████████████████████████████████████████████████▌ | 105/270 [00:22<00:19, 8.65it/s]
40%|██████████████████████████████████████████████████████████████████████▉ | 107/270 [00:22<00:19, 8.49it/s]
40%|████████████████████████████████████████████████████████████████████████▎ | 109/270 [00:22<00:18, 8.79it/s]
41%|█████████████████████████████████████████████████████████████████████████▌ | 111/270 [00:22<00:17, 9.33it/s]
42%|██████████████████████████████████████████████████████████████████████████▉ | 113/270 [00:22<00:14, 10.71it/s]
43%|████████████████████████████████████████████████████████████████████████████▏ | 115/270 [00:23<00:16, 9.16it/s]
43%|█████████████████████████████████████████████████████████████████████████████▌ | 117/270 [00:23<00:24, 6.22it/s]
44%|██████████████████████████████████████████████████████████████████████████████▏ | 118/270 [00:24<00:27, 5.46it/s]
44%|███████████████████████████████████████████████████████████████████████████████▌ | 120/270 [00:24<00:21, 6.84it/s]
46%|█████████████████████████████████████████████████████████████████████████████████▌ | 123/270 [00:24<00:15, 9.47it/s]
46%|██████████████████████████████████████████████████████████████████████████████████▊ | 125/270 [00:24<00:15, 9.40it/s]
47%|████████████████████████████████████████████████████████████████████████████████████▏ | 127/270 [00:24<00:13, 10.36it/s]
48%|██████████████████████████████████████████████████████████████████████████████████████▏ | 130/270 [00:25<00:15, 8.92it/s]
49%|███████████████████████████████████████████████████████████████████████████████████████▌ | 132/270 [00:25<00:19, 7.26it/s]
49%|████████████████████████████████████████████████████████████████████████████████████████▏ | 133/270 [00:25<00:23, 5.75it/s]
50%|█████████████████████████████████████████████████████████████████████████████████████████▌ | 135/270 [00:26<00:22, 6.02it/s]
51%|██████████████████████████████████████████████████████████████████████████████████████████▊ | 137/270 [00:26<00:17, 7.61it/s]
52%|████████████████████████████████████████████████████████████████████████████████████████████▊ | 140/270 [00:26<00:13, 9.32it/s]
53%|██████████████████████████████████████████████████████████████████████████████████████████████▏ | 142/270 [00:26<00:12, 10.56it/s]
53%|███████████████████████████████████████████████████████████████████████████████████████████████▍ | 144/270 [00:26<00:15, 8.30it/s]
54%|████████████████████████████████████████████████████████████████████████████████████████████████▊ | 146/270 [00:27<00:13, 9.28it/s]
55%|██████████████████████████████████████████████████████████████████████████████████████████████████ | 148/270 [00:28<00:25, 4.73it/s]
55%|██████████████████████████████████████████████████████████████████████████████████████████████████▊ | 149/270 [00:28<00:25, 4.81it/s]
56%|████████████████████████████████████████████████████████████████████████████████████████████████████ | 151/270 [00:28<00:21, 5.47it/s]
57%|█████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 153/270 [00:28<00:16, 7.09it/s]
57%|██████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 155/270 [00:28<00:13, 8.77it/s]
58%|████████████████████████████████████████████████████████████████████████████████████████████████████████ | 157/270 [00:29<00:15, 7.27it/s]
59%|█████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 159/270 [00:29<00:14, 7.52it/s]
60%|██████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 161/270 [00:29<00:16, 6.47it/s]
60%|████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 163/270 [00:30<00:22, 4.74it/s]
61%|████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 164/270 [00:30<00:20, 5.21it/s]
61%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 166/270 [00:30<00:15, 6.91it/s]
62%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 168/270 [00:31<00:16, 6.13it/s]
63%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 170/270 [00:31<00:14, 7.12it/s]
63%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 171/270 [00:31<00:17, 5.60it/s]
64%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 173/270 [00:31<00:13, 7.02it/s]
65%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 175/270 [00:32<00:14, 6.46it/s]
66%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 177/270 [00:32<00:11, 7.89it/s]
66%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 179/270 [00:32<00:16, 5.57it/s]
67%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 181/270 [00:33<00:14, 6.19it/s]
68%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 183/270 [00:33<00:14, 5.94it/s]
69%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 186/270 [00:33<00:10, 7.79it/s]
69%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 187/270 [00:33<00:10, 7.78it/s]
70%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 190/270 [00:33<00:07, 10.21it/s]
71%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 192/270 [00:34<00:12, 6.37it/s]
71%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 193/270 [00:34<00:14, 5.33it/s]
72%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 194/270 [00:34<00:13, 5.77it/s]
72%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 195/270 [00:35<00:13, 5.62it/s]
73%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 196/270 [00:35<00:12, 6.07it/s]
73%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 197/270 [00:35<00:11, 6.62it/s]
74%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 199/270 [00:35<00:08, 8.43it/s]
74%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 201/270 [00:35<00:09, 7.34it/s]
75%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 203/270 [00:36<00:08, 8.21it/s]
76%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 204/270 [00:36<00:07, 8.27it/s]
77%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 207/270 [00:36<00:07, 8.31it/s]
77%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 208/270 [00:36<00:08, 7.12it/s]
77%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 209/270 [00:37<00:10, 5.86it/s]
78%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 210/270 [00:37<00:09, 6.43it/s]
79%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 212/270 [00:37<00:06, 8.42it/s]
79%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 214/270 [00:37<00:05, 9.94it/s]
80%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 216/270 [00:37<00:05, 10.76it/s]
81%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 218/270 [00:37<00:05, 9.64it/s]
81%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 220/270 [00:38<00:04, 10.73it/s]
82%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 222/270 [00:38<00:06, 7.34it/s]
83%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 223/270 [00:38<00:08, 5.82it/s]
83%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 224/270 [00:38<00:07, 5.90it/s]
84%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 226/270 [00:39<00:06, 6.83it/s]
84%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 228/270 [00:39<00:05, 8.04it/s]
86%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 231/270 [00:39<00:03, 10.75it/s]
86%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 233/270 [00:39<00:03, 11.22it/s]
87%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 235/270 [00:39<00:02, 12.79it/s]
88%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 237/270 [00:40<00:04, 7.42it/s]
89%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 239/270 [00:40<00:04, 6.66it/s]
89%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 241/270 [00:40<00:03, 7.66it/s]
90%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 244/270 [00:40<00:02, 10.37it/s]
91%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 246/270 [00:41<00:02, 9.96it/s]
92%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 248/270 [00:41<00:02, 10.06it/s]
93%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 251/270 [00:41<00:01, 13.37it/s]
94%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 253/270 [00:42<00:02, 6.85it/s]
94%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 255/270 [00:42<00:02, 7.41it/s]
95%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 257/270 [00:42<00:01, 8.35it/s]
96%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 259/270 [00:42<00:01, 9.35it/s]
97%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 261/270 [00:42<00:01, 8.98it/s]
98%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 265/270 [00:43<00:00, 13.64it/s]
99%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 267/270 [00:43<00:00, 12.52it/s]
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎| 269/270 [00:43<00:00, 9.42it/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 270/270 [00:43<00:00, 6.18it/s]
# add the 180° meridian and copy values from the -180° meridian in order to stitch the map seamlessly
lon_grid = np.hstack((lon_grid, 180))
r_grid = np.pad(r_grid, pad_width=((0, 0), (0, 1)), mode="wrap")
fig = plt.figure(figsize=(8, 4))
ax = plt.axes(projection=ccrs.PlateCarree())
pcm = ax.pcolormesh(lon_grid, lat_grid, r_grid, vmin=0)
ax.set_xlim(-180, 180)
ax.set_ylim(-70, 70)
ax.coastlines(resolution="110m", linewidth=1.0, color="black")
ax.set_xticks(np.arange(-180, 181, 60))
ax.set_yticks(np.arange(-60, 61, 20))
ax.set_xlabel('Longitude [deg]')
ax.set_ylabel('Latitude [deg]')
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="3.5%", pad=0.3, axes_class=plt.Axes)
fig.colorbar(pcm, cax=cax, label="Rigidity [GV]")
plt.show()
Cutoff values are computed at discrete grid nodes.
In the next cell, the map is rendered with linear interpolation (shading="gouraud") to make the visualization smoother.
fig = plt.figure(figsize=(8, 4))
ax = plt.axes(projection=ccrs.PlateCarree())
pcm = ax.pcolormesh(lon_grid, lat_grid, r_grid, shading="gouraud", vmin=0)
ax.set_xlim(-180, 180)
ax.set_ylim(-70, 70)
ax.coastlines(resolution="110m", linewidth=1.0, color="black")
ax.set_xticks(np.arange(-180, 181, 60))
ax.set_yticks(np.arange(-60, 61, 20))
ax.set_xlabel('Longitude [deg]')
ax.set_ylabel('Latitude [deg]')
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="3.5%", pad=0.3, axes_class=plt.Axes)
fig.colorbar(pcm, cax=cax, label="Rigidity [GV]")
plt.show()
Refined map: local scan around the coarse estimate#
This refinement step re-computes R_eff using a finer rigidity step, but only within a narrow interval around the coarse estimate (±1 GV for each grid point).
This approach preserves most of the accuracy benefits while keeping the total runtime manageable.
As before, the computation is parallelized over grid points.
Expected output: a refined global map of R_eff with improved resolution compared to the coarse scan.
# remove the 180° meridian to save computation time
lon_grid = lon_grid[:-1]
r_grid = r_grid[:, :-1]
# copy the previously obtained coarse map
r_grid_base = r_grid.copy()
r_grid = np.zeros_like(r_grid_base)
def worker(i_lon, i_lat):
rigidity_array = np.arange(r_grid_base[i_lat, i_lon] - 1,
r_grid_base[i_lat, i_lon] + 1.01, 0.02)
rigidity_array = rigidity_array[rigidity_array > 0.001]
barcode = get_vertical_barcode(lon_grid[i_lon], lat_grid[i_lat], 400, rigidity_array)
_, r_eff, _ = get_penumbra_parameters(rigidity_array, barcode)
return i_lon, i_lat, r_eff
with tqdm_joblib(total=len(tasks)):
res = Parallel(n_jobs=-1)(delayed(worker)(i, j) for i, j in tasks)
for i_lon, i_lat, v in res:
r_grid[i_lat, i_lon] = v
0%| | 0/270 [00:00<?, ?it/s]
0%|▋ | 1/270 [00:02<10:55, 2.44s/it]
1%|█▎ | 2/270 [00:02<05:04, 1.14s/it]
1%|██ | 3/270 [00:02<03:05, 1.44it/s]
1%|██▋ | 4/270 [00:03<02:20, 1.89it/s]
2%|████ | 6/270 [00:03<01:18, 3.38it/s]
3%|████▋ | 7/270 [00:03<01:05, 3.99it/s]
3%|█████▎ | 8/270 [00:04<01:37, 2.68it/s]
3%|██████ | 9/270 [00:07<05:00, 1.15s/it]
4%|██████▋ | 10/270 [00:07<03:45, 1.16it/s]
4%|███████▎ | 11/270 [00:09<04:45, 1.10s/it]
5%|████████▋ | 13/270 [00:09<03:14, 1.32it/s]
5%|█████████▎ | 14/270 [00:10<02:59, 1.42it/s]
6%|██████████ | 15/270 [00:10<02:56, 1.44it/s]
6%|██████████▋ | 16/270 [00:11<02:19, 1.83it/s]
6%|███████████▎ | 17/270 [00:11<01:51, 2.26it/s]
7%|████████████ | 18/270 [00:11<01:27, 2.86it/s]
7%|████████████▋ | 19/270 [00:11<01:43, 2.42it/s]
7%|█████████████▎ | 20/270 [00:12<01:44, 2.38it/s]
8%|██████████████▋ | 22/270 [00:12<01:17, 3.19it/s]
9%|███████████████▎ | 23/270 [00:13<01:32, 2.66it/s]
9%|████████████████ | 24/270 [00:14<02:06, 1.94it/s]
9%|████████████████▋ | 25/270 [00:15<02:33, 1.60it/s]
10%|█████████████████▎ | 26/270 [00:15<02:44, 1.48it/s]
10%|██████████████████ | 27/270 [00:16<02:36, 1.55it/s]
11%|███████████████████▎ | 29/270 [00:17<02:04, 1.93it/s]
11%|████████████████████ | 30/270 [00:17<01:40, 2.38it/s]
11%|████████████████████▋ | 31/270 [00:17<01:37, 2.45it/s]
12%|█████████████████████▎ | 32/270 [00:18<02:03, 1.93it/s]
12%|██████████████████████ | 33/270 [00:18<01:53, 2.09it/s]
13%|██████████████████████▋ | 34/270 [00:19<01:51, 2.11it/s]
13%|███████████████████████▎ | 35/270 [00:19<01:44, 2.24it/s]
13%|████████████████████████ | 36/270 [00:19<01:25, 2.73it/s]
14%|████████████████████████▋ | 37/270 [00:20<01:15, 3.10it/s]
14%|█████████████████████████▎ | 38/270 [00:20<01:26, 2.68it/s]
14%|█████████████████████████▉ | 39/270 [00:23<03:43, 1.03it/s]
15%|███████████████████████████▎ | 41/270 [00:23<02:26, 1.57it/s]
16%|████████████████████████████ | 42/270 [00:23<02:01, 1.88it/s]
16%|████████████████████████████▋ | 43/270 [00:24<02:37, 1.44it/s]
16%|█████████████████████████████▎ | 44/270 [00:25<02:18, 1.63it/s]
17%|██████████████████████████████ | 45/270 [00:25<01:54, 1.97it/s]
17%|██████████████████████████████▋ | 46/270 [00:25<01:48, 2.06it/s]
17%|███████████████████████████████▎ | 47/270 [00:26<01:36, 2.30it/s]
18%|████████████████████████████████▋ | 49/270 [00:26<00:59, 3.71it/s]
19%|█████████████████████████████████▎ | 50/270 [00:26<00:57, 3.79it/s]
19%|██████████████████████████████████ | 51/270 [00:28<02:09, 1.69it/s]
19%|██████████████████████████████████▋ | 52/270 [00:28<02:00, 1.80it/s]
20%|███████████████████████████████████▎ | 53/270 [00:29<02:41, 1.34it/s]
20%|████████████████████████████████████ | 54/270 [00:30<03:03, 1.18it/s]
21%|█████████████████████████████████████▎ | 56/270 [00:32<02:33, 1.39it/s]
21%|██████████████████████████████████████ | 57/270 [00:32<02:27, 1.44it/s]
21%|██████████████████████████████████████▋ | 58/270 [00:33<02:09, 1.64it/s]
22%|███████████████████████████████████████▎ | 59/270 [00:33<01:40, 2.09it/s]
22%|████████████████████████████████████████ | 60/270 [00:33<01:23, 2.50it/s]
23%|█████████████████████████████████████████▎ | 62/270 [00:33<00:54, 3.82it/s]
23%|██████████████████████████████████████████ | 63/270 [00:33<00:55, 3.74it/s]
24%|██████████████████████████████████████████▋ | 64/270 [00:34<01:37, 2.11it/s]
24%|███████████████████████████████████████████▎ | 65/270 [00:35<01:27, 2.34it/s]
24%|████████████████████████████████████████████ | 66/270 [00:35<01:37, 2.09it/s]
25%|████████████████████████████████████████████▋ | 67/270 [00:36<01:28, 2.30it/s]
25%|█████████████████████████████████████████████▎ | 68/270 [00:37<02:13, 1.51it/s]
26%|██████████████████████████████████████████████ | 69/270 [00:38<02:59, 1.12it/s]
26%|███████████████████████████████████████████████▎ | 71/270 [00:39<01:46, 1.87it/s]
27%|████████████████████████████████████████████████ | 72/270 [00:39<01:55, 1.72it/s]
27%|████████████████████████████████████████████████▋ | 73/270 [00:40<01:38, 2.00it/s]
28%|██████████████████████████████████████████████████ | 75/270 [00:41<01:43, 1.88it/s]
29%|███████████████████████████████████████████████████▎ | 77/270 [00:41<01:19, 2.42it/s]
29%|███████████████████████████████████████████████████▉ | 78/270 [00:42<01:19, 2.41it/s]
29%|████████████████████████████████████████████████████▋ | 79/270 [00:42<01:21, 2.34it/s]
30%|█████████████████████████████████████████████████████▎ | 80/270 [00:42<01:15, 2.52it/s]
30%|██████████████████████████████████████████████████████ | 81/270 [00:43<01:29, 2.12it/s]
31%|███████████████████████████████████████████████████████▎ | 83/270 [00:45<01:54, 1.64it/s]
31%|████████████████████████████████████████████████████████ | 84/270 [00:45<01:39, 1.87it/s]
32%|█████████████████████████████████████████████████████████▎ | 86/270 [00:47<02:04, 1.48it/s]
32%|██████████████████████████████████████████████████████████ | 87/270 [00:47<01:45, 1.74it/s]
33%|██████████████████████████████████████████████████████████▋ | 88/270 [00:48<01:58, 1.54it/s]
33%|███████████████████████████████████████████████████████████▎ | 89/270 [00:48<01:39, 1.81it/s]
33%|████████████████████████████████████████████████████████████ | 90/270 [00:48<01:17, 2.31it/s]
34%|████████████████████████████████████████████████████████████▋ | 91/270 [00:49<01:15, 2.37it/s]
34%|██████████████████████████████████████████████████████████████ | 93/270 [00:49<00:48, 3.64it/s]
35%|██████████████████████████████████████████████████████████████▋ | 94/270 [00:49<00:59, 2.94it/s]
36%|████████████████████████████████████████████████████████████████ | 96/270 [00:50<00:49, 3.50it/s]
36%|████████████████████████████████████████████████████████████████▋ | 97/270 [00:51<01:15, 2.29it/s]
36%|█████████████████████████████████████████████████████████████████▎ | 98/270 [00:51<01:27, 1.96it/s]
37%|██████████████████████████████████████████████████████████████████ | 99/270 [00:53<02:08, 1.33it/s]
37%|██████████████████████████████████████████████████████████████████▎ | 100/270 [00:53<01:42, 1.65it/s]
37%|██████████████████████████████████████████████████████████████████▉ | 101/270 [00:55<02:59, 1.06s/it]
38%|███████████████████████████████████████████████████████████████████▌ | 102/270 [00:56<02:35, 1.08it/s]
39%|██████████████████████████████████████████████████████████████████████▎ | 106/270 [00:56<01:06, 2.46it/s]
40%|██████████████████████████████████████████████████████████████████████▉ | 107/270 [00:56<01:02, 2.62it/s]
40%|███████████████████████████████████████████████████████████████████████▌ | 108/270 [00:57<00:59, 2.72it/s]
40%|████████████████████████████████████████████████████████████████████████▎ | 109/270 [00:57<01:10, 2.27it/s]
41%|████████████████████████████████████████████████████████████████████████▉ | 110/270 [00:58<01:23, 1.92it/s]
41%|█████████████████████████████████████████████████████████████████████████▌ | 111/270 [00:58<01:08, 2.31it/s]
41%|██████████████████████████████████████████████████████████████████████████▎ | 112/270 [00:59<01:03, 2.49it/s]
42%|██████████████████████████████████████████████████████████████████████████▉ | 113/270 [00:59<01:13, 2.13it/s]
42%|███████████████████████████████████████████████████████████████████████████▌ | 114/270 [01:00<01:37, 1.60it/s]
43%|████████████████████████████████████████████████████████████████████████████▏ | 115/270 [01:01<01:37, 1.59it/s]
43%|████████████████████████████████████████████████████████████████████████████▉ | 116/270 [01:01<01:21, 1.88it/s]
43%|█████████████████████████████████████████████████████████████████████████████▌ | 117/270 [01:02<01:40, 1.52it/s]
44%|██████████████████████████████████████████████████████████████████████████████▏ | 118/270 [01:04<02:14, 1.13it/s]
44%|██████████████████████████████████████████████████████████████████████████████▉ | 119/270 [01:04<01:47, 1.40it/s]
44%|███████████████████████████████████████████████████████████████████████████████▌ | 120/270 [01:04<01:22, 1.82it/s]
45%|████████████████████████████████████████████████████████████████████████████████▏ | 121/270 [01:04<01:10, 2.11it/s]
45%|████████████████████████████████████████████████████████████████████████████████▉ | 122/270 [01:05<00:54, 2.74it/s]
46%|██████████████████████████████████████████████████████████████████████████████████▏ | 124/270 [01:05<00:33, 4.33it/s]
46%|██████████████████████████████████████████████████████████████████████████████████▊ | 125/270 [01:07<01:50, 1.31it/s]
47%|███████████████████████████████████████████████████████████████████████████████████▌ | 126/270 [01:08<01:48, 1.33it/s]
47%|████████████████████████████████████████████████████████████████████████████████████▏ | 127/270 [01:08<01:27, 1.63it/s]
47%|████████████████████████████████████████████████████████████████████████████████████▊ | 128/270 [01:08<01:17, 1.84it/s]
48%|██████████████████████████████████████████████████████████████████████████████████████▏ | 130/270 [01:09<00:52, 2.66it/s]
49%|██████████████████████████████████████████████████████████████████████████████████████▊ | 131/270 [01:10<01:22, 1.69it/s]
49%|███████████████████████████████████████████████████████████████████████████████████████▌ | 132/270 [01:11<01:44, 1.32it/s]
49%|████████████████████████████████████████████████████████████████████████████████████████▏ | 133/270 [01:11<01:20, 1.71it/s]
50%|████████████████████████████████████████████████████████████████████████████████████████▊ | 134/270 [01:12<01:24, 1.61it/s]
50%|█████████████████████████████████████████████████████████████████████████████████████████▌ | 135/270 [01:12<01:08, 1.98it/s]
51%|██████████████████████████████████████████████████████████████████████████████████████████▊ | 137/270 [01:13<00:54, 2.42it/s]
51%|███████████████████████████████████████████████████████████████████████████████████████████▍ | 138/270 [01:14<01:12, 1.81it/s]
51%|████████████████████████████████████████████████████████████████████████████████████████████▏ | 139/270 [01:14<00:58, 2.23it/s]
52%|████████████████████████████████████████████████████████████████████████████████████████████▊ | 140/270 [01:15<01:12, 1.78it/s]
52%|█████████████████████████████████████████████████████████████████████████████████████████████▍ | 141/270 [01:16<01:16, 1.68it/s]
53%|██████████████████████████████████████████████████████████████████████████████████████████████▏ | 142/270 [01:16<01:20, 1.58it/s]
53%|██████████████████████████████████████████████████████████████████████████████████████████████▊ | 143/270 [01:17<01:35, 1.34it/s]
53%|███████████████████████████████████████████████████████████████████████████████████████████████▍ | 144/270 [01:18<01:33, 1.35it/s]
54%|████████████████████████████████████████████████████████████████████████████████████████████████▊ | 146/270 [01:20<01:36, 1.29it/s]
54%|█████████████████████████████████████████████████████████████████████████████████████████████████▍ | 147/270 [01:21<01:41, 1.21it/s]
55%|██████████████████████████████████████████████████████████████████████████████████████████████████ | 148/270 [01:21<01:25, 1.43it/s]
56%|███████████████████████████████████████████████████████████████████████████████████████████████████▍ | 150/270 [01:21<00:55, 2.15it/s]
56%|████████████████████████████████████████████████████████████████████████████████████████████████████ | 151/270 [01:22<01:10, 1.68it/s]
56%|████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 152/270 [01:23<01:01, 1.93it/s]
57%|██████████████████████████████████████████████████████████████████████████████████████████████████████ | 154/270 [01:23<00:43, 2.64it/s]
57%|██████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 155/270 [01:24<00:49, 2.34it/s]
58%|███████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 156/270 [01:24<00:58, 1.94it/s]
58%|████████████████████████████████████████████████████████████████████████████████████████████████████████ | 157/270 [01:25<00:58, 1.92it/s]
59%|████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 158/270 [01:25<00:52, 2.12it/s]
59%|█████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 159/270 [01:26<00:56, 1.97it/s]
59%|██████████████████████████████████████████████████████████████████████████████████████████████████████████ | 160/270 [01:26<00:55, 1.99it/s]
60%|██████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 161/270 [01:27<01:02, 1.76it/s]
60%|███████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 162/270 [01:29<01:40, 1.07it/s]
61%|████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 164/270 [01:29<01:07, 1.56it/s]
61%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 165/270 [01:30<00:54, 1.91it/s]
62%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 167/270 [01:31<00:50, 2.06it/s]
62%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 168/270 [01:32<01:09, 1.47it/s]
63%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 169/270 [01:32<00:56, 1.78it/s]
63%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 170/270 [01:32<00:44, 2.25it/s]
64%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 172/270 [01:33<00:35, 2.76it/s]
64%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 173/270 [01:34<01:02, 1.55it/s]
64%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 174/270 [01:36<01:34, 1.02it/s]
65%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 175/270 [01:36<01:15, 1.27it/s]
65%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 176/270 [01:38<01:26, 1.08it/s]
66%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 177/270 [01:39<01:24, 1.10it/s]
66%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 178/270 [01:39<01:03, 1.44it/s]
66%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 179/270 [01:39<00:55, 1.65it/s]
67%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 181/270 [01:39<00:34, 2.56it/s]
67%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 182/270 [01:40<00:37, 2.37it/s]
68%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 183/270 [01:40<00:30, 2.85it/s]
68%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 184/270 [01:41<00:44, 1.92it/s]
69%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 185/270 [01:41<00:36, 2.31it/s]
69%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 186/270 [01:42<00:38, 2.19it/s]
70%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 188/270 [01:42<00:28, 2.90it/s]
70%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 189/270 [01:43<00:36, 2.21it/s]
71%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 191/270 [01:44<00:31, 2.51it/s]
71%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 192/270 [01:45<00:54, 1.43it/s]
71%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 193/270 [01:46<00:49, 1.55it/s]
72%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 194/270 [01:46<00:43, 1.76it/s]
72%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 195/270 [01:47<00:40, 1.85it/s]
73%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 196/270 [01:47<00:36, 2.05it/s]
73%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 198/270 [01:48<00:33, 2.15it/s]
74%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 199/270 [01:48<00:31, 2.24it/s]
74%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 201/270 [01:49<00:28, 2.40it/s]
75%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 202/270 [01:49<00:25, 2.70it/s]
75%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 203/270 [01:50<00:24, 2.74it/s]
76%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 204/270 [01:50<00:33, 2.00it/s]
76%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 205/270 [01:53<01:04, 1.01it/s]
77%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 207/270 [01:54<00:46, 1.35it/s]
77%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉ | 208/270 [01:54<00:47, 1.31it/s]
77%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 209/270 [01:55<00:39, 1.55it/s]
78%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 210/270 [01:55<00:36, 1.62it/s]
79%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 212/270 [01:56<00:24, 2.32it/s]
79%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 213/270 [01:56<00:21, 2.69it/s]
80%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 215/270 [01:56<00:17, 3.20it/s]
80%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 216/270 [01:57<00:16, 3.24it/s]
80%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 217/270 [01:57<00:20, 2.65it/s]
81%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 218/270 [01:57<00:16, 3.08it/s]
81%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 219/270 [01:59<00:30, 1.66it/s]
81%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 220/270 [01:59<00:27, 1.82it/s]
82%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 221/270 [01:59<00:23, 2.07it/s]
82%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 222/270 [02:02<00:47, 1.00it/s]
83%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 224/270 [02:02<00:27, 1.69it/s]
84%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 226/270 [02:02<00:20, 2.14it/s]
84%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 227/270 [02:03<00:18, 2.31it/s]
84%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 228/270 [02:03<00:17, 2.35it/s]
85%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 229/270 [02:04<00:18, 2.20it/s]
85%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 230/270 [02:04<00:17, 2.25it/s]
86%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 232/270 [02:04<00:10, 3.56it/s]
86%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 233/270 [02:05<00:14, 2.63it/s]
87%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏ | 234/270 [02:06<00:18, 1.91it/s]
87%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 235/270 [02:08<00:36, 1.05s/it]
87%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 236/270 [02:09<00:33, 1.01it/s]
88%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 238/270 [02:10<00:19, 1.65it/s]
89%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 239/270 [02:10<00:16, 1.89it/s]
89%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 240/270 [02:11<00:18, 1.62it/s]
89%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 241/270 [02:11<00:17, 1.70it/s]
90%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 243/270 [02:12<00:12, 2.16it/s]
91%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 245/270 [02:12<00:08, 2.83it/s]
92%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 248/270 [02:13<00:08, 2.51it/s]
93%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 250/270 [02:16<00:13, 1.51it/s]
93%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 251/270 [02:16<00:11, 1.66it/s]
93%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 252/270 [02:17<00:10, 1.68it/s]
94%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 253/270 [02:17<00:08, 2.03it/s]
94%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 254/270 [02:18<00:09, 1.71it/s]
94%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 255/270 [02:18<00:07, 1.89it/s]
95%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 256/270 [02:19<00:07, 1.95it/s]
95%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍ | 257/270 [02:19<00:05, 2.22it/s]
96%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 259/270 [02:19<00:03, 3.30it/s]
96%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 260/270 [02:20<00:03, 3.21it/s]
97%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 261/270 [02:20<00:03, 2.39it/s]
97%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 262/270 [02:21<00:03, 2.34it/s]
98%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 264/270 [02:21<00:01, 3.27it/s]
98%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 265/270 [02:22<00:02, 2.03it/s]
99%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 266/270 [02:23<00:01, 2.19it/s]
99%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ | 267/270 [02:23<00:01, 2.51it/s]
99%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋ | 268/270 [02:23<00:00, 2.25it/s]
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎| 269/270 [02:24<00:00, 1.61it/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 270/270 [02:25<00:00, 1.49it/s]
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 270/270 [02:25<00:00, 1.85it/s]
# add the 180° meridian and copy values from the -180° meridian in order to stitch the map seamlessly
lon_grid = np.hstack((lon_grid, 180))
r_grid = np.pad(r_grid, pad_width=((0, 0), (0, 1)), mode="wrap")
fig = plt.figure(figsize=(8, 4))
ax = plt.axes(projection=ccrs.PlateCarree())
pcm = ax.pcolormesh(lon_grid, lat_grid, r_grid, vmin=0)
ax.set_xlim(-180, 180)
ax.set_ylim(-70, 70)
ax.coastlines(resolution="110m", linewidth=1.0, color="black")
ax.set_xticks(np.arange(-180, 181, 60))
ax.set_yticks(np.arange(-60, 61, 20))
ax.set_xlabel('Longitude [deg]')
ax.set_ylabel('Latitude [deg]')
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="3.5%", pad=0.3, axes_class=plt.Axes)
fig.colorbar(pcm, cax=cax, label="Rigidity [GV]")
plt.show()
fig = plt.figure(figsize=(8, 4))
ax = plt.axes(projection=ccrs.PlateCarree())
pcm = ax.pcolormesh(lon_grid, lat_grid, r_grid, shading="gouraud", vmin=0)
ax.set_xlim(-180, 180)
ax.set_ylim(-70, 70)
ax.coastlines(resolution="110m", linewidth=1.0, color="black")
ax.set_xticks(np.arange(-180, 181, 60))
ax.set_yticks(np.arange(-60, 61, 20))
ax.set_xlabel('Longitude [deg]')
ax.set_ylabel('Latitude [deg]')
divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="3.5%", pad=0.2, axes_class=plt.Axes)
fig.colorbar(pcm, cax=cax, label="Rigidity [GV]")
plt.show()
Potential ways to improve accuracy and resolve finer penumbra structure:
Decrease the integration time step (e.g., down to 1e-6 s).
Use a finer rigidity step (e.g., 0.001 GV) in the barcode scan.
Increase the latitude/longitude grid resolution.