HiGal SED fitter

The source code is hosted on github

Installation

Can be installed through pip:

pip install https://github.com/keflavich/HiGal_SEDfitter/archive/master.zip

Example

import glob
from astropy import units as u
from astropy.io import fits
from higal_sedfitter import smooth,fit,higal_beams
from higal_sedfitter.fit import PixelFitter

pixelfitter = PixelFitter(bfixed=True)

higal_field = '000'
fmt = {'field':higal_field}

for fn in glob.glob("HIGAL{field}*fits".format(**fmt)):
    smooth.add_beam_information_to_higal_header(fn, name_to_um=higal_beams.num_to_um)

target_fn = glob.glob('HIGAL{field}*_500_RM.fits'.format(**fmt))[0]
target_header = fits.getheader(target_fn)
smooth.smooth_images_toresolution(45*u.arcsec, skip_existing=False,
                                  globs=['HIGAL{field}*'.format(**fmt)],
                                  regrid=True,
                                  target_header=target_header, clobber=True)
fit.fit_modified_blackbody_tofiles('HIGAL{field}*_{{0}}_RM_smregrid45.fits'.format(**fmt),
                                   pixelfitter=pixelfitter,
                                   name_to_um=higal_beams.num_to_um,
                                   out_prefix='HIGAL_L{field}_'.format(**fmt),
                                   integral=True)

Reference/API

higal_sedfitter.smooth Module

Functions

smooth_images_toresolution(target_resolution) Smooth a series of images to the same resolution.
smooth_image_toresolution(fn, outfn, ...[, ...]) Smooth images with known beam size to a target beam size
add_beam_information_to_higal_header(fn[, ...]) Given a Hi-Gal FITS file name, attempt to add beam information to its header.

higal_sedfitter.fit Module

Functions

fit_modified_blackbody_tofiles(filename_template) Fit a modified blackbody to each pixel in a set of files identified using a
fit_modified_blackbody_to_imagecube(...[, ...]) Fit a modified blackbody to each pixel in an image cube.

Classes

PixelFitter([tguess, bguess, nguess, ...]) Initialize an SED fitter instance with a set of guesses.