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
Monica Rainer
gofio
Commits
63fe626d
Commit
63fe626d
authored
Oct 26, 2017
by
Monica Rainer
Browse files
Fix masterflat creation
parent
2130052b
Changes
2
Hide whitespace changes
Inline
Side-by-side
drslib/flatframes.py
View file @
63fe626d
...
...
@@ -133,9 +133,10 @@ class GBFlats():
combineflat
=
ccdproc
.
Combiner
(
self
.
flatcorr
)
# mask the pixels using ron/gain
combineflat
.
sigma_clipping
(
func
=
np
.
ma
.
mean
,
dev_func
=
varie
.
stdcombine
)
#
combineflat.sigma_clipping(func=np.ma.mean, dev_func=varie.stdcombine)
combineflat
.
sigma_clipping
(
func
=
np
.
ma
.
median
,
dev_func
=
varie
.
stdcombine
)
mflat
=
combineflat
.
average_combine
()
mflat
.
data
=
np
.
asarray
(
mflat
.
data
,
dtype
=
'float32'
)
hea
=
self
.
flatlist
[
0
].
header
...
...
drslib/varie.py
View file @
63fe626d
...
...
@@ -87,7 +87,8 @@ def badpix(image,bad_mask,inverse_mask):
def
stdcombine
(
x
,
axis
):
#return np.ma.sqrt((np.ma.absolute(x- np.ma.mean(x)) /CONFIG['GAIN']) + ((CONFIG['RON']/CONFIG['GAIN']) ** 2))
return
np
.
ma
.
sqrt
(
np
.
ma
.
mean
((
np
.
ma
.
absolute
(
x
-
np
.
ma
.
mean
(
x
))
/
CONFIG
[
'GAIN'
])
+
((
CONFIG
[
'RON'
]
/
CONFIG
[
'GAIN'
])
**
2
)))
#return np.ma.sqrt(np.ma.mean((np.ma.absolute(x- np.ma.mean(x)) /CONFIG['GAIN']) + ((CONFIG['RON']/CONFIG['GAIN']) ** 2)))
return
np
.
ma
.
sqrt
(
np
.
ma
.
mean
((
np
.
ma
.
absolute
(
x
-
np
.
ma
.
median
(
x
))
/
CONFIG
[
'GAIN'
])
+
((
CONFIG
[
'RON'
]
/
CONFIG
[
'GAIN'
])
**
2
)))
#--------------------- Build the extraction mask -------------------
...
...
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