Skip to content

Commit

Permalink
Add ability to select refcat collection name.
Browse files Browse the repository at this point in the history
  • Loading branch information
erykoff committed Aug 30, 2023
1 parent 37724b0 commit a0c0181
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions tests/fgcmcalTestBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ def _testFgcmMakeLut(self, instName, testName, nBand, i0Std, i0Recon, i10Std, i1
self.assertEqual(np.min(tputs), 0.0)
self.assertGreater(np.max(tputs), 0.0)

def _testFgcmBuildStarsTable(self, instName, testName, queryString, visits, nStar, nObs):
def _testFgcmBuildStarsTable(self, instName, testName, queryString, visits, nStar, nObs,
refcatCollection="refcats/gen2"):
"""Test running of FgcmBuildStarsTableTask
Parameters
Expand All @@ -244,6 +245,8 @@ def _testFgcmBuildStarsTable(self, instName, testName, queryString, visits, nSta
Number of stars expected.
nObs : `int`
Number of observations of stars expected.
refcatCollection : `str`, optional
Name of reference catalog collection.
"""
instCamel = instName.title()

Expand All @@ -258,7 +261,7 @@ def _testFgcmBuildStarsTable(self, instName, testName, queryString, visits, nSta
'fgcmBuildStarsTable%s.yaml' % (instCamel)),
configFiles=configFiles,
inputCollections=[f'{instName}/{testName}/lut',
'refcats/gen2'],
refcatCollection],
outputCollection=outputCollection,
queryString=queryString,
registerDatasetTypes=True)
Expand All @@ -277,7 +280,8 @@ def _testFgcmBuildStarsTable(self, instName, testName, queryString, visits, nSta
instrument=instName)
self.assertEqual(len(starObs), nObs)

def _testFgcmBuildFromIsolatedStars(self, instName, testName, queryString, visits, nStar, nObs):
def _testFgcmBuildFromIsolatedStars(self, instName, testName, queryString, visits, nStar, nObs,
refcatCollection="refcats/gen2"):
"""Test running of FgcmBuildFromIsolatedStarsTask.
Parameters
Expand All @@ -294,6 +298,8 @@ def _testFgcmBuildFromIsolatedStars(self, instName, testName, queryString, visit
Number of stars expected.
nObs : `int`
Number of observations of stars expected.
refcatCollection : `str`, optional
Name of reference catalog collection.
"""
instCamel = instName.title()

Expand All @@ -310,7 +316,7 @@ def _testFgcmBuildFromIsolatedStars(self, instName, testName, queryString, visit
'fgcmBuildFromIsolatedStars%s.yaml' % (instCamel)),
configFiles=configFiles,
inputCollections=[f'{instName}/{testName}/lut',
'refcats/gen2'],
refcatCollection],
outputCollection=outputCollection,
queryString=queryString,
registerDatasetTypes=True)
Expand Down Expand Up @@ -637,7 +643,8 @@ def _testFgcmOutputProducts(self, instName, testName,
ratio = np.median(testResp/testResp2)
self.assertFloatsAlmostEqual(testResp/ratio, testResp2, atol=0.04)

def _testFgcmMultiFit(self, instName, testName, queryString, visits, zpOffsets):
def _testFgcmMultiFit(self, instName, testName, queryString, visits, zpOffsets,
refcatCollection="refcats/gen2"):
"""Test running the full pipeline with multiple fit cycles.
Parameters
Expand All @@ -652,6 +659,8 @@ def _testFgcmMultiFit(self, instName, testName, queryString, visits, zpOffsets):
List of visits to calibrate.
zpOffsets : `np.ndarray`
Zeropoint offsets expected.
refcatCollection : `str`, optional
Name of reference catalog collection.
"""
instCamel = instName.title()

Expand Down Expand Up @@ -679,7 +688,7 @@ def _testFgcmMultiFit(self, instName, testName, queryString, visits, zpOffsets):
f'fgcmFullPipeline{instCamel}.yaml'),
configFiles=configFiles,
inputCollections=[f'{instName}/{testName}/lut',
'refcats/gen2'],
refcatCollection],
outputCollection=outputCollection,
queryString=queryString,
registerDatasetTypes=True)
Expand Down

0 comments on commit a0c0181

Please sign in to comment.