Package gavo :: Package helpers :: Module anet
[frames] | no frames]

Module anet

source code

Code to obtain WCS headers for FITS files using astrometry.net

Astrometry.net has oodles of configurable parameters. Some of them can be passed in via the solverParameters argument to getWCSFieldsFor, a dictionary with keys including:

indices

(default: "index-*.fits", meaning all indices in your default index dir) The file names from anet's index directory you want to have used. glob patterns are expanded, but no recursion takes place.

This could be something like:

["index-4211.fits", "index-4210.fits", "index-4209.fits"]

for largeish images or:

["index-4203-\*.fits", "index-4202-*.fits"]

for small ones. You can also give absolute path names for custom indices that live, e.g., in your resource directory.

total_timelimit
(defaults to 600) -- number of seconds after which the anet run should cancel itself.
tweak
(defaults to True) -- try to obtain a polynomic correction to the entire image after obtaining a solution? This can go wrong in particular for exposures with many objects, so you might want to set it to off for such cases.
fields
(default to 1) -- FITS extension to work on
endob
(defaults to not given) -- last object to be processed. You don't want to raise this too high. The library will only pass on 10 objects at a time anyway, but going too high here will waste lots of time on images that are probably not going to resolve anyway.
lower_pix
(defaults to not given) -- smallest permissible pixel size in arcsecs. If at all possible, constrain this for much better results.
upper_pix
(defaults to not given) -- largest permissible pixel size in arcsecs. See lower_pix.
plots
(defaults to False) -- generate all kinds of pretty plots?
downsample
(defaults to not given) -- factor to downsample the image before trying to solve. This may be necessary when not using sextractor, and it should be something like 2, 3, or 4.
Classes
  Error
  NotSolved
  ObjectNotFound
  ShellCommandFailed
Functions
 
getWCSFieldsFor(fName, solverParameters, sexControl=None, objectFilter=None, copyTo=None, verbose=False)
returns a pyfits cardlist for the WCS fields on fName.
source code
Variables
  anetPath = '/usr/local/astrometry/bin'
  anetIndexPath = '/usr/local/astrometry/data'
  solverBin = '/usr/local/astrometry/bin/solve-field'
  sextractorBin = 'sextractor'
  PARAM_DEFAULTS = {'downsample': None, 'endob': None, 'fields':...
  __package__ = 'gavo.helpers'
Function Details

getWCSFieldsFor(fName, solverParameters, sexControl=None, objectFilter=None, copyTo=None, verbose=False)

source code 

returns a pyfits cardlist for the WCS fields on fName.

solverParameters is a dictionary mapping solver keys to their values, sexScript is a script for SExtractor, and its presence means that SExtractor should be used for source extraction rather than what anet has built in. objectFilter is a function that is called with the name of the FITS with the extracted sources. It can remove or add sources to that file before astrometry.net tries to match.

To see what solverParameters are avaliable, check the module docstring.


Variables Details

PARAM_DEFAULTS

Value:
{'downsample': None,
 'endob': None,
 'fields': '1',
 'lower_pix': None,
 'pix_units': 'app',
 'plots': False,
 'total_timelimit': 600,
 'tweak': True,
...