LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Functions | Variables
lsst.pipe.tasks.setConfigFromEups Namespace Reference

Functions

def getEups
 
def getAndVersion
 
def setAstrometryConfigFromEups
 
def setPhotocalConfigFromEups
 
def setConfigFromEups
 

Variables

list __all__ = ["getAndVersion", "setAstrometryConfigFromEups", "setPhotocalConfigFromEups", "setConfigFromEups",]
 

Function Documentation

def lsst.pipe.tasks.setConfigFromEups.getAndVersion ( )
Return the version of astrometry_net_data in use

Definition at line 17 of file setConfigFromEups.py.

17 
18 def getAndVersion():
19  """Return the version of astrometry_net_data in use"""
20  return getEups().findSetupVersion("astrometry_net_data")[0]
21 
def lsst.pipe.tasks.setConfigFromEups.getEups ( )
Return a cached eups instance

Definition at line 8 of file setConfigFromEups.py.

8 
9 def getEups():
10  """Return a cached eups instance"""
11  try:
12  return getEups._eups
13  except AttributeError:
14  getEups._eups = Eups()
15  return getEups._eups
16 
def lsst.pipe.tasks.setConfigFromEups.setAstrometryConfigFromEups (   config,
  menu 
)
Set the astrometry configuration according to the astrometry_net_data being used

The menu is a dict mapping the astrometry_net_data version to a dict of configuration
values to apply.  The menu key may also be a glob.  For example:
menu = { "ps1*": {}, # No changes
         "ps1-without-y": { "solver.filterMap": {"y": "z"} }, # No y-band in this specific version
         "sdss*": { "solver.filterMap": {"y": "z"} }, # No y-band, use z instead
         "2mass*": { "solver.filterMap": {"y": "J"} }, # No y-band, use J instead
       }

Definition at line 22 of file setConfigFromEups.py.

22 
23 def setAstrometryConfigFromEups(config, menu):
24  """Set the astrometry configuration according to the astrometry_net_data being used
25 
26  The menu is a dict mapping the astrometry_net_data version to a dict of configuration
27  values to apply. The menu key may also be a glob. For example:
28  menu = { "ps1*": {}, # No changes
29  "ps1-without-y": { "solver.filterMap": {"y": "z"} }, # No y-band in this specific version
30  "sdss*": { "solver.filterMap": {"y": "z"} }, # No y-band, use z instead
31  "2mass*": { "solver.filterMap": {"y": "J"} }, # No y-band, use J instead
32  }
33  """
34  version = getAndVersion()
35 
36  if version in menu:
37  selected = menu[version]
38  else:
39  # Treat keys in menu as glob; see if any match
40  matchList = [key for key in menu if fnmatch(version, key)]
41  if len(matchList) > 1:
42  raise RuntimeError("Multiple menu keys match astrometry_net_data version %s: %s" %
43  (version, matchList))
44  if len(matchList) == 0:
45  raise RuntimeError("No menu key matches astrometry_net_data version %s" % version)
46  selected = menu[matchList.pop()]
47  for name, value in selected.iteritems():
48  setDottedAttr(config, name, value)
49 
def setDottedAttr
Like setattr, but accepts hierarchical names, e.g.
def lsst.pipe.tasks.setConfigFromEups.setConfigFromEups (   photocalConfig = None,
  astrometryConfig = None,
  astrometryMenu = None 
)
Set the astrometry and photocal configuration according to the astrometry_net_data being used

The 'astrometryMenu' is as defined for the 'menu' parameter for 'setAstrometryConfigFromEups'.

Definition at line 55 of file setConfigFromEups.py.

55 
56 def setConfigFromEups(photocalConfig=None, astrometryConfig=None, astrometryMenu=None):
57  """Set the astrometry and photocal configuration according to the astrometry_net_data being used
58 
59  The 'astrometryMenu' is as defined for the 'menu' parameter for 'setAstrometryConfigFromEups'.
60  """
61  if photocalConfig:
62  setPhotocalConfigFromEups(photocalConfig)
63  if astrometryConfig:
64  if astrometryMenu is None:
65  raise RuntimeError("No astrometryMenu provided for astrometryConfig")
66  setAstrometryConfigFromEups(astrometryConfig, astrometryMenu)
def lsst.pipe.tasks.setConfigFromEups.setPhotocalConfigFromEups (   config)
Set the photocal configuration according to the astrometry_net_data being used

Definition at line 50 of file setConfigFromEups.py.

50 
51 def setPhotocalConfigFromEups(config):
52  """Set the photocal configuration according to the astrometry_net_data being used"""
53  config.photoCatName = getAndVersion()
54 

Variable Documentation

list lsst.pipe.tasks.setConfigFromEups.__all__ = ["getAndVersion", "setAstrometryConfigFromEups", "setPhotocalConfigFromEups", "setConfigFromEups",]

Definition at line 6 of file setConfigFromEups.py.