Note
Go to the end to download the full example code.
Re-projecting from CAR to CEA#
The sunkit_magex.pfss
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 sunkit_magex.pfss.utils.car_to_cea
function to
reproject a CAR projection to a CEA projection that sunkit_magex.pfss
can take as input.
import matplotlib.pyplot as plt
from sunkit_magex import pfss
Load a sample ADAPT map, which has a CAR projection.
adapt_maps = pfss.utils.load_adapt(pfss.sample_data.get_adapt_map())
adapt_map_car = adapt_maps[0]
Re-project into a CEA projection.
adapt_map_cea = pfss.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/sunkit-magex/conda/latest/lib/python3.10/site-packages/sunpy/map/mapbase.py:633: SunpyMetadataWarning: Missing metadata for observer: assuming Earth-based observer.
For frame 'heliographic_stonyhurst' the following metadata is missing: hgln_obs,dsun_obs,hglt_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 0.889 seconds)