Submaps and CroppingΒΆ

In this example we demonstrate how to get a submap of a map.

Start by importing the necessary modules.

from __future__ import print_function, division

import astropy.units as u

import sunpy.map
import sunpy.data.sample

Sunpy sample data contains a number of suitable maps, where the sunpy.data.sample.NAME returns the location of the given FITS file.

swap_map = sunpy.map.Map(sunpy.data.sample.SWAP_LEVEL1_IMAGE)

This has resolution and ranges of:

print(swap_map.dimensions)
print(swap_map.data)
print(swap_map.meta)

Out:

Pair(x=<Quantity 1024.0 pix>, y=<Quantity 1024.0 pix>)
[[ 0.  0.  0. ...,  0.  0.  0.]
 [ 0.  0.  0. ...,  0.  0.  0.]
 [ 0.  0.  0. ...,  0.  0.  0.]
 ...,
 [ 0.  0.  0. ...,  0.  0.  0.]
 [ 0.  0.  0. ...,  0.  0.  0.]
 [ 0.  0.  0. ...,  0.  0.  0.]]
MapMeta([('simple', True), ('bitpix', 16), ('naxis', 2), ('naxis1', 1024), ('naxis2', 1024), ('comment', '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------$Id: swap_fits_template 3732 2010-09-28 20:42:23Z bogdan $------------------------------------------------------------------------------------------------------------------------------------------------This is a level-1 SWAP FITS file produced by p2sw_prep v1.3 at the Royal  Observatory of Belgium. If you have difficulty with this file or wish  to make suggestions for improvements, please contact the SWAP  Instrument Team via email at swap_lyra@oma.be.------------------------------------------------------------------------'), ('filename', 'swap_lv1_20120101_001607.fits'), ('file_tmr', 'swap_01118025596770_3322ac7c.fits'), ('file_raw', 'BINSWAP201201010016200000475604PROCESSED'), ('file_tar', 'BINSWAP_6675_RED3_2012.01.01T20.15.00.tar'), ('date', '2012-01-03T08:40:42'), ('date-obs', '2012-01-01T00:16:07.836'), ('level', 1), ('creator', 'P2SW_PREP.PRO v1.3'), ('origin', 'ROB'), ('telescop', 'PROBA2'), ('instrume', 'SWAP'), ('object', 'Sun EUV'), ('filter', 'Al'), ('detector', 'SWAP'), ('wavelnth', 174), ('obs_mode', 'Variable off-pointing'), ('cap_mode', 'CDS'), ('exptime', 10.0), ('bscale', 0.00625), ('bzero', 204.8), ('bunit', 'DN/s/pixel'), ('datamin', 0.0), ('datamax', 360.575), ('swavint', 16.8136), ('firstrow', 1), ('last_row', 1024), ('firstcol', 1), ('last_col', 1024), ('rebin', 'off'), ('wcsname', 'Helioprojective-cartesian'), ('ctype1', 'HPLN-TAN'), ('ctype2', 'HPLT-TAN'), ('cunit1', 'arcsec'), ('cunit2', 'arcsec'), ('cd1_1', 3.16226783969), ('cd1_2', 0.0), ('cd2_1', 0.0), ('cd2_2', 3.16226783969), ('cdelt1', 3.16226783969), ('cdelt2', 3.16226783969), ('crval1', 0.0), ('crval2', 0.0), ('crpix1', 512.5), ('crpix2', 512.5), ('lonpole', 180.0), ('crota1', 0.0), ('crota2', 0.0), ('swxcen', 532.06), ('swycen', 523.18), ('dtplar1', 194.0), ('dtplar2', 2000.0), ('p2_x0', 0.00357310413421), ('p2_y0', -0.00224459845388), ('p2_roll', 270.007226661), ('solar_ep', 353.371278666), ('hglt_obs', -2.94816138222), ('hgln_obs', -0.0025564435851), ('rsun_arc', 975.892814796), ('dsun_obs', 147105534315.0), ('heex_obs', 147105534152.0), ('heey_obs', -6774160.9748), ('heez_obs', 1507093.54009), ('gsex_obs', -1528584.94733), ('gsey_obs', 6774160.9748), ('gsez_obs', 1507093.54009), ('los_alt', 562259.277947), ('trapprot', 0.0), ('trapelec', 0.0), ('geod_alt', 730544.090022), ('geod_lat', 20.2649161614), ('geod_lon', -87.9302433555), ('temp1det', -4.41001), ('temp2det', -4.41001), ('ttemp1', '2012-01-01T00:15:51.000'), ('ttemp2', '2012-01-01T00:16:21.000'), ('tempdark', -4.41001), ('is_proc', 1), ('trantime', 1118025596770.0), ('sacqtime', 1118025369250.0), ('eacqtime', 1118025596770.0), ('lang_rot', -0.7071067819), ('pav_rot0', 0.0), ('pav_rot1', 0.0), ('hasstdby', 0), ('readrdiv', 0), ('pga_offs', 59), ('pga_gain', 1), ('led_pow', 'off'), ('led_sel', 'a'), ('hasblack', 4), ('hasoffst', 11), ('artefx', 'on'), ('recoding', 'fixed'), ('recnum', 3600), ('recbias', 10), ('compress', 'jpeg'), ('lzwdecor', 'off'), ('pn', 133), ('sizcompi', 609648), ('nprescr', 0), ('npreslzw', 0), ('checksum', 'YIpUaInUTInUYInU'), ('datasum', '1921173586'), ('history', 'SWTMR 169932SWEDG 170323FITSHEAD2STRUCT run at: Tue Jan  3 08:40:35 2012p2sw_hdrchk v1.3  Computed detector temp.: -4.4100100 Celsiusp2sw_pmcdiv v1.3  Reverted wrt swap_pmc_20100308_164500.fitsp2sw_pixrep v1.3  Replaced wrt swap_satcds_20100113_152800.fitsp2sw_drksub v1.3  Subtracted modeled dark with coefficients inp2sw_drksub v1.3   swap_dark_coefs_20110101_000000.save usingp2sw_drksub v1.3   T=268.74 K, dt=10.0000 sp2sw_pmcrep v1.3  Reverted wrt swap_pmc_20100308_164500.fitsp2sw_ffcorr v1.3  Flat-field: swap_flatcds_20100308_164500.fitsp2sw_despike v1.3  Despiked at the 6.0-sigma level (6590 pix)p2sw_imgcor v1.3  Image centred on solar disk centrep2sw_imgcor v1.3  Image scaled to square pixelsp2sw_imgcor v1.3  Image rotated to solar North upp2sw_expnorm v1.3  Exposure time normalized data (DN/s/pixel)'), ('keycomments', {'DSUN_OBS': '[m]   s/c distance from Sun', 'TRAPPROT': '[ct/cm^2/s] AP-8 MAX > 10MeV @ 725km model', 'SIMPLE': 'Written by IDL:  Tue Jan  3 08:40:42 2012', 'OBJECT': 'object observed', 'COMPRESS': '(off,lzw,jpeg) on-board compression algorithm', 'FIRSTROW': 'first read-out detector row', 'GSEZ_OBS': '[m]   s/c Geocentric   Solar Ecliptic Z', 'PGA_OFFS': 'PGA offset', 'CD1_2': 'WCS coordinate description matrix', 'CD1_1': 'WCS coordinate description matrix', 'TRAPELEC': '[ct/cm^2/s] AE-8 MAX >  1MeV @ 725km model', 'CREATOR': 'FITS creation software', 'HGLT_OBS': '[deg] s/c heliographic latitude', 'DTPLAR1': '[s] predicted time to prev large angle rotation', 'DTPLAR2': '[s] predicted time to next large angle rotation', 'PAV_ROT0': 'commanded paving rotation component 0', 'READRDIV': 'read-out rate divider', 'DATASUM': 'data unit checksum updated 2012-01-03T08:40:43', 'CUNIT1': 'WCS axis X units', 'TEMPDARK': '[Celsius] temperature used in dark subtraction', 'CUNIT2': 'WCS axis Y units', 'GEOD_LON': '[deg] s/c sub-point longitude', 'ORIGIN': 'Royal Observatory of Belgium', 'P2_Y0': '[deg] s/c pitch', 'SWXCEN': '[pixel] axis 1 location of solar center in lv0', 'LEVEL': 'data processing level', 'SWYCEN': '[pixel] axis 2 location of solar center in lv0', 'IS_PROC': 'on-board image processing', 'LED_SEL': 'calibration LED selection', 'TEMP1DET': '[Celsius] detector temperature (SW HK T CF)', 'CTYPE2': 'WCS axis Y', 'CD2_1': 'WCS coordinate description matrix', 'GSEX_OBS': '[m]   s/c Geocentric   Solar Ecliptic X', 'CD2_2': 'WCS coordinate description matrix', 'DATAMIN': 'minimum valid physical value', 'ARTEFX': '(off,on,cosmic rays) on-board artefact removal', 'SOLAR_EP': '[deg] s/c ecliptic North to solar North angle', 'CHECKSUM': 'HDU checksum updated 2012-01-03T08:40:43', 'LED_POW': 'calibration LED power', 'NPRESCR': '# preserved pixels - cosmic rays', 'CRVAL2': '[arcsec] reference point WCS axis Y', 'CRPIX1': '[pixel] reference point axis 1', 'CRPIX2': '[pixel] reference point axis 2', 'CRVAL1': '[arcsec] reference point WCS axis X', 'CAP_MODE': '(DS,CDS) capture mode', 'TELESCOP': 'satellite name', 'TRANTIME': '[OBET] transferring time', 'WAVELNTH': '[Angstrom] bandpass peak response', 'LONPOLE': '[deg] native longitude of the celestial pole', 'HASBLACK': 'HAS detector black  level', 'HEEZ_OBS': '[m]   s/c Heliocentric Earth Ecliptic Z', 'DATAMAX': 'maximum valid physical value', 'CTYPE1': 'WCS axis X', 'BZERO': 'physical value for the array value 0', 'HASSTDBY': 'HAS detector standby mode', 'RSUN_ARC': '[arcsec] photospheric solar radius', 'EXPTIME': '[s] commanded exposure time', 'TEMP2DET': '[Celsius] detector temperature (SW HK T CF)', 'WCSNAME': 'aligned with solar North', 'RECODING': '(off,fixed,adaptive) on-board recoding', 'CDELT1': '[arcsec] average pixel scale along axis 1', 'CDELT2': '[arcsec] average pixel scale along axis 2', 'P2_ROLL': '[deg] s/c roll', 'P2_X0': '[deg] s/c yaw', 'SWAVINT': '[DN/s] average intensity in calibrated image', 'GEOD_LAT': '[deg] s/c sub-point geodetic latitude', 'NAXIS': 'number of data axes', 'DATE-OBS': 'UTC time of observation', 'GSEY_OBS': '[m]   s/c Geocentric   Solar Ecliptic Y', 'HASOFFST': 'HAS detector offset level', 'DATE': 'UTC time of FITS file creation', 'REBIN': 'on-board rebin (2x2 pixel average)', 'SACQTIME': '[OBET] start acquisition time', 'HGLN_OBS': '[deg] s/c heliographic longitude', 'FILENAME': 'FITS filename', 'FILE_RAW': 'raw telemetry filename', 'NPRESLZW': '# preserved pixels - LZW decorrelation', 'LZWDECOR': 'LZW decorrelation', 'CROTA2': '[deg] axis 2 to WCS rotation angle', 'CROTA1': '[deg] axis 1 to WCS rotation angle', 'RECNUM': 'recoding upper limit', 'PN': 'on-board priority number', 'EACQTIME': '[OBET] end   acquisition time', 'HEEY_OBS': '[m]   s/c Heliocentric Earth Ecliptic Y', 'RECBIAS': 'recoding lower limit', 'NAXIS1': 'length of data axis 1', 'NAXIS2': 'length of data axis 2', 'GEOD_ALT': '[m]   s/c WGS84 altitude', 'TTEMP2': 'UTC time of detector temp 2nd sample', 'TTEMP1': 'UTC time of detector temp 1st sample', 'OBS_MODE': 'sun_cen, fix_off, var_off, cme_track', 'PGA_GAIN': 'PGA gain', 'LANG_ROT': 'commanded large angle rotation component', 'LAST_ROW': 'last  read-out detector row', 'FILE_TMR': 'SWTMR filename', 'LAST_COL': 'last  read-out detector column', 'SIZCOMPI': 'size of on-board compressed image', 'BSCALE': 'ratio of physical to array value at 0 offset', 'INSTRUME': 'instrument name', 'HEEX_OBS': '[m]   s/c Heliocentric Earth Ecliptic X', 'FILTER': 'Aluminum filter', 'PAV_ROT1': 'commanded paving rotation component 1', 'LOS_ALT': '[m]   s/c LOS altitude (1000000=no atmosphere)', 'BITPIX': 'number of bits per data pixel', 'DETECTOR': 'HAS CMOS detector 1024x1024 pixels', 'FIRSTCOL': 'first read-out detector column', 'FILE_TAR': 'raw telemetry package', 'BUNIT': 'unit of physical value'}), ('waveunit', 'Angstrom'), ('obsrvtry', 'PROBA2')])

