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-4848: Measure photometric repeatability and correctness of reported errors #3

Merged
merged 14 commits into from
Feb 9, 2016
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
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
A set of utilities to run the processCcd task on some
CFHT data and DECam data
and validate the astrometry of the results.
and validate the astrometric and photometric repeatability of the results.

Pre-requisites: install and declare the following
1. `pipe_tasks` from the LSST DM stack (note that pipe_tasks is included with lsst_apps, which is the usual thing to install)
Expand All @@ -12,7 +12,7 @@ Pre-requisites: install and declare the following
The `obs_decam`, `obs_cfht`, `validation_data_cfht`, `validation_data_decam`, `validate_drp` products are also buildable by the standard LSST DM stack tools: `lsstsw` or `eups distrib`. But they (intentionally) aren't in the dependency tree of `lsst_apps`. If you have a stack already installed with `lsst_apps`, you can install these in the same manner. E.g.,

```
eups distrib obs_decam obs_cfht validation_data_decam validation_data_cfht validate_drp
eups distrib install obs_decam obs_cfht validation_data_decam validation_data_cfht validate_drp
```

XOR
Expand Down Expand Up @@ -100,8 +100,8 @@ Once these basic steps are completed, then you can run any of the following:

Note that the example validation test selects several of the CCDs and will fail if you just pass it a repository with 1 visit or just 1 CCD.

Files :
-------
Files of Interest:
------------------
* `examples/runCfhtTest.sh` : CFHT Run initialization, ingest, measurement, and astrometry validation.
* `examples/runDecamTest.sh` : DECam Run initialization, ingest, measurement, and astrometry validation.
* `examples/validateCfht.py` : CFHT run some analysis on the output data produced by processCcd.py
Expand All @@ -110,4 +110,11 @@ Files :
* `examples/runDecam.list` : DECam list of vistits / ccd to be processed by processCcd
* `config/newAstrometryConfig.py` : configuration for running processCcd with the new AstrometryTask
* `config/anetAstrometryConfig.py` : configuration for running processCcd ANetAstrometryTask
* `bin.src/validateCfht.py` : Wrapper script to analyze CFHT data in validation_data_cfht
* `bin.src/validateDecam.py` : Wrapper script to analyze DECam data in validation_data_decam
* `bin.src/validateDecamCosmos.py` : Wrapper script to analyze larger set of DECam data taken in the COSMOS field.
* `bin.src/validateCfht.py` : Wrapper script to analyze CFHT data in validation_data_cfht
* `python/lsst/validate/drp/calcSrd.py` : calculate metrics defined by the LSST SRC.
* `python/lsst/validate/drp/plotAstrometryPhotometry.py` : plotting routines
* `python/lsst/validate/drp/checkAstrometryPhotometry.py` : coordination and calculation routines.
* `README.md` : THIS FILE. Guide and examples.
18 changes: 7 additions & 11 deletions bin.src/validateCfht.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@
import os.path
import sys

from lsst.validate.drp import checkAstrometry
from lsst.validate.drp import checkAstrometryPhotometry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validateCfht.py and validateDecam.py are very nearly the same thing modulo some numbers. Do they really need to be completely separate pieces of code? It would seem more natural to have a ValidateTask containing all the boilerplate and with subclasses for CFHT and DECam (and other instrumentation in future, one assumes), or even to have a single validation task with appropriate configuration parameters so it can address different instruments.

