Exemplo n.º 1
0
description = """Plot the contents of a FITS image file."""

parser = argparse.ArgumentParser(usage=usage, description=description)

parser.add_argument('files', nargs='+')

parser.add_argument('--hdu',
                    default=0,
                    type=int,
                    help='Set the HDU number to plot.')

args = parser.parse_args()

hdulist = pyfits.open(args.files[0])

im = FITSImage.createFromFITS(args.files[0], args.hdu)
if isinstance(im, SkyCube):

    # Integrate over 3rd (energy) dimension
    im = im.marginalize(2)

plt.figure()

im.plot(cmap='ds9_b')

plt.figure()

# Smooth by 0.2 deg
im.smooth(0.2).plot(cmap='ds9_b')

# Draw an arbitrary contour in Galactic Coordinates
Exemplo n.º 2
0
usage = "usage: %(prog)s [options] [FT1 file ...]"
description = """Plot the contents of a FITS image file."""

parser = argparse.ArgumentParser(usage=usage,description=description)

parser.add_argument('files', nargs='+')

parser.add_argument('--hdu', default = 0, type=int,
                    help = 'Set the HDU number to plot.')
 
args = parser.parse_args()

hdulist = pyfits.open(args.files[0])

im = FITSImage.createFromFITS(args.files[0],args.hdu)
if isinstance(im,SkyCube):

    # Integrate over 3rd (energy) dimension
    im = im.marginalize(2)


plt.figure()

im.plot(cmap='ds9_b')

plt.figure()

# Smooth by 0.2 deg
im.smooth(0.2).plot(cmap='ds9_b')
Exemplo n.º 3
0
parser.add_argument('--srclabels_thresh', default=10.0,type=float)
parser.add_argument('--format', default='png')

parser.add_argument('--hdu', default = 0, type=int,
                    help = 'Set the HDU of the input FITS file from which '
                    'the image data will be extracted.')


args = parser.parse_args()

hdulist = pyfits.open(args.files[0])
model_hdu = None
irf_version = None
im_mdl = None

im = FITSImage.createFromHDU(hdulist[args.hdu])

if args.model_file:
    model_hdu = pyfits.open(args.model_file)[0]

    if args.irf:
        irf_version = [args.irf,None]
    else:
        irf_version = get_irf_version(model_hdu.header)
        
    im_mdl = FITSImage.createFromHDU(model_hdu)
    m = re.search('(.+)V5_(.+)',irf_version[0])
    if m and 'stacked' in args.model_file:
        irf_version[0] = m.groups()[0]+'V5'
    else:
        irf_version[1] = None
Exemplo n.º 4
0
parser.add_argument('--model_file', default=None)
parser.add_argument('--prefix', default=None)

parser.add_argument('--hdu', default = 0, type=int,
                    help = 'Set the HDU to plot.')


args = parser.parse_args()

hdulist = pyfits.open(args.files[0])
model_hdu = None
irf_version = None
im_mdl = None


im = FITSImage.createFromHDU(hdulist[args.hdu])


if args.model_file:
    model_hdu = pyfits.open(args.model_file)[0]
    irf_version = get_irf_version(model_hdu.header)
    im_mdl = FITSImage.createFromHDU(model_hdu)
    

#fp = FITSPlotter(im,im_mdl,None,args.prefix)

#fp.make_plots_skycube(None,smooth=True,resid_type='fractional',
#                              suffix='_data_map_resid_frac')

#fp.make_plots_skycube(4,smooth=True,resid_type='fractional',
#                              suffix='_data_map_slice_resid_frac')