Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ab3bae6
Adding a first run at a BinnedScatterPlot class (#68)
msimet Jun 15, 2015
480196a
Adding a first run at a testing module for the BinnedScatterPlot (#68)
msimet Jun 15, 2015
dd61de1
Bugfixes found in running tests (#68)
msimet Jun 16, 2015
578430e
Bugfixes to test_sys_tests.py (#68)y
msimet Jun 16, 2015
6567499
Add error calculations and a "count" option to BinnedScatterPlot (#68)
msimet Jun 17, 2015
28c71bb
Edit line lengths in test_sys_tests.py (#68)
msimet Jun 17, 2015
518e2ff
Implement RMS error + add more documentation (#68)
msimet Jun 18, 2015
1834c7c
Add HSC adapters for BinnedScatterPlot specific instances (#68)
msimet Jun 18, 2015
9140136
Bugfixes making #68 work
msimet Jul 2, 2015
8541c76
Fix accidental passing of config in shape adapters (#68)
msimet Jul 8, 2015
713b34f
Fix implementation of count method, plus checking for NaNs (#68)
msimet Jul 8, 2015
2124818
Move to getting key first for magnitude stuff (#68)
msimet Jul 8, 2015
15cb43d
Check for NaNs in all fields (#68)
msimet Jul 16, 2015
addded8
Merge branch 'master' into #68
msimet Jul 16, 2015
85cfb2b
Documentation updates (#68)
msimet Jul 16, 2015
9fe9453
Merge branch 'master' into #68
msimet Sep 25, 2015
e9060e2
Merge branch 'master' into #68
msimet Nov 4, 2015
787f22a
Merge branch 'master' into #68
msimet Nov 4, 2015
320f3e3
Add area kwargs for number density option to BinnedScatterPlot (#68
msimet Nov 5, 2015
b187d74
Add RMSESky, RMSEChip, and change default tests in hsc module (#68)
msimet Nov 5, 2015
bd0f709
Merge branch 'master' into #68
msimet Jun 21, 2016
780767a
Merge branch 'master' into #68
msimet Nov 4, 2016
8ae7821
Merge branch 'master' into #68
msimet Jun 21, 2018
a9e392f
Merge branch 'master' into #68
msimet Jul 11, 2018
d7ef8e8
Fix bug in BinnedScatterPlot inheritance (#68)
msimet Jul 12, 2018
fb0eaac
Fix Python 3 printing bug in BinnedScatterPlotSysTest (#68)
msimet Jul 12, 2018
2ed7cef
Merge branch 'master' into #68
msimet Jul 14, 2018
2501925
Merge branch 'master' into #68
msimet Nov 17, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
7/12/18: Add BinnedScatterPlotSysTest class (issue #68)
7/11/18: Update code to python3
3/17/16: Update documentation to Sphinx standard and add documentation build files (issue #17)
2/17/16: Changes to correlation function plots & documentation (issue #77)
Expand Down
3 changes: 2 additions & 1 deletion stile/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
from .treecorr_utils import ReadTreeCorrResultsFile
from .data_handler import DataHandler
from .sys_tests import (StatSysTest, CorrelationFunctionSysTest, ScatterPlotSysTest,
WhiskerPlotSysTest, HistogramSysTest)
WhiskerPlotSysTest, HistogramSysTest, BinnedScatterPlotSysTest)

12 changes: 8 additions & 4 deletions stile/hsc/base_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ class CCDSingleEpochStileConfig(lsst.pex.config.Config):
"ScatterPlotStarVsPSFG1", "ScatterPlotStarVsPSFG2",
"ScatterPlotStarVsPSFSigma", "ScatterPlotResidualVsPSFG1",
"ScatterPlotResidualVsPSFG2", "ScatterPlotResidualVsPSFSigma",
"ScatterPlotResidualSigmaVsPSFMag"
"ScatterPlotResidualSigmaVsPSFMag",
"RMSESky", "RMSEChip", "CountPerMagnitude"
])
treecorr_kwargs = lsst.pex.config.DictField(doc="extra kwargs to control TreeCorr",
keytype=str, itemtype=str,
Expand Down Expand Up @@ -744,7 +745,8 @@ class VisitSingleEpochStileConfig(CCDSingleEpochStileConfig):
"ScatterPlotStarVsPSFG1", "ScatterPlotStarVsPSFG2",
"ScatterPlotStarVsPSFSigma", "ScatterPlotResidualVsPSFG1",
"ScatterPlotResidualVsPSFG2", "ScatterPlotResidualVsPSFSigma",
"ScatterPlotResidualSigmaVsPSFMag"
"ScatterPlotResidualSigmaVsPSFMag",
"RMSESky", "RMSEChip", "CountPerMagnitude"
])
treecorr_kwargs = lsst.pex.config.DictField(doc="extra kwargs to control treecorr",
keytype=str, itemtype=str,
Expand Down Expand Up @@ -1062,7 +1064,8 @@ class PatchSingleEpochStileConfig(CCDSingleEpochStileConfig):
"ScatterPlotStarVsPSFG1", "ScatterPlotStarVsPSFG2",
"ScatterPlotStarVsPSFSigma", "ScatterPlotResidualVsPSFG1",
"ScatterPlotResidualVsPSFG2", "ScatterPlotResidualVsPSFSigma",
"ScatterPlotResidualSigmaVsPSFMag"
"ScatterPlotResidualSigmaVsPSFMag",
"RMSESky", "RMSEChip", "CountPerMagnitude"
])
do_hsm = lsst.pex.config.Field(dtype=bool, default=True, doc="Use HSM shapes for galaxies?")
treecorr_kwargs = lsst.pex.config.DictField(doc="extra kwargs to control TreeCorr",
Expand Down Expand Up @@ -1159,7 +1162,8 @@ class TractSingleEpochStileConfig(CCDSingleEpochStileConfig):
"ScatterPlotStarVsPSFG1", "ScatterPlotStarVsPSFG2",
"ScatterPlotStarVsPSFSigma", "ScatterPlotResidualVsPSFG1",
"ScatterPlotResidualVsPSFG2", "ScatterPlotResidualVsPSFSigma",
"ScatterPlotResidualSigmaVsPSFMag"
"ScatterPlotResidualSigmaVsPSFMag",
"RMSESky", "RMSEChip", "CountPerMagnitude"
])
do_hsm = lsst.pex.config.Field(dtype=bool, default=True, doc="Use HSM shapes for galaxies?")
treecorr_kwargs = lsst.pex.config.DictField(doc="extra kwargs to control treecorr",
Expand Down
82 changes: 81 additions & 1 deletion stile/hsc/sys_test_adapters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
sys_test_adapters.py: Contains classes to wrap Stile systematics tests with functions necessary to run the tests via the
HSC/LSST pipeline.
"""
Expand Down Expand Up @@ -474,6 +474,79 @@ def __call__(self, task_config, *data, **kwargs):
new_data = [self.fixArray(d) for d in data]
return self.sys_test(*new_data, per_ccd_stat=per_ccd_stat)

class RMSE1SkyAdapter(NoConfigShapeSysTestAdapter):
def __init__(self, config):
self.shape_type = 'sky'
self.config = config
self.sys_test = sys_tests.BinnedScatterPlotSysTest(x_field='mag', y_field='g1', w_field='w', method='rms')
self.name = 'rms_e1_sky'
self.setupMasks(['galaxy'])

class RMSE2SkyAdapter(NoConfigShapeSysTestAdapter):
def __init__(self, config):
self.shape_type = 'sky'
self.config = config
self.sys_test = sys_tests.BinnedScatterPlotSysTest(x_field='mag', y_field='g2', w_field='w', method='rms')
self.name = 'rms_e2_sky'
self.setupMasks(['galaxy'])

class RMSE1ChipAdapter(NoConfigShapeSysTestAdapter):
def __init__(self, config):
self.shape_type = 'chip'
self.config = config
self.sys_test = sys_tests.BinnedScatterPlotSysTest(x_field='mag', y_field='g1', w_field='w', method='rms')
self.name = 'rms_e1_chip'
self.setupMasks(['galaxy'])

class RMSE2ChipAdapter(NoConfigShapeSysTestAdapter):
def __init__(self, config):
self.shape_type = 'chip'
self.config = config
self.sys_test = sys_tests.BinnedScatterPlotSysTest(x_field='mag', y_field='g2', w_field='w', method='rms')
self.name = 'rms_e2_chip'
self.setupMasks(['galaxy'])

class CountPerMagnitudeAdapter(BaseSysTestAdapter):
def __init__(self, config):
self.config = config
self.sys_test = sys_tests.BinnedScatterPlotSysTest(x_field='mag', w_field='w', method='count')
self.name = 'count_per_mag'
self.setupMasks(['galaxy'])

class RMSESkyAdapter(ShapeSysTestAdapter):
def __init__(self, config):
self.shape_type = 'sky'
self.config = config
self.sys_test = sys_tests.BinnedScatterPlotSysTest(x_field='mag', y_field='g', w_field='w', method='rms')
self.name = 'rms_e_sky'
self.setupMasks(['galaxy'])

def __call__(self, task_config, *data, **kwargs):
new_data = []
for d in data:
if d is None:
new_data.append(d)
else:
# We'll just make a new array using numpy.rec.fromarrays that includes |g|.
# First collect everything else, with a placeholder [] for |g|
list_of_arrays = [d[field] if field is not 'g' else [] for field in self.sys_test.required_quantities]
shape_col_1 = 'g1_'+self.shape_type
shape_col_2 = 'g2_'+self.shape_type
# Then replace that empty list with |g|
list_of_arrays[self.sys_test.required_quantities.index('g')] = (
numpy.sqrt(d[shape_col_1]**2+d[shape_col_2]**2))
new_data.append(numpy.rec.fromarrays(list_of_arrays, self.sys_test.required_quantities))
return self.sys_test(*new_data, **kwargs)

class RMSEChipAdapter(RMSESkyAdapter):
# We can use the same __call__ as RMSESKY, we just need to switch self.shape_type to 'chip'
def __init__(self, config):
self.shape_type = 'chip'
self.config = config
self.sys_test = sys_tests.BinnedScatterPlotSysTest(x_field='mag', y_field='g', w_field='w', method='rms')
self.name = 'rms_e_sky'
self.setupMasks(['galaxy'])

adapter_registry.register("StatsPSFFlux", StatsPSFFluxAdapter)
adapter_registry.register("GalaxyShear", GalaxyShearAdapter)
adapter_registry.register("BrightStarShear", BrightStarShearAdapter)
Expand All @@ -492,3 +565,10 @@ def __call__(self, task_config, *data, **kwargs):
adapter_registry.register("ScatterPlotResidualVsPSFSigma", ScatterPlotResidualVsPSFSigmaAdapter)
adapter_registry.register("ScatterPlotResidualSigmaVsPSFMag",
ScatterPlotResidualSigmaVsPSFMagAdapter)
adapter_registry.register("RMSE1Sky", RMSE1SkyAdapter)
adapter_registry.register("RMSE2Sky", RMSE2SkyAdapter)
adapter_registry.register("RMSE1Chip", RMSE1ChipAdapter)
adapter_registry.register("RMSE2Chip", RMSE2ChipAdapter)
adapter_registry.register("CountPerMagnitude", CountPerMagnitudeAdapter)
adapter_registry.register("RMSESky", RMSE1SkyAdapter)
adapter_registry.register("RMSEChip", RMSE1ChipAdapter)
Loading