(I have effectively the same comments on both pieces of code, and won't repeat them.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Integrating and generalizing validateCfht.py and validateDecam.py and having instead a general script that reads a parameter file is DM-4901 and will tackled then.



def defaultData(repo):
# List of visits to be considered
visits = [850587]

# Reference visit (the other viisits will be compared to this one
ref = 849375
visits = [849375, 850587]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This list of visits & CCDs seems to simply be a repetition of examples/runCfht.list. It would be better to define it once.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be done as part of DM-4901


# List of CCD to be considered (source calalogs will be concateneted)
ccd = [12, 13, 14, 21, 22, 23]
Expand All @@ -42,13 +39,12 @@ def defaultData(repo):
# Reference values for the median astrometric scatter and the number of matches
good_mag_limit = 21.0
medianRef = 25
matchRef = 5600
matchRef = 5000

visitDataIds = [[{'visit': v, 'filter': filter, 'ccd': c} for v in visits]
visitDataIds = [{'visit': v, 'filter': filter, 'ccd': c} for v in visits
for c in ccd]
refDataIds = [{'visit': ref, 'filter': filter, 'ccd': c} for c in ccd]

return visitDataIds, refDataIds, good_mag_limit, medianRef, matchRef
return visitDataIds, good_mag_limit, medianRef, matchRef

if __name__ == "__main__":
if len(sys.argv) != 2:
Expand All @@ -62,5 +58,5 @@ def defaultData(repo):
print("Could not find repo %r" % (repo,))
sys.exit(1)

visitDataIds, refDataIds, good_mag_limit, medianRef, matchRef = defaultData(repo)
checkAstrometry.run(repo, visitDataIds, refDataIds, good_mag_limit, medianRef, matchRef)
args = defaultData(repo)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realise it's only being use to copy from one line to the next, but args isn't a super descriptive name! It'd be better just to do away with it, I think

checkAstrometryPhotometry.run(repo, *defaultData(repo))

or similar.

checkAstrometryPhotometry.run(repo, *args)
14 changes: 5 additions & 9 deletions bin.src/validateDecam.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@
import os.path
import sys

from lsst.validate.drp import checkAstrometry
from lsst.validate.drp import checkAstrometryPhotometry


def defaultData(repo):
# List of visits to be considered
visits = [176846]

# Reference visit (the other visits will be compared to this one)
ref = 176837
visits = [176837, 176846]

# List of CCD to be considered (source catalogs will be concateneted)
ccd = [10, 11, 12, 13, 14, 15, 16, 17, 18]
Expand All @@ -45,11 +42,10 @@ def defaultData(repo):
medianRef = 25 # [arcsec]
matchRef = 10000 # [number of stars]

visitDataIds = [[{'visit': v, 'filter': filter, 'ccdnum': c} for v in visits]
visitDataIds = [{'visit': v, 'filter': filter, 'ccdnum': c} for v in visits
for c in ccd]
refDataIds = [{'visit': ref, 'filter': filter, 'ccdnum': c} for c in ccd]

return visitDataIds, refDataIds, good_mag_limit, medianRef, matchRef
return visitDataIds, good_mag_limit, medianRef, matchRef

if __name__ == "__main__":
if len(sys.argv) != 2:
Expand All @@ -64,4 +60,4 @@ def defaultData(repo):
sys.exit(1)

args = defaultData(repo)
checkAstrometry.run(repo, *args)
checkAstrometryPhotometry.run(repo, *args)
63 changes: 63 additions & 0 deletions bin.src/validateDecamCosmos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env python

# LSST Data Management System
# Copyright 2008-2016 AURA/LSST.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.

from __future__ import print_function

import os.path
import sys

from lsst.validate.drp import checkAstrometryPhotometry


def defaultData(repo):
# List of visits to be considered
visits = [176837, 176839, 176840, 176841, 176842, 176843, 176844, 176845, 176846]

# List of CCD to be considered (source catalogs will be concateneted)
ccd = [10, 11, 12, 13, 14, 15, 16, 17, 18]
filter = 'z'

# Reference values that the DECam analysis should pass
# for the median astrometric scatter and the number of matches
good_mag_limit = 21 # [mag]
medianRef = 25 # [arcsec]
matchRef = 10000 # [number of stars]

visitDataIds = [{'visit': v, 'filter': filter, 'ccdnum': c} for v in visits
for c in ccd]

return visitDataIds, good_mag_limit, medianRef, matchRef

if __name__ == "__main__":
if len(sys.argv) != 2:
print("""Usage: valid_cosmos repo
where repo is the path to a repository containing the output of processCcd
""")
sys.exit(1)

repo = sys.argv[1]
if not os.path.isdir(repo):
print("Could not find repo %r" % (repo,))
sys.exit(1)

args = defaultData(repo)
checkAstrometryPhotometry.run(repo, *args)