Skip to content

Commit 11e327d

Browse files
committed
Changed FIBER STATUS to -1 initially
1 parent 493f971 commit 11e327d

2 files changed

Lines changed: 4 additions & 25 deletions

File tree

py/specex/qa.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ def trace_psf_qa(psf_filename, broken_fiber_list):
4040
if fiber not in brokenfibers and fiber+1 not in brokenfibers:
4141
log.error("overlapping traces for fibers {} and {} in {}".format(fiber, fiber+1, psf_filename))
4242
failcount += 1
43-
log.info(f'Failcount is now {failcount}')
4443
bad_fibers.append(fiber)
45-
log.info(f'Bad fibers are now {bad_fibers}')
4644
bad_fibers.append(fiber+1)
47-
log.info(f'Bad fibers are now {bad_fibers}')
48-
log.info(f'Fibers {fiber} and {fiber+1} are flagged')
45+
log.debug(f'Fibers {fiber} and {fiber+1} are flagged as bad')
4946
log.info(f'Failcount is {failcount}')
5047

5148
return failcount, bad_fibers
@@ -59,30 +56,12 @@ def specex_psf_qa(opts):
5956
failcount, bad_fibers = trace_psf_qa(psf_filename, broken_fiber_list)
6057
if len(bad_fibers)>0:
6158
log.info(f'Setting Status of Bad Fibers {bad_fibers} to 4 in PSF file {psf_filename}')
62-
other_psf_hdulist=fits.open(psf_filename)
63-
i=np.where(other_psf_hdulist["PSF"].data["PARAM"]=="STATUS")[0][0]
64-
status_of_fibers = \
65-
other_psf_hdulist["PSF"].data["COEFF"][i][:,0].astype(int)
66-
log.info(f'Status of fibers before: {status_of_fibers}')
6759
with fits.open(psf_filename, mode='update',memmap=False) as file:
6860
index = np.where(file['PSF'].data["PARAM"]=="STATUS")[0][0]
69-
# log.info(f'Index of STATUS parameter is {index}')
7061
for fiber in bad_fibers:
7162
file['PSF'].data["COEFF"][index][fiber, 0] = 4
72-
# status_of_fibers = \
73-
# file["PSF"].data["COEFF"][i][:,0].astype(int)
74-
# log.info(f'Status of fibers: {status_of_fibers}')
75-
log.info(f'Bad fibers {bad_fibers} have been set to 4 in PSF file {psf_filename}')
63+
log.debug(f'Bad fibers {bad_fibers} have been set to 4 in PSF file {psf_filename}')
7664
file.flush()
77-
log.info(f'File now closed')
7865

7966
log.info(f'QA complete for PSF file {psf_filename} with failcount {failcount} and bad fibers {bad_fibers}')
80-
other_psf_hdulist=fits.open(psf_filename,memmap=False)
81-
82-
# look at what fibers where actually fit
83-
i=np.where(other_psf_hdulist["PSF"].data["PARAM"]=="STATUS")[0][0]
84-
status_of_fibers = \
85-
other_psf_hdulist["PSF"].data["COEFF"][i][:,0].astype(int)
86-
log.info(f'Status of fibers after: {status_of_fibers}')
87-
other_psf_hdulist.close()
8867
return failcount

src/specex_psf_fitter.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,7 +1862,7 @@ bool specex::PSF_Fitter::FitIndividualSpotFluxes(std::vector<specex::Spot_p>& sp
18621862
specex::Spot_p& spot = spots[s];
18631863
spot->eflux = 0;
18641864
spot->flux = 0;
1865-
spot->status=4;
1865+
spot->status=-1;
18661866

18671867
bool ok = FitOneSpot(spot);
18681868

@@ -1908,7 +1908,7 @@ bool specex::PSF_Fitter::FitIndividualSpotPositions(std::vector<specex::Spot_p>&
19081908
spot->initial_yc = spot->yc;
19091909
spot->eflux = 0;
19101910
spot->flux = 0;
1911-
spot->status=4;
1911+
spot->status=-1;
19121912

19131913
bool ok = FitOneSpot(spot);
19141914

0 commit comments

Comments
 (0)