To find out more specifics about this map and the instrument used, check it’s metatdata:

print(swap_map.meta)

Out:

MapMeta([('simple', True), ('bitpix', 16), ('naxis', 2), ('naxis1', 1024), ('naxis2', 1024), ('comment', '------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------$Id: swap_fits_template 3732 2010-09-28 20:42:23Z bogdan $------------------------------------------------------------------------------------------------------------------------------------------------This is a level-1 SWAP FITS file produced by p2sw_prep v1.3 at the Royal  Observatory of Belgium. If you have difficulty with this file or wish  to make suggestions for improvements, please contact the SWAP  Instrument Team via email at swap_lyra@oma.be.------------------------------------------------------------------------'), ('filename', 'swap_lv1_20120101_001607.fits'), ('file_tmr', 'swap_01118025596770_3322ac7c.fits'), ('file_raw', 'BINSWAP201201010016200000475604PROCESSED'), ('file_tar', 'BINSWAP_6675_RED3_2012.01.01T20.15.00.tar'), ('date', '2012-01-03T08:40:42'), ('date-obs', '2012-01-01T00:16:07.836'), ('level', 1), ('creator', 'P2SW_PREP.PRO v1.3'), ('origin', 'ROB'), ('telescop', 'PROBA2'), ('instrume', 'SWAP'), ('object', 'Sun EUV'), ('filter', 'Al'), ('detector', 'SWAP'), ('wavelnth', 174), ('obs_mode', 'Variable off-pointing'), ('cap_mode', 'CDS'), ('exptime', 10.0), ('bscale', 0.00625), ('bzero', 204.8), ('bunit', 'DN/s/pixel'), ('datamin', 0.0), ('datamax', 360.575), ('swavint', 16.8136), ('firstrow', 1), ('last_row', 1024), ('firstcol', 1), ('last_col', 1024), ('rebin', 'off'), ('wcsname', 'Helioprojective-cartesian'), ('ctype1', 'HPLN-TAN'), ('ctype2', 'HPLT-TAN'), ('cunit1', 'arcsec'), ('cunit2', 'arcsec'), ('cd1_1', 3.16226783969), ('cd1_2', 0.0), ('cd2_1', 0.0), ('cd2_2', 3.16226783969), ('cdelt1', 3.16226783969), ('cdelt2', 3.16226783969), ('crval1', 0.0), ('crval2', 0.0), ('crpix1', 512.5), ('crpix2', 512.5), ('lonpole', 180.0), ('crota1', 0.0), ('crota2', 0.0), ('swxcen', 532.06), ('swycen', 523.18), ('dtplar1', 194.0), ('dtplar2', 2000.0), ('p2_x0', 0.00357310413421), ('p2_y0', -0.00224459845388), ('p2_roll', 270.007226661), ('solar_ep', 353.371278666), ('hglt_obs', -2.94816138222), ('hgln_obs', -0.0025564435851), ('rsun_arc', 975.892814796), ('dsun_obs', 147105534315.0), ('heex_obs', 147105534152.0), ('heey_obs', -6774160.9748), ('heez_obs', 1507093.54009), ('gsex_obs', -1528584.94733), ('gsey_obs', 6774160.9748), ('gsez_obs', 1507093.54009), ('los_alt', 562259.277947), ('trapprot', 0.0), ('trapelec', 0.0), ('geod_alt', 730544.090022), ('geod_lat', 20.2649161614), ('geod_lon', -87.9302433555), ('temp1det', -4.41001), ('temp2det', -4.41001), ('ttemp1', '2012-01-01T00:15:51.000'), ('ttemp2', '2012-01-01T00:16:21.000'), ('tempdark', -4.41001), ('is_proc', 1), ('trantime', 1118025596770.0), ('sacqtime', 1118025369250.0), ('eacqtime', 1118025596770.0), ('lang_rot', -0.7071067819), ('pav_rot0', 0.0), ('pav_rot1', 0.0), ('hasstdby', 0), ('readrdiv', 0), ('pga_offs', 59), ('pga_gain', 1), ('led_pow', 'off'), ('led_sel', 'a'), ('hasblack', 4), ('hasoffst', 11), ('artefx', 'on'), ('recoding', 'fixed'), ('recnum', 3600), ('recbias', 10), ('compress', 'jpeg'), ('lzwdecor', 'off'), ('pn', 133), ('sizcompi', 609648), ('nprescr', 0), ('npreslzw', 0), ('checksum', 'YIpUaInUTInUYInU'), ('datasum', '1921173586'), ('history', 'SWTMR 169932SWEDG 170323FITSHEAD2STRUCT run at: Tue Jan  3 08:40:35 2012p2sw_hdrchk v1.3  Computed detector temp.: -4.4100100 Celsiusp2sw_pmcdiv v1.3  Reverted wrt swap_pmc_20100308_164500.fitsp2sw_pixrep v1.3  Replaced wrt swap_satcds_20100113_152800.fitsp2sw_drksub v1.3  Subtracted modeled dark with coefficients inp2sw_drksub v1.3   swap_dark_coefs_20110101_000000.save usingp2sw_drksub v1.3   T=268.74 K, dt=10.0000 sp2sw_pmcrep v1.3  Reverted wrt swap_pmc_20100308_164500.fitsp2sw_ffcorr v1.3  Flat-field: swap_flatcds_20100308_164500.fitsp2sw_despike v1.3  Despiked at the 6.0-sigma level (6590 pix)p2sw_imgcor v1.3  Image centred on solar disk centrep2sw_imgcor v1.3  Image scaled to square pixelsp2sw_imgcor v1.3  Image rotated to solar North upp2sw_expnorm v1.3  Exposure time normalized data (DN/s/pixel)'), ('keycomments', {'DSUN_OBS': '[m]   s/c distance from Sun', 'TRAPPROT': '[ct/cm^2/s] AP-8 MAX > 10MeV @ 725km model', 'SIMPLE': 'Written by IDL:  Tue Jan  3 08:40:42 2012', 'OBJECT': 'object observed', 'COMPRESS': '(off,lzw,jpeg) on-board compression algorithm', 'FIRSTROW': 'first read-out detector row', 'GSEZ_OBS': '[m]   s/c Geocentric   Solar Ecliptic Z', 'PGA_OFFS': 'PGA offset', 'CD1_2': 'WCS coordinate description matrix', 'CD1_1': 'WCS coordinate description matrix', 'TRAPELEC': '[ct/cm^2/s] AE-8 MAX >  1MeV @ 725km model', 'CREATOR': 'FITS creation software', 'HGLT_OBS': '[deg] s/c heliographic latitude', 'DTPLAR1': '[s] predicted time to prev large angle rotation', 'DTPLAR2': '[s] predicted time to next large angle rotation', 'PAV_ROT0': 'commanded paving rotation component 0', 'READRDIV': 'read-out rate divider', 'DATASUM': 'data unit checksum updated 2012-01-03T08:40:43', 'CUNIT1': 'WCS axis X units', 'TEMPDARK': '[Celsius] temperature used in dark subtraction', 'CUNIT2': 'WCS axis Y units', 'GEOD_LON': '[deg] s/c sub-point longitude', 'ORIGIN': 'Royal Observatory of Belgium', 'P2_Y0': '[deg] s/c pitch', 'SWXCEN': '[pixel] axis 1 location of solar center in lv0', 'LEVEL': 'data processing level', 'SWYCEN': '[pixel] axis 2 location of solar center in lv0', 'IS_PROC': 'on-board image processing', 'LED_SEL': 'calibration LED selection', 'TEMP1DET': '[Celsius] detector temperature (SW HK T CF)', 'CTYPE2': 'WCS axis Y', 'CD2_1': 'WCS coordinate description matrix', 'GSEX_OBS': '[m]   s/c Geocentric   Solar Ecliptic X', 'CD2_2': 'WCS coordinate description matrix', 'DATAMIN': 'minimum valid physical value', 'ARTEFX': '(off,on,cosmic rays) on-board artefact removal', 'SOLAR_EP': '[deg] s/c ecliptic North to solar North angle', 'CHECKSUM': 'HDU checksum updated 2012-01-03T08:40:43', 'LED_POW': 'calibration LED power', 'NPRESCR': '# preserved pixels - cosmic rays', 'CRVAL2': '[arcsec] reference point WCS axis Y', 'CRPIX1': '[pixel] reference point axis 1', 'CRPIX2': '[pixel] reference point axis 2', 'CRVAL1': '[arcsec] reference point WCS axis X', 'CAP_MODE': '(DS,CDS) capture mode', 'TELESCOP': 'satellite name', 'TRANTIME': '[OBET] transferring time', 'WAVELNTH': '[Angstrom] bandpass peak response', 'LONPOLE': '[deg] native longitude of the celestial pole', 'HASBLACK': 'HAS detector black  level', 'HEEZ_OBS': '[m]   s/c Heliocentric Earth Ecliptic Z', 'DATAMAX': 'maximum valid physical value', 'CTYPE1': 'WCS axis X', 'BZERO': 'physical value for the array value 0', 'HASSTDBY': 'HAS detector standby mode', 'RSUN_ARC': '[arcsec] photospheric solar radius', 'EXPTIME': '[s] commanded exposure time', 'TEMP2DET': '[Celsius] detector temperature (SW HK T CF)', 'WCSNAME': 'aligned with solar North', 'RECODING': '(off,fixed,adaptive) on-board recoding', 'CDELT1': '[arcsec] average pixel scale along axis 1', 'CDELT2': '[arcsec] average pixel scale along axis 2', 'P2_ROLL': '[deg] s/c roll', 'P2_X0': '[deg] s/c yaw', 'SWAVINT': '[DN/s] average intensity in calibrated image', 'GEOD_LAT': '[deg] s/c sub-point geodetic latitude', 'NAXIS': 'number of data axes', 'DATE-OBS': 'UTC time of observation', 'GSEY_OBS': '[m]   s/c Geocentric   Solar Ecliptic Y', 'HASOFFST': 'HAS detector offset level', 'DATE': 'UTC time of FITS file creation', 'REBIN': 'on-board rebin (2x2 pixel average)', 'SACQTIME': '[OBET] start acquisition time', 'HGLN_OBS': '[deg] s/c heliographic longitude', 'FILENAME': 'FITS filename', 'FILE_RAW': 'raw telemetry filename', 'NPRESLZW': '# preserved pixels - LZW decorrelation', 'LZWDECOR': 'LZW decorrelation', 'CROTA2': '[deg] axis 2 to WCS rotation angle', 'CROTA1': '[deg] axis 1 to WCS rotation angle', 'RECNUM': 'recoding upper limit', 'PN': 'on-board priority number', 'EACQTIME': '[OBET] end   acquisition time', 'HEEY_OBS': '[m]   s/c Heliocentric Earth Ecliptic Y', 'RECBIAS': 'recoding lower limit', 'NAXIS1': 'length of data axis 1', 'NAXIS2': 'length of data axis 2', 'GEOD_ALT': '[m]   s/c WGS84 altitude', 'TTEMP2': 'UTC time of detector temp 2nd sample', 'TTEMP1': 'UTC time of detector temp 1st sample', 'OBS_MODE': 'sun_cen, fix_off, var_off, cme_track', 'PGA_GAIN': 'PGA gain', 'LANG_ROT': 'commanded large angle rotation component', 'LAST_ROW': 'last  read-out detector row', 'FILE_TMR': 'SWTMR filename', 'LAST_COL': 'last  read-out detector column', 'SIZCOMPI': 'size of on-board compressed image', 'BSCALE': 'ratio of physical to array value at 0 offset', 'INSTRUME': 'instrument name', 'HEEX_OBS': '[m]   s/c Heliocentric Earth Ecliptic X', 'FILTER': 'Aluminum filter', 'PAV_ROT1': 'commanded paving rotation component 1', 'LOS_ALT': '[m]   s/c LOS altitude (1000000=no atmosphere)', 'BITPIX': 'number of bits per data pixel', 'DETECTOR': 'HAS CMOS detector 1024x1024 pixels', 'FIRSTCOL': 'first read-out detector column', 'FILE_TAR': 'raw telemetry package', 'BUNIT': 'unit of physical value'}), ('waveunit', 'Angstrom'), ('obsrvtry', 'PROBA2')])

To crop the data you create a submap, specifying ranges in AstroPy Quantities:

rangex = u.Quantity([-900 * u.arcsec, 0 * u.arcsec])
rangey = u.Quantity([-900 * u.arcsec, -200 * u.arcsec])
swap_submap = swap_map.submap(rangex, rangey)
swap_submap.peek(draw_limb=True, draw_grid=True)
../../../_images/sphx_glr_submaps_and_cropping_001.png

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

Generated by Sphinx-Gallery