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-pipeline
csst_proto
Commits
69b719fe
Commit
69b719fe
authored
Aug 23, 2022
by
BO ZHANG
🏀
Browse files
updated example
parent
866429fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/how_this_code_will_be_used.py
View file @
69b719fe
...
...
@@ -3,19 +3,28 @@ from astropy.io import fits
from
csst.core.processor
import
CsstProcessor
from
csst.msc.data_manager
import
CsstMscDataManager
from
csst_proto
import
flip_image
from
csst_proto
.top_level_interface
import
flip_image
class
CsstProcFlipImage
(
CsstProcessor
):
""" This processor
absorbs photon
s """
""" This processor
flips image
s """
def
__init__
(
self
,
dm
:
CsstMscDataManager
,
n_jobs
:
int
=
1
):
"""
Parameters
----------
dm:
csst data manager, used to manage the input/output file paths
n_jobs:
number of jobs launched
"""
super
(
CsstProcFlipImage
,
self
).
__init__
()
self
.
dm
=
dm
self
.
n_jobs
=
n_jobs
def
run
(
self
,
debug
:
bool
=
False
):
"""
run this process
or
"""
flip images for all detect
or
s
Parameters
----------
...
...
@@ -24,10 +33,10 @@ class CsstProcFlipImage(CsstProcessor):
Returns
-------
a list of flipped images
"""
img_flipped_list
=
joblib
.
Parallel
(
n_jobs
=
self
.
n_jobs
)(
joblib
.
delayed
(
CsstProcFlipImage
.
run_one_
chip
)(
this_ccd_id
)
joblib
.
delayed
(
CsstProcFlipImage
.
run_one_
detector
)(
this_ccd_id
)
for
this_ccd_id
in
self
.
dm
.
target_ccd_ids
)
return
img_flipped_list
...
...
@@ -40,8 +49,8 @@ class CsstProcFlipImage(CsstProcessor):
return
@
staticmethod
def
run_one_
chip
(
dm
,
ccd_id
):
""" run for one
chip
def
run_one_
detector
(
dm
,
ccd_id
):
""" run for one
detector
this function
"""
...
...
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