Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ssp-software
data-access-tools
Commits
71ab93dc
Commit
71ab93dc
authored
Aug 14, 2020
by
michitaro.koike
Browse files
preserve mask values as long as possible
parent
6fcbbf64
Changes
1
Hide whitespace changes
Inline
Side-by-side
pdr2/imageStitcher1/imageStitcher1.py
View file @
71ab93dc
...
...
@@ -42,7 +42,10 @@ class Stitcher:
def
__init__
(
self
,
*
,
files
:
List
[
str
],
bbox
:
BBox
):
self
.
_files
=
files
self
.
_bbox
=
bbox
self
.
hdu
=
self
.
_stitch
()
@
property
def
hdu
(
self
):
return
self
.
_stitch
()
def
_stitch
(
self
):
((
minx
,
miny
),
(
maxx
,
maxy
))
=
self
.
_bbox
...
...
@@ -127,12 +130,12 @@ class MaskStitcher(Stitcher):
fits_open_options
=
dict
(
do_not_scale_image_data
=
True
)
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
_mp
:
Dict
[
str
,
int
]
=
{}
super
().
__init__
(
*
args
,
**
kwargs
)
self
.
_mp
:
Dict
[
str
,
int
]
=
{}
def
_normalized_data
(
self
,
data
:
numpy
.
ndarray
,
hdul
:
afits
.
HDUList
):
header
:
afits
.
Header
=
hdul
[
self
.
hdu_index
].
header
# type: ignore
mp_keys
=
[
k
for
k
in
header
.
keys
()
if
k
.
startswith
(
'MP_'
)]
mp_keys
=
sorted
(
[
k
for
k
in
header
.
keys
()
if
k
.
startswith
(
'MP_'
)]
,
key
=
lambda
k
:
cast
(
int
,
header
[
k
]))
pool
=
numpy
.
zeros_like
(
data
)
for
k
in
mp_keys
:
b1
=
header
[
k
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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