Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-13727: Remove skypix from stack dependencies #43

Merged
merged 1 commit into from
Mar 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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