def map_reravel(unravelled_maps, params, verbose=False): """ Unravel the maps into a rectangular image. """ reraveled_maps =[] for index, m in enumerate(unravelled_maps): if verbose: print("Unraveling map %(#)i of %(n)i " % {'#':index+1, 'n':len(unravelled_maps)}) reraveled = util.map_hg_to_hpc(m, epi_lon=params.get('epi_lon'), epi_lat=params.get('epi_lat'), xbin=5, ybin=0.2) reraveled[np.isnan(reraveled)]=0.0 reraveled_maps += [reraveled] return reraveled_maps
import sunpy from sunpy.wcs import wcs import util aia = sunpy.Map(sunpy.AIA_171_IMAGE).resample([500,500]) tmap = util.map_hpc_to_hg(aia) tmap.show() tmap_rot = util.map_hpc_to_hg_rotate(aia, epi_lon = 0, epi_lat = 0) tmap_rot.show() # BUG at the edges where the Sun wraps around, HPC to HG gives the same longitude # for points behind and in front of the limb. # no rotation, or put the NP at the NP rotmap = util.map_hpc_to_hg_rotate(aia, epi_lon = 0, epi_lat = 90) # the following command puts a feature at -6, -32 to the NP rotmap = util.map_hpc_to_hg_rotate(aia, epi_lon = -6, epi_lat = -32) ttmap = util.map_hg_to_hpc(tmap) ttmap.show() # WARNING! # if the following line is run after the previousl line than it gives an error # but not otherwise...not sure why... ttmap = util.map_hg_to_hpc(tmap, xbin = 5, ybin = 5)