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
Hu Yi
CSST-COMMOM-CRMASK
Commits
407524f2
Commit
407524f2
authored
Oct 25, 2022
by
Yi Hu
Browse files
要提交的变更:
修改: src/crmask.py 将统计被宇宙线污染的像素数目加入到HISTORY中
parent
3099dd38
Changes
1
Show whitespace changes
Inline
Side-by-side
src/crmask.py
View file @
407524f2
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#Software package dependencies, numpy, astropy, ccdproc and deepCR
#Software package dependencies, numpy, astropy, ccdproc and deepCR
#Installation dependencies on Ubuntu 20.04
#Installation dependencies on Ubuntu 20.04
#apt install python3-numpy python3-astropy python3-ccdproc python3-pip
#apt install python3-numpy python3-astropy python3-ccdproc python3-pip
#python3 -m pip install
py
torch deepCR
#python3 -m pip install torch deepCR
#Version 0.2
#Version 0.2
#changelog
#changelog
...
@@ -300,6 +300,9 @@ class CRMask:
...
@@ -300,6 +300,9 @@ class CRMask:
masked_hdulist
[
1
].
header
.
add_history
(
value
)
masked_hdulist
[
1
].
header
.
add_history
(
value
)
value
=
'CRMask end at {0}'
.
format
(
end_time
)
value
=
'CRMask end at {0}'
.
format
(
end_time
)
masked_hdulist
[
1
].
header
.
add_history
(
value
)
masked_hdulist
[
1
].
header
.
add_history
(
value
)
#add total number of pixels contaminated by cosmic ray to HISTORY.
value
=
'ccdproc.cosimicray_lacosmic detected {0:d} pixels contaminated by cosmic ray'
.
format
(
np
.
count_nonzero
(
masked
))
masked_hdulist
[
1
].
header
.
add_history
(
value
)
if
self
.
fill_flag
:
if
self
.
fill_flag
:
cleaned_hdulist
=
pyfits
.
HDUList
()
cleaned_hdulist
=
pyfits
.
HDUList
()
...
@@ -423,6 +426,9 @@ class CRMask:
...
@@ -423,6 +426,9 @@ class CRMask:
masked_hdulist
[
1
].
header
.
add_history
(
value
)
masked_hdulist
[
1
].
header
.
add_history
(
value
)
value
=
'deepCR mask model {0}'
.
format
(
clean_model
)
value
=
'deepCR mask model {0}'
.
format
(
clean_model
)
masked_hdulist
[
1
].
header
.
add_history
(
value
)
masked_hdulist
[
1
].
header
.
add_history
(
value
)
#add total number of pixels contaminated by cosmic ray to HISTORY.
value
=
'deepCR detected {0:d} pixels contaminated by cosmic ray'
.
format
(
np
.
count_nonzero
(
masked
))
masked_hdulist
[
1
].
header
.
add_history
(
value
)
if
inpaint
:
if
inpaint
:
cleaned_image
=
pyfits
.
ImageHDU
(
data
=
cleaned
,
header
=
self
.
hdulist
[
1
].
header
)
cleaned_image
=
pyfits
.
ImageHDU
(
data
=
cleaned
,
header
=
self
.
hdulist
[
1
].
header
)
...
...
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