Skip to content

Instantly share code, notes, and snippets.

@keflavich
Forked from cdeil/ds9_screenshot.png
Last active December 14, 2015 05:28
Show Gist options
  • Save keflavich/5035027 to your computer and use it in GitHub Desktop.
Save keflavich/5035027 to your computer and use it in GitHub Desktop.
SIMPLE = T / file does conform to FITS standard BITPIX = 32 / number of bits per data pixel NAXIS = 2 / number of data axes NAXIS1 = 341 / length of data axis 1 NAXIS2 = 291 / length of data axis 2 EXTEND = T / FITS dataset may contain extensions COMMENT FITS (Flexible Image Transport System) format is defined in 'AstronomyCOMMENT and Astrophysics', volume 376, page 359; bibcode: 2001A&A...376..359H EXTNAME = 'On ' HDUNAME = 'On ' CTYPE1 = 'GLON-CAR' / Type of co-ordinate on axis 1 CTYPE2 = 'GLAT-CAR' / Type of co-ordinate on axis 2 RADESYS = ' ' / Reference frame for RA/DEC values EQUINOX = 2000. / [yr] Epoch of reference equinox CRPIX1 = -2.630000000000000E+03 / Reference pixel on axis 1 CRPIX2 = 1.705000004656620E+02 / Reference pixel on axis 2 CRVAL1 = 341.010000228882 / Value at ref. pixel on axis 1 CRVAL2 = 0. / Value at ref. pixel on axis 2 CDELT1 = -0.0199966430664062 / Pixel size on axis 1 CDELT2 = 0.0199999809265146 / Pixel size on axis 2 CUNIT1 = 'deg ' / units of CRVAL1 and CDELT1 CUNIT2 = 'deg ' / units of CRVAL2 and CDELT2 BUNIT = 'Count ' BSCALE = 1. BZERO = 0. TELESCOP= 'H.E.S.S.' / name of telescope ORIGIN = 'The H.E.S.S. Collaboration' / organization responsible for the data CREATOR = 'HESS Plotters::FITSTools $Revision: 1.29 $' / software configuration OBJECT = 'ra252.651304 dec-44.480656' / name of observed object DATE = '2012-09-19T23:02:21' / file creation date (YYYY-MM-DDThh:mm:ss UT) HISTORY Created by deil with FITSTools.C $Revision: 1.29 $ on 2012-09-19T23:02: END 
galactic;box(285,-0.5,6,5,0) # color={red} width=5 text={Region1}
galactic;box(285,-0.5,4,3,0) # color={blue} width=5
galactic;circle(285.0,-1.0,1.0) # color={green} width=5 text={Source}
import matplotlib
matplotlib.use('Agg')
from aplpy import FITSFigure
f = FITSFigure('image.fits')
f.set_theme('publication')
f.show_grayscale()
f.show_regions('region.reg')
f.add_colorbar()
f.ticks.set_xspacing(2)
f.ticks.set_yspacing(1)
f.tick_labels.set_xformat('dd.d')
f.tick_labels.set_yformat('dd.d')
f.tick_labels.set_style('colons')
filename = 'region_offset.png'
print('Writing {0}'.format(filename))
f.save(filename)
@keflavich
Copy link
Author

This is with the latest version, I hope:

$ python -c "import aplpy; print aplpy.__version__; print aplpy.__file__"
WARNING: ConfigurationDefaultMissingWarning: Requested default configuration file /Users/adam/virtual-python/lib/python2.7/site-packages/astropy-0.3.dev3265-py2.7-macosx-10.6-intel.egg/astropy/astropy.cfg is not a file. Cannot install default profile. If you are importing from source, this is expected. [astropy]
0.9.8
/Users/adam/repos/aplpy.git/aplpy/__init__.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment