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 however, which is a plate carée (CAR) projection.

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.

from pfsspy import sample_data
from pfsspy import utils
import matplotlib.pyplot as plt

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]

Out:

Files Downloaded:   0%|          | 0/1 [00:00<?, ?file/s]

adapt40311_03k012_202001010000_i00005600n1.fts.gz:   0%|          | 0.00/3.11M [00:00<?, ?B/s]

adapt40311_03k012_202001010000_i00005600n1.fts.gz:   0%|          | 100/3.11M [00:00<1:36:41, 535B/s]

adapt40311_03k012_202001010000_i00005600n1.fts.gz:   8%|8         | 249k/3.11M [00:00<1:02:16, 765B/s]

adapt40311_03k012_202001010000_i00005600n1.fts.gz:  22%|##2       | 690k/3.11M [00:00<36:51, 1.09kB/s]

adapt40311_03k012_202001010000_i00005600n1.fts.gz:  33%|###2      | 1.02M/3.11M [00:00<22:14, 1.56kB/s]

adapt40311_03k012_202001010000_i00005600n1.fts.gz:  47%|####6     | 1.45M/3.11M [00:00<12:22, 2.23kB/s]

adapt40311_03k012_202001010000_i00005600n1.fts.gz:  64%|######3   | 1.98M/3.11M [00:00<05:54, 3.18kB/s]

adapt40311_03k012_202001010000_i00005600n1.fts.gz:  86%|########6 | 2.68M/3.11M [00:00<01:32, 4.55kB/s]
Files Downloaded: 100%|##########| 1/1 [00:01<00:00,  1.12s/file]
Files Downloaded: 100%|##########| 1/1 [00:01<00:00,  1.12s/file]

Re-project into a CEA projection

adapt_map_cea = utils.car_to_cea(adapt_map_car)

Out:

/home/docs/checkouts/readthedocs.org/user_builds/pfsspy/envs/0.6.1/lib/python3.7/site-packages/sunpy/map/mapbase.py:838: SunpyUserWarning: Missing metadata for observer: assuming Earth-based observer.

  warnings.warn(warning_message, SunpyUserWarning)
/home/docs/checkouts/readthedocs.org/user_builds/pfsspy/envs/0.6.1/lib/python3.7/site-packages/sunpy/map/mapbase.py:838: SunpyUserWarning: Missing metadata for observer: assuming Earth-based observer.

  warnings.warn(warning_message, SunpyUserWarning)

Plot the original map and the reprojected map

plt.figure()
adapt_map_car.plot()
plt.figure()
adapt_map_cea.plot()

plt.show()
  • $0 \; \mathrm{}$ 2020-01-01 00:00:00
  • $0 \; \mathrm{}$ 2020-01-01 00:00:00

Out:

/home/docs/checkouts/readthedocs.org/user_builds/pfsspy/envs/0.6.1/lib/python3.7/site-packages/sunpy/map/mapbase.py:838: SunpyUserWarning: Missing metadata for observer: assuming Earth-based observer.

  warnings.warn(warning_message, SunpyUserWarning)
/home/docs/checkouts/readthedocs.org/user_builds/pfsspy/envs/0.6.1/lib/python3.7/site-packages/astropy/wcs/wcs.py:687: FITSFixedWarning: 'datfix' made the change 'Set DATE-REF to '1858-11-17' from MJD-REF'.
  FITSFixedWarning)
/home/docs/checkouts/readthedocs.org/user_builds/pfsspy/envs/0.6.1/lib/python3.7/site-packages/sunpy/map/mapbase.py:838: SunpyUserWarning: Missing metadata for observer: assuming Earth-based observer.

  warnings.warn(warning_message, SunpyUserWarning)

Total running time of the script: ( 0 minutes 4.045 seconds)

Gallery generated by Sphinx-Gallery