LSSTApplications  17.0+103,17.0+11,17.0+61,18.0.0+13,18.0.0+25,18.0.0+5,18.0.0+52,18.0.0-4-g68ffd23,18.1.0-1-g0001055+8,18.1.0-1-g03d53ef+1,18.1.0-1-g1349e88+28,18.1.0-1-g2505f39+22,18.1.0-1-g380d4d4+27,18.1.0-1-g5315e5e+1,18.1.0-1-g5e4b7ea+10,18.1.0-1-g7e8fceb+1,18.1.0-1-g85f8cd4+23,18.1.0-1-g9a6769a+13,18.1.0-1-ga1a4c1a+22,18.1.0-1-gd55f500+17,18.1.0-12-g42eabe8e+10,18.1.0-14-gd04256d+15,18.1.0-16-g430f6a53+1,18.1.0-17-gd2166b6e4,18.1.0-18-gb5d19ff+1,18.1.0-2-gfbf3545+7,18.1.0-2-gfefb8b5+16,18.1.0-3-g52aa583+13,18.1.0-3-g62b5e86+14,18.1.0-3-g8f4a2b1+17,18.1.0-3-g9bc06b8+7,18.1.0-3-gb69f684+9,18.1.0-4-g1ee41a7+1,18.1.0-5-g6dbcb01+13,18.1.0-5-gc286bb7+3,18.1.0-6-g48bdcd3+2,18.1.0-6-gd05e160+9,18.1.0-7-gc4d902b+2,18.1.0-7-gebc0338+8,18.1.0-9-gae7190a+10,w.2019.38
LSSTDataManagementBasePackage
Classes | Functions
lsst.meas.extensions.astrometryNet.multiindex Namespace Reference

Classes

class  AstrometryNetCatalog
 
class  MultiIndexCache
 

Functions

def getIndexPath (fn)
 Get the path to the specified astrometry.net index file. More...
 
def getConfigFromEnvironment ()
 
def generateCache (andConfig=None)
 

Function Documentation

◆ generateCache()

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

Definition at line 263 of file multiindex.py.

263 def generateCache(andConfig=None):
264  """Generate a cache file"""
265  if andConfig is None:
266  andConfig = getConfigFromEnvironment()
267  catalog = AstrometryNetCatalog(andConfig)
268  try:
269  for index in catalog:
270  index.reload()
271  catalog.writeCache()
272  finally:
273  for index in catalog:
274  index.unload()

◆ getConfigFromEnvironment()

def lsst.meas.extensions.astrometryNet.multiindex.getConfigFromEnvironment ( )
Find the config file from the environment

The andConfig.py file is in the astrometry_net_data directory.

Definition at line 35 of file multiindex.py.

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

◆ getIndexPath()

def lsst.meas.extensions.astrometryNet.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 14 of file multiindex.py.

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