Commit 2166c80e authored by Zhang Xin's avatar Zhang Xin
Browse files

pep8

parent 45682570
Pipeline #7118 failed with stage
in 0 seconds
...@@ -325,23 +325,25 @@ class Galaxy(MockObject): ...@@ -325,23 +325,25 @@ class Galaxy(MockObject):
galImg_List = [] galImg_List = []
try: try:
pos_img_local = [0,0] pos_img_local = [0, 0]
x_start = chip.x_cen/chip.pix_size - chip.npix_x / 2. x_start = chip.x_cen/chip.pix_size - chip.npix_x / 2.
y_start = chip.y_cen/chip.pix_size - chip.npix_y / 2. y_start = chip.y_cen/chip.pix_size - chip.npix_y / 2.
pos_img_local[0] = pos_img.x - x_start pos_img_local[0] = pos_img.x - x_start
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 ["A","B"]: for order in ["A", "B"]:
psf, pos_shear = psf_model.get_PSF( psf, pos_shear = psf_model.get_PSF(
chip, pos_img_local=pos_img_local, bandNo=i+1, galsimGSObject=True, g_order=order, grating_split_pos=grating_split_pos) chip, pos_img_local=pos_img_local, bandNo=i+1, galsimGSObject=True, g_order=order, grating_split_pos=grating_split_pos)
star_p = galsim.Convolve(psf, gal) star_p = galsim.Convolve(psf, gal)
if nnx == 0: if nnx == 0:
galImg = star_p.drawImage(wcs=chip_wcs_local, offset=offset) galImg = star_p.drawImage(
wcs=chip_wcs_local, offset=offset)
nnx = galImg.xmax - galImg.xmin + 1 nnx = galImg.xmax - galImg.xmin + 1
nny = galImg.ymax - galImg.ymin + 1 nny = galImg.ymax - galImg.ymin + 1
else: else:
galImg = star_p.drawImage(nx = nnx, ny = nny, wcs=chip_wcs_local, offset=offset) galImg = star_p.drawImage(
nx=nnx, ny=nny, wcs=chip_wcs_local, offset=offset)
galImg.setOrigin(0, 0) galImg.setOrigin(0, 0)
# n1 = np.sum(np.isinf(galImg.array)) # n1 = np.sum(np.isinf(galImg.array))
# n2 = np.sum(np.isnan(galImg.array)) # n2 = np.sum(np.isnan(galImg.array))
...@@ -351,7 +353,7 @@ class Galaxy(MockObject): ...@@ -351,7 +353,7 @@ class Galaxy(MockObject):
# ERROR happens # ERROR happens
return 2, pos_shear return 2, pos_shear
galImg_List.append(galImg) galImg_List.append(galImg)
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) psf, pos_shear = psf_model.get_PSF(chip=chip, pos_img=pos_img)
...@@ -361,7 +363,7 @@ class Galaxy(MockObject): ...@@ -361,7 +363,7 @@ class Galaxy(MockObject):
if np.sum(np.isnan(galImg.array)) > 0: if np.sum(np.isnan(galImg.array)) > 0:
# ERROR happens # ERROR happens
return 2, pos_shear return 2, pos_shear
for order in ["A","B","C","D","E"]: for order in ["A", "B", "C", "D", "E"]:
galImg_List.append(galImg) galImg_List.append(galImg)
# starImg = gal.drawImage( # starImg = gal.drawImage(
...@@ -378,7 +380,7 @@ class Galaxy(MockObject): ...@@ -378,7 +380,7 @@ class Galaxy(MockObject):
subSlitPos = int(grating_split_pos_chip - gal_origin[1]) subSlitPos = int(grating_split_pos_chip - gal_origin[1])
# part img disperse # part img disperse
star_p1s=[] star_p1s = []
for galImg in galImg_List: for galImg in galImg_List:
subImg_p1 = galImg.array[:, 0:subSlitPos] subImg_p1 = galImg.array[:, 0:subSlitPos]
...@@ -397,17 +399,18 @@ class Galaxy(MockObject): ...@@ -397,17 +399,18 @@ class Galaxy(MockObject):
isAlongY=0, isAlongY=0,
flat_cube=flat_cube) flat_cube=flat_cube)
self.addSLStoChipImage(sdp=sdp_p1, chip=chip, xOrderSigPlus = xOrderSigPlus, local_wcs=chip_wcs_local) self.addSLStoChipImage(
sdp=sdp_p1, chip=chip, xOrderSigPlus=xOrderSigPlus, local_wcs=chip_wcs_local)
# pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp_p1, chip=chip, pos_img_local=[xcenter_p1, ycenter_p1], # pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp_p1, chip=chip, pos_img_local=[xcenter_p1, ycenter_p1],
# psf_model=psf_model, bandNo=i + 1, # psf_model=psf_model, bandNo=i + 1,
# grating_split_pos=grating_split_pos, # grating_split_pos=grating_split_pos,
# local_wcs=chip_wcs_local, pos_img=pos_img) # local_wcs=chip_wcs_local, pos_img=pos_img)
star_p2s=[] star_p2s = []
for galImg in galImg_List: for galImg in galImg_List:
subImg_p2 = galImg.array[:, subImg_p2 = galImg.array[:,
subSlitPos:galImg.array.shape[1]] subSlitPos:galImg.array.shape[1]]
star_p2 = galsim.Image(subImg_p2) star_p2 = galsim.Image(subImg_p2)
star_p2.setOrigin(0, 0) star_p2.setOrigin(0, 0)
star_p2s.append(star_p2) star_p2s.append(star_p2)
...@@ -423,7 +426,8 @@ class Galaxy(MockObject): ...@@ -423,7 +426,8 @@ class Galaxy(MockObject):
isAlongY=0, isAlongY=0,
flat_cube=flat_cube) flat_cube=flat_cube)
self.addSLStoChipImage(sdp=sdp_p2, chip=chip, xOrderSigPlus = xOrderSigPlus, local_wcs=chip_wcs_local) self.addSLStoChipImage(
sdp=sdp_p2, chip=chip, xOrderSigPlus=xOrderSigPlus, local_wcs=chip_wcs_local)
# pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp_p2, chip=chip, pos_img_local=[xcenter_p2, ycenter_p2], # pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp_p2, chip=chip, pos_img_local=[xcenter_p2, ycenter_p2],
# psf_model=psf_model, bandNo=i + 1, # psf_model=psf_model, bandNo=i + 1,
# grating_split_pos=grating_split_pos, # grating_split_pos=grating_split_pos,
...@@ -439,7 +443,8 @@ class Galaxy(MockObject): ...@@ -439,7 +443,8 @@ class Galaxy(MockObject):
conf=chip.sls_conf[1], conf=chip.sls_conf[1],
isAlongY=0, isAlongY=0,
flat_cube=flat_cube) flat_cube=flat_cube)
self.addSLStoChipImage(sdp=sdp, chip=chip, xOrderSigPlus = xOrderSigPlus, local_wcs=chip_wcs_local) self.addSLStoChipImage(
sdp=sdp, chip=chip, xOrderSigPlus=xOrderSigPlus, local_wcs=chip_wcs_local)
# pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp, chip=chip, pos_img_local=[x_nominal, y_nominal], # pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp, chip=chip, pos_img_local=[x_nominal, y_nominal],
# psf_model=psf_model, bandNo=i + 1, # psf_model=psf_model, bandNo=i + 1,
# grating_split_pos=grating_split_pos, # grating_split_pos=grating_split_pos,
...@@ -453,7 +458,8 @@ class Galaxy(MockObject): ...@@ -453,7 +458,8 @@ class Galaxy(MockObject):
conf=chip.sls_conf[0], conf=chip.sls_conf[0],
isAlongY=0, isAlongY=0,
flat_cube=flat_cube) flat_cube=flat_cube)
self.addSLStoChipImage(sdp=sdp, chip=chip, xOrderSigPlus = xOrderSigPlus, local_wcs=chip_wcs_local) self.addSLStoChipImage(
sdp=sdp, chip=chip, xOrderSigPlus=xOrderSigPlus, local_wcs=chip_wcs_local)
# pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp, chip=chip, pos_img_local=[x_nominal, y_nominal], # pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp, chip=chip, pos_img_local=[x_nominal, y_nominal],
# psf_model=psf_model, bandNo=i + 1, # psf_model=psf_model, bandNo=i + 1,
# grating_split_pos=grating_split_pos, # grating_split_pos=grating_split_pos,
......
...@@ -235,14 +235,14 @@ class MockObject(object): ...@@ -235,14 +235,14 @@ class MockObject(object):
if chip.slsPSFOptim: if chip.slsPSFOptim:
for k, v in spec_orders.items(): for k, v in spec_orders.items():
img_s = v[0] img_s = v[0]
nan_ids = np.isnan(img_s) nan_ids = np.isnan(img_s)
if img_s[nan_ids].shape[0] > 0: if img_s[nan_ids].shape[0] > 0:
img_s[nan_ids] = 0 img_s[nan_ids] = 0
print("DEBUG: specImg nan num is", img_s[nan_ids].shape[0]) print("DEBUG: specImg nan num is", img_s[nan_ids].shape[0])
######################################################### #########################################################
# img_s, orig_off = convolveImg(img_s, psf_img_m) # img_s, orig_off = convolveImg(img_s, psf_img_m)
orig_off = [0,0] orig_off = [0, 0]
origin_order_x = v[1] - orig_off[0] origin_order_x = v[1] - orig_off[0]
origin_order_y = v[2] - orig_off[1] origin_order_y = v[2] - orig_off[1]
...@@ -257,15 +257,18 @@ class MockObject(object): ...@@ -257,15 +257,18 @@ class MockObject(object):
continue continue
# orders = {'A': 'order1', 'B': 'order0', 'C': 'order2', 'D': 'order-1', 'E': 'order-2'} # orders = {'A': 'order1', 'B': 'order0', 'C': 'order2', 'D': 'order-1', 'E': 'order-2'}
orders = {'A': 'order1', 'B': 'order0', 'C': 'order0', 'D': 'order0', 'E': 'order0'} orders = {'A': 'order1', 'B': 'order0',
'C': 'order0', 'D': 'order0', 'E': 'order0'}
gratingN = chip_utils.getChipSLSGratingID(chip.chipID)[1] gratingN = chip_utils.getChipSLSGratingID(chip.chipID)[1]
if pos_img_local[0] < grating_split_pos: if pos_img_local[0] < grating_split_pos:
gratingN = chip_utils.getChipSLSGratingID(chip.chipID)[0] gratingN = chip_utils.getChipSLSGratingID(chip.chipID)[0]
chip.img_stack[gratingN][orders[k]]['w' + str(bandNo)].setOrigin(0, 0) chip.img_stack[gratingN][orders[k]
chip.img_stack[gratingN][orders[k]]['w' + str(bandNo)][bounds] = chip.img_stack[gratingN][orders[k]]['w' + str(bandNo)][bounds] + specImg[bounds] ]['w' + str(bandNo)].setOrigin(0, 0)
chip.img_stack[gratingN][orders[k]]['w' + str(bandNo)].setOrigin(chip.bound.xmin, chip.bound.ymin) chip.img_stack[gratingN][orders[k]]['w' + str(
bandNo)][bounds] = chip.img_stack[gratingN][orders[k]]['w' + str(bandNo)][bounds] + specImg[bounds]
chip.img_stack[gratingN][orders[k]]['w' +
str(bandNo)].setOrigin(chip.bound.xmin, chip.bound.ymin)
else: else:
for k, v in spec_orders.items(): for k, v in spec_orders.items():
...@@ -313,11 +316,11 @@ class MockObject(object): ...@@ -313,11 +316,11 @@ class MockObject(object):
# specImg.wcs = local_wcs # specImg.wcs = local_wcs
# specImg.setOrigin(origin_order_x, origin_order_y) # specImg.setOrigin(origin_order_x, origin_order_y)
# print('DEBUG: BEGIN -----------',bandNo,k) # print('DEBUG: BEGIN -----------',bandNo,k)
img_s = v[0] img_s = v[0]
nan_ids = np.isnan(img_s) nan_ids = np.isnan(img_s)
if img_s[nan_ids].shape[0] > 0: if img_s[nan_ids].shape[0] > 0:
img_s[nan_ids] = 0 img_s[nan_ids] = 0
...@@ -330,9 +333,11 @@ class MockObject(object): ...@@ -330,9 +333,11 @@ class MockObject(object):
specImg.wcs = local_wcs specImg.wcs = local_wcs
specImg.setOrigin(origin_order_x, origin_order_y) specImg.setOrigin(origin_order_x, origin_order_y)
try: try:
specImg = psf_model.get_PSF_AND_convolve_withsubImg(chip, cutImg=specImg, pos_img_local=pos_img_local, bandNo=bandNo, g_order=k, grating_split_pos=grating_split_pos) specImg = psf_model.get_PSF_AND_convolve_withsubImg(
chip, cutImg=specImg, pos_img_local=pos_img_local, bandNo=bandNo, g_order=k, grating_split_pos=grating_split_pos)
except: except:
psf, pos_shear = psf_model.get_PSF(chip=chip, pos_img=pos_img) psf, pos_shear = psf_model.get_PSF(
chip=chip, pos_img=pos_img)
psf_img = psf.drawImage(nx=100, ny=100, wcs=local_wcs) psf_img = psf.drawImage(nx=100, ny=100, wcs=local_wcs)
...@@ -425,45 +430,46 @@ class MockObject(object): ...@@ -425,45 +430,46 @@ class MockObject(object):
# star = galsim.DeltaFunction(gsparams=gsp) # star = galsim.DeltaFunction(gsparams=gsp)
# star = star.withFlux(tel.pupil_area * exptime) # star = star.withFlux(tel.pupil_area * exptime)
#psf list :["A","B","C","D","E"] # psf list :["A","B","C","D","E"]
starImg_List = [] starImg_List = []
try: try:
pos_img_local = [0,0] pos_img_local = [0, 0]
x_start = chip.x_cen/chip.pix_size - chip.npix_x / 2. x_start = chip.x_cen/chip.pix_size - chip.npix_x / 2.
y_start = chip.y_cen/chip.pix_size - chip.npix_y / 2. y_start = chip.y_cen/chip.pix_size - chip.npix_y / 2.
pos_img_local[0] = pos_img.x - x_start pos_img_local[0] = pos_img.x - x_start
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 ["A","B"]: for order in ["A", "B"]:
psf, pos_shear = psf_model.get_PSF( psf, pos_shear = psf_model.get_PSF(
chip, pos_img_local=pos_img_local, bandNo=i+1, galsimGSObject=True, g_order=order, grating_split_pos=grating_split_pos) chip, pos_img_local=pos_img_local, bandNo=i+1, galsimGSObject=True, g_order=order, grating_split_pos=grating_split_pos)
# star_p = galsim.Convolve(psf, star) # star_p = galsim.Convolve(psf, star)
star_p = psf.withFlux(tel.pupil_area * exptime) star_p = psf.withFlux(tel.pupil_area * exptime)
if nnx == 0: if nnx == 0:
starImg = star_p.drawImage(wcs=chip_wcs_local, offset=offset) starImg = star_p.drawImage(
wcs=chip_wcs_local, offset=offset)
nnx = starImg.xmax - starImg.xmin + 1 nnx = starImg.xmax - starImg.xmin + 1
nny = starImg.ymax - starImg.ymin + 1 nny = starImg.ymax - starImg.ymin + 1
else: else:
starImg = star_p.drawImage(nx = nnx, ny = nny, wcs=chip_wcs_local, offset=offset) starImg = star_p.drawImage(
nx=nnx, ny=nny, wcs=chip_wcs_local, offset=offset)
# n1 = np.sum(np.isinf(starImg.array)) # n1 = np.sum(np.isinf(starImg.array))
# n2 = np.sum(np.isnan(starImg.array)) # n2 = np.sum(np.isnan(starImg.array))
# if n1>0 or n2 > 0: # if n1>0 or n2 > 0:
# print("DEBUG: MockObject, inf:%d, nan:%d"%(n1, n2)) # print("DEBUG: MockObject, inf:%d, nan:%d"%(n1, n2))
starImg.setOrigin(0, 0) starImg.setOrigin(0, 0)
starImg_List.append(starImg) starImg_List.append(starImg)
for order in ["C","D","E"]: for order in ["C", "D", "E"]:
starImg_List.append(starImg) starImg_List.append(starImg)
except: except:
psf, pos_shear = psf_model.get_PSF(chip=chip, pos_img=pos_img) psf, pos_shear = psf_model.get_PSF(chip=chip, pos_img=pos_img)
# star_p = galsim.Convolve(psf, star) # star_p = galsim.Convolve(psf, star)
star_p = psf.withFlux(tel.pupil_area * exptime) star_p = psf.withFlux(tel.pupil_area * exptime)
starImg = star_p.drawImage(wcs=chip_wcs_local, offset=offset) starImg = star_p.drawImage(wcs=chip_wcs_local, offset=offset)
starImg.setOrigin(0, 0) starImg.setOrigin(0, 0)
for order in ["A","B","C","D","E"]: for order in ["A", "B", "C", "D", "E"]:
starImg_List.append(starImg) starImg_List.append(starImg)
# psf_tmp = galsim.Gaussian(sigma=0.002) # psf_tmp = galsim.Gaussian(sigma=0.002)
# star = galsim.Convolve(psf_tmp, star) # star = galsim.Convolve(psf_tmp, star)
...@@ -472,14 +478,14 @@ class MockObject(object): ...@@ -472,14 +478,14 @@ class MockObject(object):
origin_star = [y_nominal - (starImg.center.y - starImg.ymin), origin_star = [y_nominal - (starImg.center.y - starImg.ymin),
x_nominal - (starImg.center.x - starImg.xmin)] x_nominal - (starImg.center.x - starImg.xmin)]
gal_origin = [origin_star[0], origin_star[1]] gal_origin = [origin_star[0], origin_star[1]]
gal_end = [origin_star[0] + starImg.array.shape[0] - gal_end = [origin_star[0] + starImg.array.shape[0] -
1, origin_star[1] + starImg.array.shape[1] - 1] 1, origin_star[1] + starImg.array.shape[1] - 1]
if gal_origin[1] < grating_split_pos_chip < gal_end[1]: if gal_origin[1] < grating_split_pos_chip < gal_end[1]:
subSlitPos = int(grating_split_pos_chip - gal_origin[1]) subSlitPos = int(grating_split_pos_chip - gal_origin[1])
# part img disperse # part img disperse
star_p1s=[] star_p1s = []
for starImg in starImg_List: for starImg in starImg_List:
subImg_p1 = starImg.array[:, 0:subSlitPos] subImg_p1 = starImg.array[:, 0:subSlitPos]
...@@ -498,17 +504,17 @@ class MockObject(object): ...@@ -498,17 +504,17 @@ class MockObject(object):
isAlongY=0, isAlongY=0,
flat_cube=flat_cube) flat_cube=flat_cube)
self.addSLStoChipImage(sdp=sdp_p1, chip=chip, xOrderSigPlus=xOrderSigPlus, local_wcs=chip_wcs_local) self.addSLStoChipImage(
sdp=sdp_p1, chip=chip, xOrderSigPlus=xOrderSigPlus, local_wcs=chip_wcs_local)
# pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp_p1, chip=chip, pos_img_local=[xcenter_p1, ycenter_p1], # pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp_p1, chip=chip, pos_img_local=[xcenter_p1, ycenter_p1],
# psf_model=psf_model, bandNo=i+1, grating_split_pos=grating_split_pos, # psf_model=psf_model, bandNo=i+1, grating_split_pos=grating_split_pos,
# local_wcs=chip_wcs_local, pos_img=pos_img) # local_wcs=chip_wcs_local, pos_img=pos_img)
star_p2s = []
star_p2s=[]
for starImg in starImg_List: for starImg in starImg_List:
subImg_p2 = starImg.array[:, subImg_p2 = starImg.array[:,
subSlitPos:starImg.array.shape[1]] subSlitPos:starImg.array.shape[1]]
star_p2 = galsim.Image(subImg_p2) star_p2 = galsim.Image(subImg_p2)
star_p2.setOrigin(0, 0) star_p2.setOrigin(0, 0)
star_p2s.append(star_p2) star_p2s.append(star_p2)
...@@ -524,7 +530,8 @@ class MockObject(object): ...@@ -524,7 +530,8 @@ class MockObject(object):
isAlongY=0, isAlongY=0,
flat_cube=flat_cube) flat_cube=flat_cube)
self.addSLStoChipImage(sdp=sdp_p2, chip=chip, xOrderSigPlus=xOrderSigPlus, local_wcs=chip_wcs_local) self.addSLStoChipImage(
sdp=sdp_p2, chip=chip, xOrderSigPlus=xOrderSigPlus, local_wcs=chip_wcs_local)
# pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp_p2, chip=chip, pos_img_local=[xcenter_p2, ycenter_p2], # pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp_p2, chip=chip, pos_img_local=[xcenter_p2, ycenter_p2],
# psf_model=psf_model, bandNo=i + 1, grating_split_pos=grating_split_pos, # psf_model=psf_model, bandNo=i + 1, grating_split_pos=grating_split_pos,
# local_wcs=chip_wcs_local, pos_img=pos_img) # local_wcs=chip_wcs_local, pos_img=pos_img)
...@@ -539,7 +546,8 @@ class MockObject(object): ...@@ -539,7 +546,8 @@ class MockObject(object):
conf=chip.sls_conf[1], conf=chip.sls_conf[1],
isAlongY=0, isAlongY=0,
flat_cube=flat_cube) flat_cube=flat_cube)
self.addSLStoChipImage(sdp=sdp, chip=chip, xOrderSigPlus=xOrderSigPlus, local_wcs=chip_wcs_local) self.addSLStoChipImage(
sdp=sdp, chip=chip, xOrderSigPlus=xOrderSigPlus, local_wcs=chip_wcs_local)
# pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp, chip=chip, pos_img_local=[x_nominal, y_nominal], # pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp, chip=chip, pos_img_local=[x_nominal, y_nominal],
# psf_model=psf_model, bandNo=i + 1, grating_split_pos=grating_split_pos, # psf_model=psf_model, bandNo=i + 1, grating_split_pos=grating_split_pos,
# local_wcs=chip_wcs_local, pos_img=pos_img) # local_wcs=chip_wcs_local, pos_img=pos_img)
...@@ -552,7 +560,8 @@ class MockObject(object): ...@@ -552,7 +560,8 @@ class MockObject(object):
conf=chip.sls_conf[0], conf=chip.sls_conf[0],
isAlongY=0, isAlongY=0,
flat_cube=flat_cube) flat_cube=flat_cube)
self.addSLStoChipImage(sdp=sdp, chip=chip, xOrderSigPlus=xOrderSigPlus, local_wcs=chip_wcs_local) self.addSLStoChipImage(
sdp=sdp, chip=chip, xOrderSigPlus=xOrderSigPlus, local_wcs=chip_wcs_local)
# pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp, chip=chip, pos_img_local=[x_nominal, y_nominal], # pos_shear = self.addSLStoChipImageWithPSF(sdp=sdp, chip=chip, pos_img_local=[x_nominal, y_nominal],
# psf_model=psf_model, bandNo=i + 1, grating_split_pos=grating_split_pos, # psf_model=psf_model, bandNo=i + 1, grating_split_pos=grating_split_pos,
# local_wcs=chip_wcs_local, pos_img=pos_img) # local_wcs=chip_wcs_local, pos_img=pos_img)
......
...@@ -30,7 +30,7 @@ NPSF = 900 # ***# 30*30 ...@@ -30,7 +30,7 @@ NPSF = 900 # ***# 30*30
PIX_SIZE_MICRON = 5. # ***# in microns PIX_SIZE_MICRON = 5. # ***# in microns
### find neighbors-KDtree### # find neighbors-KDtree
# def findNeighbors(tx, ty, px, py, dr=0.1, dn=1, OnlyDistance=True): # def findNeighbors(tx, ty, px, py, dr=0.1, dn=1, OnlyDistance=True):
# """ # """
# find nearest neighbors by 2D-KDTree # find nearest neighbors by 2D-KDTree
...@@ -212,7 +212,7 @@ PIX_SIZE_MICRON = 5. # ***# in microns ...@@ -212,7 +212,7 @@ PIX_SIZE_MICRON = 5. # ***# in microns
# return psfMaker # return psfMaker
### define PSFInterp### # define PSFInterp
class PSFInterpSLS(PSFModel): class PSFInterpSLS(PSFModel):
def __init__(self, chip, filt, PSF_data_prefix="", sigSpin=0, psfRa=0.15, pix_size=0.005): def __init__(self, chip, filt, PSF_data_prefix="", sigSpin=0, psfRa=0.15, pix_size=0.005):
if LOG_DEBUG: if LOG_DEBUG:
......
...@@ -60,7 +60,7 @@ class Chip(object): ...@@ -60,7 +60,7 @@ class Chip(object):
if logger is not None: if logger is not None:
logger.info( logger.info(
" Construct the wcs of the entire image mosaic using Gnomonic/TAN projection") " Construct the wcs of the entire image mosaic using Gnomonic/TAN projection")
if (xcen == None) or (ycen == None): if (xcen is None) or (ycen is None):
xcen = self.cen_pix_x xcen = self.cen_pix_x
ycen = self.cen_pix_y ycen = self.cen_pix_y
if pix_scale == None: if pix_scale == None:
......
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