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
Classes | Functions | Variables
lsst.meas.astrom.multiindex Namespace Reference

Classes

class  MultiIndexCache
 
class  AstrometryNetCatalog
 

Functions

def getIndexPath
 Get the path to the specified astrometry.net index file. More...
 
def getConfigFromEnvironment
 
def generateCache
 

Variables

list __all__ = ["getIndexPath", "getConfigFromEnvironment", "AstrometryNetCatalog", "generateCache"]
 

Function Documentation

def lsst.meas.astrom.multiindex.generateCache (   andConfig = None)
Generate a cache file

Definition at line 255 of file multiindex.py.

256 def generateCache(andConfig=None):
257  """Generate a cache file"""
258  if andConfig is None:
259  andConfig = getConfigFromEnvironment()
260  catalog = AstrometryNetCatalog(andConfig)
261  try:
262  for index in catalog:
263  index.reload()
264  catalog.writeCache()
265  finally:
266  for index in catalog:
267  index.unload()
def lsst.meas.astrom.multiindex.getConfigFromEnvironment ( )
Find the config file from the environment

The andConfig.py file is in the astrometry_net_data directory.

Definition at line 31 of file multiindex.py.

31 
33  """Find the config file from the environment
34 
35  The andConfig.py file is in the astrometry_net_data directory.
36  """
37  try:
38  anDir = lsst.utils.getPackageDir('astrometry_net_data')
39  except:
40  anDir = os.getcwd()
41  andConfigPath = "andConfig.py"
42  if not os.path.exists(andConfigPath):
43  raise RuntimeError("Unable to find andConfig.py in the current directory. "
44  "Did you forget to setup astrometry_net_data?")
45  else:
46  andConfigPath = os.path.join(anDir, "andConfig.py")
47  if not os.path.exists(andConfigPath):
48  raise RuntimeError("Unable to find andConfig.py in astrometry_net_data directory %s" % (anDir,))
49 
50  andConfig = AstrometryNetDataConfig()
51  andConfig.load(andConfigPath)
52  return andConfig
std::string getPackageDir(std::string const &packageName)
return the root directory of a setup package
Definition: Utils.cc:66
def lsst.meas.astrom.multiindex.getIndexPath (   fn)

Get the path to the specified astrometry.net index file.

No effort is made to confirm that the file exists, so it may be used to locate the path to a non-existent file (e.g., to write).

Parameters
[in]fnpath to index file; if relative, then relative to astrometry_net_data if that product is setup, else relative to the current working directory
Returns
the absolute path to the index file

Definition at line 11 of file multiindex.py.

11 
12 def getIndexPath(fn):
13  """!Get the path to the specified astrometry.net index file
14 
15  No effort is made to confirm that the file exists, so it may be used to locate the
16  path to a non-existent file (e.g., to write).
17 
18  @param[in] fn path to index file; if relative, then relative to astrometry_net_data
19  if that product is setup, else relative to the current working directory
20  @return the absolute path to the index file
21  """
22  if os.path.isabs(fn):
23  return fn
24  try:
25  andir = lsst.utils.getPackageDir('astrometry_net_data')
26  except:
27  # Relative to cwd
28  return os.path.abspath(fn)
29  return os.path.join(andir, fn)
30 
def getIndexPath
Get the path to the specified astrometry.net index file.
Definition: multiindex.py:11
std::string getPackageDir(std::string const &packageName)
return the root directory of a setup package
Definition: Utils.cc:66

Variable Documentation

list lsst.meas.astrom.multiindex.__all__ = ["getIndexPath", "getConfigFromEnvironment", "AstrometryNetCatalog", "generateCache"]

Definition at line 9 of file multiindex.py.