Skip to content

Commit

Permalink
don't output jsons for each QA
Browse files Browse the repository at this point in the history
  • Loading branch information
rstaten committed Jan 25, 2019
1 parent 13ffbbe commit 931fc5f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
76 changes: 38 additions & 38 deletions py/desispec/qa/qa_quicklook.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ def run_qa(self,image,inputs):
retval["PARAMS"]=param

#get_outputs(qafile,qafig,retval,'plot_traceshifts')
outfile = qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# outfile = qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
return retval

def get_default_config(self):
Expand Down Expand Up @@ -475,9 +475,9 @@ def run_qa(self,image,inputs):

###############################################################

if qafile is not None:
outfile=qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
if qafig is not None:
fig.plot_bias_overscan(retval,qafig,plotconf=plotconf,hardplots=hardplots)
log.debug("Output QA fig {}".format(qafig))
Expand Down Expand Up @@ -693,9 +693,9 @@ def run_qa(self,image,inputs):

###############################################################

if qafile is not None:
outfile=qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
if qafig is not None:
fig.plot_RMS(retval,qafig,plotconf=plotconf,hardplots=hardplots)
log.debug("Output QA fig {}".format(qafig))
Expand Down Expand Up @@ -930,9 +930,9 @@ def run_qa(self,image,inputs):

###############################################################

if qafile is not None:
outfile=qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
if qafig is not None:
fig.plot_XWSigma(retval,qafig,plotconf=plotconf,hardplots=hardplots)
log.debug("Output QA fig {}".format(qafig))
Expand Down Expand Up @@ -1040,9 +1040,9 @@ def run_qa(self,image,inputs):

###############################################################

if qafile is not None:
outfile=qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
if qafig is not None:
fig.plot_countpix(retval,qafig,plotconf=plotconf,hardplots=hardplots)
log.debug("Output QA fig {}".format(qafig))
Expand Down Expand Up @@ -1175,9 +1175,9 @@ def run_qa(self,frame,inputs):

###############################################################

if qafile is not None:
outfile=qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
if qafig is not None:
fig.plot_countspectralbins(retval,qafig,plotconf=plotconf,hardplots=hardplots)
log.debug("Output QA fig {}".format(qafig))
Expand Down Expand Up @@ -1282,9 +1282,9 @@ def run_qa(self,frame,inputs):

###############################################################

if qafile is not None:
outfile=qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
if qafig is not None:
fig.plot_sky_continuum(retval,qafig,plotconf=plotconf,hardplots=hardplots)
log.debug("Output QA fig {}".format(qafig))
Expand Down Expand Up @@ -1428,9 +1428,9 @@ def run_qa(self,frame,inputs):
zerorband=0.
retval["METRICS"]={"SKYRBAND_FIB":zerospec,"SKYRBAND":zerorband}

if qafile is not None:
outfile=qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))

return retval

Expand Down Expand Up @@ -1536,9 +1536,9 @@ def run_qa(self,frame,inputs):

###############################################################

if qafile is not None:
outfile=qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
if qafig is not None:
fig.plot_sky_peaks(retval,qafig,plotconf=plotconf,hardplots=hardplots)
log.debug("Output QA fig {}".format(qafig))
Expand Down Expand Up @@ -1645,9 +1645,9 @@ def run_qa(self,frame,skymodel,inputs):

###############################################################

if qafile is not None:
outfile=qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
if qafig is not None:
fig.plot_residuals(retval,qafig,plotconf=plotconf,hardplots=hardplots)
log.debug("Output QA fig {}".format(qafig))
Expand Down Expand Up @@ -1872,9 +1872,9 @@ def run_qa(self,frame,inputs):

###############################################################

if qafile is not None:
outfile=qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
if qafig is not None:
fig.plot_integral(retval,qafig,plotconf=plotconf,hardplots=hardplots)
log.debug("Output QA fig {}".format(qafig))
Expand Down Expand Up @@ -1995,9 +1995,9 @@ def run_qa(self,frame,inputs):

###############################################################

if qafile is not None:
outfile=qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
if qafig is not None:
fig.plot_SNR(retval,qafig,objlist,fitsnr,rescut,sigmacut,plotconf=plotconf,hardplots=hardplots)
log.debug("Output QA fig {}".format(qafig))
Expand Down Expand Up @@ -2117,9 +2117,9 @@ def run_qa(self,file_psf,inputs):

###############################################################

if qafile is not None:
outfile=qa.write_qa_ql(qafile,retval)
log.debug("Output QA data is in {}".format(outfile))
# if qafile is not None:
# outfile=qa.write_qa_ql(qafile,retval)
# log.debug("Output QA data is in {}".format(outfile))
if qafig is not None:
fig.plot_lpolyhist(retval,qafig,plotconf=plotconf,hardplots=hardplots)
log.debug("Output QA fig {}".format(qafig))
Expand Down
12 changes: 6 additions & 6 deletions py/desispec/quicklook/qlconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,19 +248,19 @@ def dump_qa(self):
Name and default locations of files are handled by desispec.io.meta.findfile
"""
#- QA level outputs
qa_outfile = {}
#qa_outfile = {}
qa_outfig = {}
for PA in self.palist:
for QA in self.qalist[PA]:
qa_outfile[QA] = self.io_qa(QA)[0]
#qa_outfile[QA] = self.io_qa(QA)[0]
qa_outfig[QA] = self.io_qa(QA)[1]

#- make path if needed
path = os.path.normpath(os.path.dirname(qa_outfile[QA]))
path = os.path.normpath(os.path.dirname(qa_outfig[QA]))
if not os.path.exists(path):
os.makedirs(path)

return (qa_outfile,qa_outfig)
return (qa_outfig)
# return ((qa_outfile,qa_outfig),(qa_pa_outfile,qa_pa_outfig))

@property
Expand All @@ -273,8 +273,8 @@ def qaargs(self):
params=self._qaparams(qa)
qaopts[qa]={'night' : self.night, 'expid' : self.expid,
'camera': self.camera, 'paname': PA, 'PSFFile': self.psf_filename,
'amps': self.amps, 'qafile': self.dump_qa()[0][qa],
'qafig': self.dump_qa()[1][qa], 'FiberMap': self.fibermap,
'amps': self.amps, #'qafile': self.dump_qa()[0][qa],
'qafig': self.dump_qa()[qa], 'FiberMap': self.fibermap,
'param': params, 'refKey':self._qaRefKeys[qa],
'singleqa' : self.singqa,
'plotconf':self.plotconf, 'hardplots': self.hardplots
Expand Down

0 comments on commit 931fc5f

Please sign in to comment.