LSSTApplications  11.0-22-g33de520,12.1+25,13.0+25,13.0+30,13.0-1-g174df6e+3,13.0-1-g41367f3+3,13.0-1-g47a359c+3,13.0-1-g52a7baa+3,13.0-1-g976b40b+3,13.0-10-gcc6134a+6,13.0-10-gf7c21d5+2,13.0-13-gdd29b46+5,13.0-14-gc9904b0,13.0-2-g15de9a1+3,13.0-2-ga4f5e85+6,13.0-2-gf5c5ced+6,13.0-2-gf9e84ea+5,13.0-22-g8f1d162,13.0-3-g7fa07e0+4,13.0-34-ga37f01a,13.0-4-g0bde1de,13.0-5-g0db1a30+1,13.0-5-g6708b9e+9,13.0-6-g7b63e3f+6,13.0-8-gba0f85f,13.0-9-gc47bba1,master-gb637561bb9
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 263 of file multiindex.py.

264 def generateCache(andConfig=None):
265  """Generate a cache file"""
266  if andConfig is None:
267  andConfig = getConfigFromEnvironment()
268  catalog = AstrometryNetCatalog(andConfig)
269  try:
270  for index in catalog:
271  index.reload()
272  catalog.writeCache()
273  finally:
274  for index in catalog:
275  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 37 of file multiindex.py.

37 
39  """Find the config file from the environment
40 
41  The andConfig.py file is in the astrometry_net_data directory.
42  """
43  try:
44  anDir = lsst.utils.getPackageDir('astrometry_net_data')
45  except:
46  anDir = os.getcwd()
47  andConfigPath = "andConfig.py"
48  if not os.path.exists(andConfigPath):
49  raise RuntimeError("Unable to find andConfig.py in the current directory. "
50  "Did you forget to setup astrometry_net_data?")
51  else:
52  andConfigPath = os.path.join(anDir, "andConfig.py")
53  if not os.path.exists(andConfigPath):
54  raise RuntimeError("Unable to find andConfig.py in astrometry_net_data directory %s" % (anDir,))
55 
56  andConfig = AstrometryNetDataConfig()
57  andConfig.load(andConfigPath)
58  return andConfig
59 
std::string getPackageDir(std::string const &packageName)
return the root directory of a setup package
Definition: Utils.cc:34
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 17 of file multiindex.py.

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

Variable Documentation

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

Definition at line 14 of file multiindex.py.