Skip to content

Commit

Permalink
factor out external data dir
Browse files Browse the repository at this point in the history
  • Loading branch information
yymao committed Apr 11, 2020
1 parent 138cf9a commit 8ef429c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions descqa/ColorDistribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class ColorDistribution(BaseValidationTest):
summary_output_file = 'summary.txt'
plot_pdf_file = 'plot_pdf.png'
plot_cdf_file = 'plot_cdf.png'
sdss_path = '/global/cfs/cdirs/lsst/groups/CS/descqa/data/rongpu/SpecPhoto_sdss_mgs_extinction_corrected.fits'
deep2_path = '/global/cfs/cdirs/lsst/groups/CS/descqa/data/rongpu/DEEP2_uniq_Terapix_Subaru_trimmed_wights_added.fits'

def __init__(self, **kwargs): # pylint: disable=W0231

Expand Down Expand Up @@ -77,6 +75,9 @@ def __init__(self, **kwargs): # pylint: disable=W0231
self.binsize = self.bins[1] - self.bins[0]

# Load validation catalog and define catalog-specific properties
self.sdss_path = os.path.join(self.external_data_dir, 'rongpu', 'SpecPhoto_sdss_mgs_extinction_corrected.fits')
self.deep2_path = os.path.join(self.external_data_dir, 'rongpu', 'DEEP2_uniq_Terapix_Subaru_trimmed_wights_added.fits')

if self.validation_catalog == 'SDSS':
obs_path = self.sdss_path
obscat = Table.read(obs_path)
Expand Down
2 changes: 1 addition & 1 deletion descqa/DensityVersusSkyPosition.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self,**kwargs): # pylint: disable=W0231

self.kwargs = kwargs
self.test_name = kwargs['test_name']
self.validation_path = kwargs['validation_map_filename']
self.validation_path = os.path.join(self.external_data_dir, kwargs['validation_map_filename'])
self.nside = kwargs['nside']
self.validation_data = hp.ud_grade(hp.read_map(self.validation_path), nside_out=self.nside)
self.xlabel = kwargs['xlabel']
Expand Down
1 change: 1 addition & 0 deletions descqa/ImgPkTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(self, raft=None, rebinning=None, validation_data_path=None,
if validation_data_path is None:
self.validation_data = None
else:
validation_data_path = os.path.join(self.external_data_dir, validation_data_path)
self.validation_data = Table.read(validation_data_path)
self.validation_data_label = validation_data_label
self.pixel_scale = pixel_scale
Expand Down
1 change: 1 addition & 0 deletions descqa/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class BaseValidationTest(object):
"""

data_dir = os.path.join(os.path.dirname(__file__), 'data')
external_data_dir = "/global/cfs/cdirs/lsst/groups/CS/descqa/data"

def __init__(self, **kwargs):
pass
Expand Down
2 changes: 1 addition & 1 deletion descqa/configs/DensityVersusExtinction.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
subclass_name: DensityVersusSkyPosition.DensityVersusSkyPosition
test_name: Density versus sky position
validation_map_filename: /global/projecta/projectdirs/lsst/groups/LSS/DC1/systematics/lambda_sfd_ebv.fits
validation_map_filename: DensityVersusExtinction/lambda_sfd_ebv.fits
nside: 1024
xlabel: 'E(B-V)'
description: Variation of mean density of detected objects as a function of extinction (or other map)
2 changes: 1 addition & 1 deletion descqa/configs/image_power_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ subclass_name: ImgPkTest.ImgPkTest
description: 'Compute power spectrum of the background. It uses validation data from run #9 in DC2-production issue #140 (PhoSim full background model with sources in it)'
included_by_default: true
rebinning: 16
validation_data_path: /global/projecta/projectdirs/lsst/groups/SSim/DC2/img_pk/reference_w_sources_R22.fits.gz
validation_data_path: image_power_spec/reference_w_sources_R22.fits.gz

0 comments on commit 8ef429c

Please sign in to comment.