Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Massana Zapata, Pol Dr (PG/R - Physics)
astro_lab
Commits
6a99a0bf
Commit
6a99a0bf
authored
Jan 18, 2019
by
Delorme, Maxime Dr (Physics)
Browse files
Added background plotting
parent
5f843a1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
astro_lab.py
View file @
6a99a0bf
...
...
@@ -82,11 +82,14 @@ def plot_data(zscale=True):
plt
.
imshow
(
data
,
cmap
=
'Greys_r'
,
vmin
=
lims
[
0
],
vmax
=
lims
[
1
],
origin
=
'lower'
)
plt
.
show
()
def
subtract_background
():
def
subtract_background
(
plot
=
False
):
global
data
,
error
,
bg_sub
sigma_clip
=
SigmaClip
(
sigma
=
sclip
)
bkg_estimator
=
MedianBackground
()
bkg
=
Background2D
(
data
,
(
bg_wsize
,
bg_wsize
),
sigma_clip
=
sigma_clip
,
bkg_estimator
=
bkg_estimator
)
if
plot
:
plt
.
imshow
(
bkg
.
background
,
origin
=
'lower'
,
cmap
=
'Greys_r'
)
plt
.
show
()
error
=
calc_total_error
(
data
,
bkg
.
background_rms
,
eff_gain
)
data
=
data
-
bkg
.
background
bg_sub
=
True
...
...
Write
Preview
Markdown
is supported
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