diff --git a/SpecGen/SpecGenerator.py b/SpecGen/SpecGenerator.py index 6342053b911f90ab84f749bada5891875094922a..d9e85e86f7d32b8b268857b15807f01bb6447356 100644 --- a/SpecGen/SpecGenerator.py +++ b/SpecGen/SpecGenerator.py @@ -185,13 +185,15 @@ class SpecGenerator(object): Aimg_cal = Aimg_[y_cent_pos-y_range:y_cent_pos+y_range+1, specRangeImg] ids = Aimg_cal > self.saturation - #1. saturation pixel number, 2. total pixel number, 3 saturation ratio, 4.flux ratio in photo aperture - saturePix = [0,0,0, 0] + #1. saturation pixel number, 2. total pixel number, 3 saturation ratio, 4.flux ratio in photo aperture,5.max value,6.min value + saturePix = np.zeros(6) saturePix[0] = Aimg_cal[ids].shape[0] saturePix[1] = Aimg_cal.shape[0]*Aimg_cal.shape[1] saturePix[2] = saturePix[0]/saturePix[1] saturePix[3] = fluxRatio + saturePix[4] = np.amax(Aimg_cal) + saturePix[5] = np.amin(Aimg_cal) idx = (wave_pix >= bRange[0]-100) idx1 = (wave_pix[idx] <= bRange[1]+100) @@ -308,13 +310,15 @@ class SpecGenerator(object): Aimg_cal = Aimg_[y_cent_pos-y_range:y_cent_pos+y_range+1, specRangeImg] ids = Aimg_cal > self.saturation - #1. saturation pixel number, 2. total pixel number, 3 saturation ratio, 4.flux ratio in photo aperture - saturePix = [0,0,0,0] + #1. saturation pixel number, 2. total pixel number, 3 saturation ratio, 4.flux ratio in photo aperture,5.max value,6.min value + saturePix = np.zeros(6) saturePix[0] = Aimg_cal[ids].shape[0] saturePix[1] = Aimg_cal.shape[0]*Aimg_cal.shape[1] saturePix[2] = saturePix[0]/saturePix[1] saturePix[3] = fluxRatio + saturePix[4] = np.amax(Aimg_cal) + saturePix[5] = np.amin(Aimg_cal) idx = (wave_pix >= bRange[0]-100) idx1 = (wave_pix[idx] <= bRange[1]+100) diff --git a/SpecWindow/specWin.py b/SpecWindow/specWin.py index d9aa5ce90e592a713c539509501e3bbf9f99f359..659e96cae3ba04efed61b488a5945f4aa0320d91 100644 --- a/SpecWindow/specWin.py +++ b/SpecWindow/specWin.py @@ -423,7 +423,7 @@ class Example(QMainWindow): g_q = float(self.gqText.text()) specTab, specImg, img, sutPix=specG.generateSpec1dforGal(s_n = g_sn, re = g_re, pa = g_pa,q_ell = g_q,limitfluxratio=0.8) - self.outinfo.setText('saturation: 90000 e- , saturation pixel number: %d, total pixel number: %d, saturation ratio: %f'%(sutPix[0],sutPix[1],sutPix[2])) + self.outinfo.setText('saturation: 90000 e- , saturation pixel number: %d, total pixel number: %d, saturation ratio: %f, pixel value maximun: %d e-, pixel value minimum: %d e-'%(sutPix[0],sutPix[1],sutPix[2],sutPix[4],sutPix[5])) # self.outinfo.adjustSize() spec_orig = np.loadtxt(sedFn)