Skip to content

Commit

Permalink
add total counts per fiber metric
Browse files Browse the repository at this point in the history
  • Loading branch information
rstaten committed Jan 24, 2019
1 parent 5cd4452 commit a61b581
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions py/desispec/qa/qa_quicklook.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,8 +1147,9 @@ def run_qa(self,frame,inputs):
threshold=[param['CUTBINS']*ii for ii in rdnoise_fib]
#- compare the flux sum to threshold

passfibers=np.where(frame.flux.sum(axis=1)>threshold)[0]
ngoodfibers=passfibers.shape[0] - param["N_KNOWN_BROKEN_FIBERS"]
totcounts=frame.flux.sum(axis=1)
passfibers=np.where(totcounts>threshold)[0]
ngoodfibers=passfibers.shape[0]
good_fibers=np.array([0]*frame.nspec)
good_fibers[passfibers]=1 #- assign 1 for good fiber

Expand All @@ -1166,7 +1167,7 @@ def run_qa(self,frame,inputs):
retval["BOTTOM_MAX_WAVE_INDEX"]=int(bottommax)
retval["TOP_MIN_WAVE_INDEX"]=int(topmin)

retval["METRICS"]={"NGOODFIB": ngoodfibers, "GOOD_FIBERS": good_fibers}
retval["METRICS"]={"NGOODFIB": ngoodfibers, "GOOD_FIBERS": good_fibers, "TOTCOUNT_FIB": totcounts}

###############################################################
# This section is for adding QA metrics for plotting purposes #
Expand Down

0 comments on commit a61b581

Please sign in to comment.