astro.external package


astro.external.BDSM module

astro.external.BPZ module

astro.external.CosmicFITS module

astro.external.Dia module

astro.external.FITSIO module

astro.external.FitsImageHeader module

astro.external.Galfit module

interface to galfit program


Galfit appends galfit output to the fit.log file if it exists. This method makes sure that it doesn’t.


Embarassingly simple interface to galfit. Runs “galfit <config_file>”.

astro.external.Galphot module

interface to the Galphot ellipfit program

The Galphot package is usually run from IRAF. Marijn Franx offers a distribution with a branch of code that must be compiled under IRAF and another branch intended to be run from the Unix command line. Some minor changes were made to that branch to allow it to run under Linux. Normally ellipfit is run in an interactive fashion, and therefore the command to run it is unusual.


ellipfit(filename, xpos, ypos, intable, maskfile, config_dict)

where mandatory: - filename: the FITS file to run galphot on - xpos: the x-position of the galaxy in the FITS file - ypos: the y-position of the galaxy in the FITS file

and optional: - intable: the description of a previous ellipfit run on the same galaxy, to

be used as initial guess. Note that the required ASCII file is produced by the “as_table()” method of an existing GalPhotModel.
  • maskfile: ”.del” file. ASCII file containing lines of 3 or 4 values

    describing circles and squares respectively; areas to be masked

  • config_dict: dictionary of configuration options, see ELLIPFIT_CONF_LIST

exception astro.external.Galphot.EllipfitError

Bases: Exception

astro.external.Galphot.ellipfit(filename, xpos, ypos, intable='', maskfile='', config_dict={})

System call to ellipfit

The main reason why symbolic links are created here is to limit the length of the filenames used to ~50 characters. Galphot will not handle very long filenames correctly.


Write the ellipfit configuration file “prof.par” (the name is hardcoded in Galphot(!)). The order of parameters is exactly as in the list ORDER_IN_CONFIG_FILE. Only the values of the parameters are written to the file.

astro.external.Galphot.write_position_file(filename, xpos, ypos)

astro.external.LDAC module

astro.external.PhotRed module

exception astro.external.PhotRed.PhotRedError

Bases: Exception


run photred

infile photred input file


astro.external.PhotoObjAll module

TABLE PhotoObjAll

Contains a record describing the attributes of each photometric object

The table has views:

  • PhotoObj: all primary and secondary objects; essentially this is the view you should use unless you want a specific type of object.

  • PhotoPrimary: all photo objects that are primary (the best version of the object).

    o Star: Primary objects that are classified as stars. o Galaxy: Primary objects that are classified as galaxies. o Sky:Primary objects which are sky samples. o Unknown:Primary objects which are no0ne of the above

  • PhotoSecondary: all photo objects that are secondary (secondary detections)

  • PhotoFamily: all photo objects which are neither primary nor secondary (blended)

The table has indices that cover the popular columns.

name alias type unit ucd description

astro.external.Photoz module

TABLE Photoz The photometrically estimated redshifts for all objects in PhotoObjAll.

Please see the Photometric Redshifts entry in Algorithms for more information about the Photoz and Photoz2 tables. NOTE: This table may be empty initially because the photoz values are computed in a separate calculation after the main data release.

name type length unit ucd description

name alias type unit ucd description

astro.external.Photoz2 module

TABLE Photoz2 Alternate computation of photometrically estimated redshifts for objects in the Galaxy view.

Please see the Photometric Redshifts entry in Algorithms for more information about the Photoz and Photoz2 tables. NOTE: This table may be empty initially because the photoz values are computed in a separate calculation after the main data release.

name type length unit ucd description

name alias type unit ucd description

astro.external.Psfex module

Interface to the Psfex PSF extraction program

exception astro.external.Psfex.PsfexError

Bases: Exception

astro.external.Psfex.psfex(catalog_name, config=None, executable='psfex')

Run PSFEx on a catalog

catalog_name : str
filename of a catalog
config : PsfexConfig
configuration object
executable : str
filename of the executable

astro.external.Pullecenella module

astro.external.STIFF module


exception astro.external.STIFF.STIFFError(reason='UNEXPECTED ERROR')

Bases: Exception

astro.external.STIFF.stiff(filename, convert_options='', executable='stiff', **config)

Create a thumbnail from a FITS image

