Skip to content

Instantly share code, notes, and snippets.

@cdeil
Created July 25, 2012 11:31
Show Gist options
  • Select an option

  • Save cdeil/3175651 to your computer and use it in GitHub Desktop.

Select an option

Save cdeil/3175651 to your computer and use it in GitHub Desktop.
Plot an allsky image with aplpy
"""Plot an allsky image with aplpy"""
import matplotlib
matplotlib.use('Agg')
import aplpy
f = aplpy.FITSFigure('allsky.fits')
print('Plotting ...')
f.set_theme('publication')
f.show_grayscale(vmin=0.1, vmax=100, stretch='log')
f.add_grid()
f.add_colorbar()
def format_for_allsky(f):
# format ticks
f.tick_labels.set_xformat('dd')
f.tick_labels.set_yformat('dd')
f.ticks.set_xspacing(30)
f.ticks.set_yspacing(10)
f.tick_labels.set_font(size='small')
# format grid
f.grid.set_color('red')
f.grid.set_alpha(0.5)
format_for_allsky(f)
f.save('allsky.pdf')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment