Note
Go to the end to download the full example code
Re-projecting from CAR to CEA¶
The pfsspy solver takes a cylindrical-equal-area (CEA) projected magnetic field map as input, which is equally spaced in sin(latitude). Some synoptic field maps are equally spaced in latitude, a plate carée (CAR) projection, and need reprojecting.
This example shows how to use the pfsspy.utils.car_to_cea
function to
reproject a CAR projection to a CEA projection that pfsspy can take as input.
import matplotlib.pyplot as plt
from pfsspy import sample_data, utils
Load a sample ADAPT map, which has a CAR projection
adapt_maps = utils.load_adapt(sample_data.get_adapt_map())
adapt_map_car = adapt_maps[0]
Files Downloaded: 0%| | 0/1 [00:00<?, ?file/s]
pfsspy.adapt40311_03k012_202001010000_i00005600n1.fts.gz: 0%| | 0.00/3.11M [00:00<?, ?B/s]
pfsspy.adapt40311_03k012_202001010000_i00005600n1.fts.gz: 0%| | 2.00/3.11M [00:00<55:44:40, 15.5B/s]
pfsspy.adapt40311_03k012_202001010000_i00005600n1.fts.gz: 15%|█▍ | 464k/3.11M [00:00<00:01, 2.18MB/s]
pfsspy.adapt40311_03k012_202001010000_i00005600n1.fts.gz: 97%|█████████▋| 3.01M/3.11M [00:00<00:00, 11.5MB/s]
Files Downloaded: 100%|██████████| 1/1 [00:00<00:00, 2.06file/s]
Files Downloaded: 100%|██████████| 1/1 [00:00<00:00, 2.06file/s]
Re-project into a CEA projection
adapt_map_cea = utils.car_to_cea(adapt_map_car)
INFO: Missing metadata for solar radius: assuming the standard radius of the photosphere. [sunpy.map.mapbase]
/home/docs/checkouts/readthedocs.org/user_builds/pfsspy/envs/stable/lib/python3.10/site-packages/sunpy/map/mapbase.py:628: SunpyMetadataWarning: Missing metadata for observer: assuming Earth-based observer.
For frame 'heliographic_stonyhurst' the following metadata is missing: hglt_obs,hgln_obs,dsun_obs
For frame 'heliographic_carrington' the following metadata is missing: crln_obs,dsun_obs,crlt_obs
obs_coord = self.observer_coordinate
Plot the original map and the reprojected map
plt.figure()
adapt_map_car.plot()
plt.figure()
adapt_map_cea.plot()
plt.show()
Total running time of the script: (0 minutes 1.710 seconds)