Commit 4168b748 authored by Zhang Xin's avatar Zhang Xin
Browse files

update header; fix sls bug: psf A and B error, modify the band bounders of sls

parent 877d689f
Pipeline #8340 failed with stage
in 0 seconds
...@@ -533,8 +533,8 @@ def generateExtensionHeader(chip, xlen=9216, ylen=9232, ra=60, dec=-40, pa=-23.4 ...@@ -533,8 +533,8 @@ def generateExtensionHeader(chip, xlen=9216, ylen=9232, ra=60, dec=-40, pa=-23.4
# h_ext['CCDCHIP'] = CCDID[k - 1].rjust(2, '0') # h_ext['CCDCHIP'] = CCDID[k - 1].rjust(2, '0')
# h_ext['CCDLABEL'] = filters[k-1] + '-' + filterID[k-1] # h_ext['CCDLABEL'] = filters[k-1] + '-' + filterID[k-1]
# h_ext['FILTER'] = filters[k-1] # h_ext['FILTER'] = filters[k-1]
h_ext['CHIPID'] = str(chip.chipID).rjust(2, '0') h_ext['DETECTOR'] = str(chip.chipID).rjust(2, '0')
h_ext['CHIPLABL'] = chip.chip_name h_ext['DETLABEL'] = chip.chip_name
h_ext['FILTER'] = chip.filter_type h_ext['FILTER'] = chip.filter_type
h_ext['NAXIS1'] = xlen h_ext['NAXIS1'] = xlen
h_ext['NAXIS2'] = ylen h_ext['NAXIS2'] = ylen
......
...@@ -37,9 +37,9 @@ class FilterParam(object): ...@@ -37,9 +37,9 @@ class FilterParam(object):
# [TODO] # [TODO]
"FGS": [5000.0, 8000.0, 3000.0, 11000.0, 0.6500, 0.164, 0., 30.], "FGS": [5000.0, 8000.0, 3000.0, 11000.0, 0.6500, 0.164, 0., 30.],
"GU": [0.0, 0.0, 2550.0, 4200.0, 1.0, 0.037, 14.0, 26.0], "GU": [0.0, 0.0, 2550.0, 10000.0, 1.0, 0.037, 14.0, 26.0],
"GV": [0.0, 0.0, 4000.0, 6500.0, 1.0, 0.037, 14.0, 26.0], "GV": [0.0, 0.0, 3500.0, 6500.0, 1.0, 0.037, 14.0, 26.0],
"GI": [0.0, 0.0, 6200.0, 10000.0, 1.0, 0.037, 14.0, 26.0], "GI": [0.0, 0.0, 5000.0, 10000.0, 1.0, 0.037, 14.0, 26.0],
} }
else: else:
filtP = filter_param filtP = filter_param
......
...@@ -285,7 +285,7 @@ class Galaxy(MockObject): ...@@ -285,7 +285,7 @@ class Galaxy(MockObject):
for i in range(len(bandpass_list)): for i in range(len(bandpass_list)):
branges[i, 0] = bandpass_list[i].blue_limit * 10 branges[i, 0] = bandpass_list[i].blue_limit * 10
branges[i, 1] = bandpass_list[i].red_limit * 10 branges[i, 1] = bandpass_list[i].red_limit * 10
for i in range(len(bandpass_list)): for i in range(len(bandpass_list)):
# bandpass = bandpass_list[i] # bandpass = bandpass_list[i]
brange = branges[i] brange = branges[i]
...@@ -335,7 +335,7 @@ class Galaxy(MockObject): ...@@ -335,7 +335,7 @@ class Galaxy(MockObject):
pos_img_local[1] = pos_img.y - y_start pos_img_local[1] = pos_img.y - y_start
nnx = 0 nnx = 0
nny = 0 nny = 0
for order in ["B", "A"]: for order in ["A", "B"]:
EXTRA = False EXTRA = False
if self.getMagFilter(filt) <= filt.mag_saturation-2.: if self.getMagFilter(filt) <= filt.mag_saturation-2.:
EXTRA = True EXTRA = True
...@@ -362,16 +362,18 @@ class Galaxy(MockObject): ...@@ -362,16 +362,18 @@ class Galaxy(MockObject):
for order in ["C", "D", "E"]: for order in ["C", "D", "E"]:
galImg_List.append(galImg) galImg_List.append(galImg)
except: except:
psf, pos_shear = psf_model.get_PSF(chip=chip, pos_img=pos_img) try:
star_p = galsim.Convolve(psf, gal) psf, pos_shear = psf_model.get_PSF(chip=chip, pos_img=pos_img)
galImg = star_p.drawImage(wcs=chip_wcs_local, offset=offset) star_p = galsim.Convolve(psf, gal)
galImg.setOrigin(0, 0) galImg = star_p.drawImage(wcs=chip_wcs_local, offset=offset)
if np.sum(np.isnan(galImg.array)) > 0: galImg.setOrigin(0, 0)
# ERROR happens if np.sum(np.isnan(galImg.array)) > 0:
return 2, pos_shear # ERROR happens
for order in ["A", "B", "C", "D", "E"]: return 2, pos_shear
galImg_List.append(galImg) for order in ["A", "B", "C", "D", "E"]:
galImg_List.append(galImg)
except Exception as e:
continue
# starImg = gal.drawImage( # starImg = gal.drawImage(
# wcs=chip_wcs_local, offset=offset, method='real_space') # wcs=chip_wcs_local, offset=offset, method='real_space')
......
...@@ -445,7 +445,7 @@ class MockObject(object): ...@@ -445,7 +445,7 @@ class MockObject(object):
pos_img_local[1] = pos_img.y - y_start pos_img_local[1] = pos_img.y - y_start
nnx = 0 nnx = 0
nny = 0 nny = 0
for order in ["B", "A"]: for order in ["A", "B"]:
EXTRA = False EXTRA = False
if self.getMagFilter(filt) <= filt.mag_saturation-2.: if self.getMagFilter(filt) <= filt.mag_saturation-2.:
EXTRA = True EXTRA = True
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment