Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-sims
csst_msc_sim
Commits
20c5ee5f
Commit
20c5ee5f
authored
Oct 26, 2024
by
Wei Chengliang
Browse files
update codestyle-PEP8
parent
00508e40
Pipeline
#7097
failed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
observation_sim/instruments/chip/libCTI/CTI_modeling.py
View file @
20c5ee5f
...
@@ -31,7 +31,7 @@ def get_trap_map(seeds,nx,ny,nmax,rho_trap,beta,c,out_dir):
...
@@ -31,7 +31,7 @@ def get_trap_map(seeds,nx,ny,nmax,rho_trap,beta,c,out_dir):
get_trap_h(seeds_p,c_int(int(nsp)),c_int(int(nx)),c_int(int(ny)),
\
get_trap_h(seeds_p,c_int(int(nsp)),c_int(int(nx)),c_int(int(ny)),
\
c_int(int(nmax)),rho_trap_p,c_float(beta),
\
c_int(int(nmax)),rho_trap_p,c_float(beta),
\
c_float(c),filename)
c_float(c),filename)
def bin2fits(bin_file,fits_dir,nsp,nx,ny,nmax):
def bin2fits(bin_file,fits_dir,nsp,nx,ny,nmax):
data = np.fromfile(bin_file,dtype=np.float32)
data = np.fromfile(bin_file,dtype=np.float32)
data = data.reshape(nx,nsp,ny,nmax).transpose(1,3,2,0)
data = data.reshape(nx,nsp,ny,nmax).transpose(1,3,2,0)
...
@@ -101,6 +101,6 @@ if __name__ =='__main__':
...
@@ -101,6 +101,6 @@ if __name__ =='__main__':
image = fits.getdata("inputdata/image.fits").astype(np.int32)
image = fits.getdata("inputdata/image.fits").astype(np.int32)
get_trap_map(trap_seeds,nx,ny,nmax,rho_trap,beta,c,".")
get_trap_map(trap_seeds,nx,ny,nmax,rho_trap,beta,c,".")
bin2fits("trap.bin",".",nsp,nx,ny,nmax)
bin2fits("trap.bin",".",nsp,nx,ny,nmax)
image_cti = CTI_sim(image,nx,ny,noverscan,nsp,nmax,beta,w,c,t,rho_trap,trap_seeds,release_seed)
image_cti = CTI_sim(image,nx,ny,noverscan,nsp,nmax,beta,w,c,t,rho_trap,trap_seeds,release_seed)
fits.writeto("output/image_CTI.fits",data=image_cti,overwrite=True)
fits.writeto("output/image_CTI.fits",data=image_cti,overwrite=True)
"""
"""
observation_sim/psf/PSFGauss.py
View file @
20c5ee5f
...
@@ -50,7 +50,7 @@ class PSFGauss(PSFModel):
...
@@ -50,7 +50,7 @@ class PSFGauss(PSFModel):
Return: the flux ratio
Return: the flux ratio
"""
"""
if
pscale
==
None
:
if
pscale
is
None
:
pscale
=
self
.
pix_size
pscale
=
self
.
pix_size
gaussx
=
galsim
.
Gaussian
(
flux
=
1.0
,
sigma
=
sig
)
gaussx
=
galsim
.
Gaussian
(
flux
=
1.0
,
sigma
=
sig
)
gaussImg
=
gaussx
.
drawImage
(
scale
=
pscale
,
method
=
'no_pixel'
)
gaussImg
=
gaussx
.
drawImage
(
scale
=
pscale
,
method
=
'no_pixel'
)
...
@@ -68,7 +68,7 @@ class PSFGauss(PSFModel):
...
@@ -68,7 +68,7 @@ class PSFGauss(PSFModel):
return the fwhm in arcsec
return the fwhm in arcsec
"""
"""
if
pscale
==
None
:
if
pscale
is
None
:
pscale
=
self
.
pix_size
pscale
=
self
.
pix_size
err
=
1.0e-3
err
=
1.0e-3
nxx
=
100
nxx
=
100
...
@@ -122,4 +122,5 @@ class PSFGauss(PSFModel):
...
@@ -122,4 +122,5 @@ class PSFGauss(PSFModel):
# return ell, beta, qr
# return ell, beta, qr
PSFshear
=
galsim
.
Shear
(
e
=
ell
,
beta
=
beta
*
galsim
.
radians
)
PSFshear
=
galsim
.
Shear
(
e
=
ell
,
beta
=
beta
*
galsim
.
radians
)
return
self
.
psf
.
shear
(
PSFshear
),
PSFshear
return
self
.
psf
.
shear
(
PSFshear
),
PSFshear
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment