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
7dadcef4
Commit
7dadcef4
authored
Oct 10, 2025
by
Wei Chengliang
Browse files
pep8 coding style
parent
a987f34e
Pipeline
#10624
passed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
catalog/C10_Catalog.py
View file @
7dadcef4
...
...
@@ -312,7 +312,7 @@ class Catalog(CatalogBase):
param
[
'diskmass'
]
=
gals
[
'diskmass'
][
igals
]
np
.
random
.
seed
(
int
(
pix_id
)
+
cat_id
+
igals
)
param
[
'size'
]
=
(
gals
[
'size'
][
igals
]
*
((
1.
+
gals
[
'redshift'
][
igals
])
**
(
0.4
)))
*
np
.
random
.
uniform
(
0.7
,
1.3
)
param
[
'size'
]
=
(
gals
[
'size'
][
igals
]
*
((
1.
+
gals
[
'redshift'
][
igals
])
**
(
0.4
)))
*
np
.
random
.
uniform
(
0.7
,
1.3
)
if
param
[
'size'
]
>
self
.
max_size
:
self
.
max_size
=
param
[
'size'
]
...
...
tools/imgCropping.py
View file @
7dadcef4
import
os
,
sys
import
os
import
sys
import
numpy
as
np
from
astropy.io
import
fits
...
...
@@ -6,12 +7,13 @@ PRESCAN_X, IMAGE_X, OVERSCAN_X = 27, 1152, 71
PRESCAN_Y
,
IMAGE_Y
,
OVERSCAN_Y
=
0
,
4616
,
84
BLOCK_WIDTH
=
PRESCAN_X
+
IMAGE_X
+
OVERSCAN_X
def
process_single_file
(
filename
):
with
fits
.
open
(
filename
)
as
hdul
:
data
=
hdul
[
1
].
data
data
=
data
[
PRESCAN_Y
:
PRESCAN_Y
+
IMAGE_Y
,
:]
blocks
=
[
data
[:,
i
*
BLOCK_WIDTH
+
PRESCAN_X
:
(
i
+
1
)
*
BLOCK_WIDTH
-
OVERSCAN_X
]
for
i
in
range
(
16
)]
data
=
data
[
PRESCAN_Y
:
PRESCAN_Y
+
IMAGE_Y
,
:]
blocks
=
[
data
[:,
i
*
BLOCK_WIDTH
+
PRESCAN_X
:
(
i
+
1
)
*
BLOCK_WIDTH
-
OVERSCAN_X
]
for
i
in
range
(
16
)]
blocks_a
=
np
.
concatenate
(
blocks
[:
4
],
axis
=
1
)
blocks_b
=
np
.
concatenate
([
np
.
fliplr
(
b
)
for
b
in
blocks
[
4
:
8
]],
axis
=
1
)
...
...
@@ -26,6 +28,7 @@ def process_single_file(filename):
fits
.
writeto
(
output_path
,
blocks_final
,
overwrite
=
True
)
print
(
f
"OK:
{
output_path
}
"
)
if
__name__
==
"__main__"
:
if
len
(
sys
.
argv
)
>
1
:
fn
=
sys
.
argv
[
1
]
...
...
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