Skip to content

Commit

Permalink
Remove dependence on skypix
Browse files Browse the repository at this point in the history
Stop generating registry info for obsolete dataset type "skytiles"
  • Loading branch information
TallJimbo authored and r-owen committed Mar 8, 2018
1 parent e5b0628 commit 4190923
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
21 changes: 2 additions & 19 deletions bin.src/genInputRegistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

import lsst.daf.base as dafBase
from lsst.afw.fits import readMetadata
from lsst.afw.geom import makeSkyWcs
import lsst.skypix as skypix

DefaultOutputRegistry = "registry.sqlite3"

Expand Down Expand Up @@ -66,14 +64,12 @@ def process(dirList, inputRegistry=None, outputRegistry="registry.sqlite3"):
for row in conn.execute(cmd):
done[row[0]] = True

qsp = skypix.createQuadSpherePixelization()

try:
for dirPath in dirList:
rawDir = os.path.join(dirPath, "raw")
if not os.path.exists(rawDir):
sys.stderr.write("Could not find raw data dir %r\n" % (rawDir,))
processRawDir(rawDir, conn, done, qsp)
processRawDir(rawDir, conn, done)
finally:
print("Cleaning up...")
conn.execute("DELETE FROM raw_visit")
Expand All @@ -89,7 +85,7 @@ def process(dirList, inputRegistry=None, outputRegistry="registry.sqlite3"):
print("wrote registry file %r" % (outputRegistry,))


def processRawDir(rawDir, conn, done, qsp):
def processRawDir(rawDir, conn, done):
print(rawDir, "... started")
nProcessed = 0
nSkipped = 0
Expand All @@ -116,19 +112,6 @@ def processRawDir(rawDir, conn, done, qsp):
(NULL, ?, ?, ?, ?)""",
(visit, filterName, taiObs, expTime))

for row in conn.execute("SELECT last_insert_rowid()"):
id = row[0]
break

wcs = makeSkyWcs(md)
poly = skypix.imageToPolygon(wcs,
md.get("NAXIS1"), md.get("NAXIS2"),
padRad=0.000075) # about 15 arcsec
pix = qsp.intersect(poly)
for skyTileId in pix:
conn.execute("INSERT INTO raw_skyTile VALUES(?, ?)",
(id, skyTileId))

conn.commit()

nProcessed += 1
Expand Down
1 change: 0 additions & 1 deletion ups/obs_test.table
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ setupRequired(obs_base)
setupRequired(pex_config)
setupRequired(pex_policy)
setupRequired(numpy)
setupRequired(skypix)
setupRequired(utils)
setupRequired(python_future)

Expand Down

0 comments on commit 4190923

Please sign in to comment.