filename : str
filename of FITS image
convert_options : str
string of options to pass to ImageMagick’s convert
executable : str
filename of the executable
config : dictionary
actually keyword arguments containing the STIFF configuration options
astro.external.STIFF.write_stiff_config(config, configname='stiff.conf')

astro.external.Scamp module

astro.external.Sextractor module

Interface to the SExtractor source extraction program

sex(image1, image2=None, config={}, KEY1=VAL1, KEY2=VAL2, ...)

image1 = Detection (and measurement) image image2 = (optional) Measurement image config = An (optional) dictionary of configuration parameters KEY1, KEY2, = (optional) configuration parameters

Returns 1 on succes, 0 otherwise

exception astro.external.Sextractor.SextractorError

Bases: Exception

astro.external.Sextractor.make_filter(filename, fwhm, pixsize, dimension)

Write a custom gaussian filter

filename: name of the filter
fwhm: full-width-half-maximum (arcsec)

pixsize: pixel size (arcsec)

dimension: filter size (pixels), image2=None, params=None, config=None, executable='sex')

Set SExtractor parameters and configuration and run.

image1 : str
Detection (and measurement) image
image2 : str
(optional) Measurement image
params : str
(optional) extra output parameters (Parameters object)
config : SexConfig
(optional) configuration options (Config object)
executable : str
filename of the executable
NOTE: If either params or config is not specified, the defaults will
be used.

astro.external.SextractorParametersList module

astro.external.SpecObjAll module

TABLE SpecObjAll

Contains the measured parameters for a spectrum.

This is a base table containing ALL the spectroscopic information, including a lot of duplicate and bad data. Use the SpecObj view instead, which has the data properly filtered for cleanliness.

name alias type unit ucd description

astro.external.Swarp module

astro.external.TWOMASS module


astro.external.TWOMASS.get_ranges_from_file(item, filename)

astro.external.TinyTim module

This is a simple interface to run TinyTim (v6.3) on ACS data

Example command:

>>> tinytim(paramfile='tiny.conf', instrument=15, chip=1, x=10, y=10,
            filter='f555w', spectrum=2, coeff=2000, diameter=3,
astro.external.TinyTim.check_extinction(ebmv, Av)
astro.external.TinyTim.check_gaussian(major, minor, angle)

Check that all three parameters major, minor, angle are set. Actually we can’t do much to check the angle, just that major and minor exist.

astro.external.TinyTim.check_position(x, y)
astro.external.TinyTim.check_spectrum(spectrum, coeff)
astro.external.TinyTim.make_options_string(major=0.0, minor=0.0, angle=0.0, jitter=0.0, ebmv=0.0, Av=0.0, wmag=0.0)
astro.external.TinyTim.tiny1(paramfile, instrument, chip, x, y, filter, spectrum, coeff, diameter, filename, major=0.0, minor=0.0, angle=0.0, jitter=0.0, ebmv=0.0, Av=0.0, wmag=0.0)

tiny1 (the C program) is used to interactively create the configuration file which is used by tiny2 and optionally tiny3. This interface takes all the commands, normally given interactively, as its arguments, and sends them to the tiny1 program.


Interface to tiny2. Simply runs “tiny2 <paramfile>”.


Interface to tiny3. Simply runs “tiny3 <paramfile>”.

astro.external.TinyTim.tinytim(paramfile, instrument, chip, x, y, filter, spectrum, coeff, diameter, filename, major=0.0, minor=0.0, angle=0.0, jitter=0.0, ebmv=0.0, Av=0.0, wmag=0.0)

astro.external.USNOB module



astro.external.aweimports module

astro.external.lasSource module

TABLE WSA_lasSource

Contains LAS merged sources from LAS detections in lasDetection.

Name Alias Type Unit UCD Description Default Value

Module contents

Python wrappers for software packages

Some software packages contain useful routines, but are not available as Python extension modules. Modules are defined for those external packages which hide the (command-line) programs from the Python user. Hence a Python interface and syntax is available to use the routines in the software packages. Note that the routines in these modules are used in other places and their particular names remain invisible. This is done to ensure easy replacement of the package by (or comparison with) another package that provides the same functionality.

Package | Purpose

LDAC | Perform astrometry and association on FITS tables SExtractor | Extract source positions and other parameters from a FITS image Swarp | Reproject and co-add FITS images