Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sdc
kis_tools
Commits
38c0e7af
Commit
38c0e7af
authored
Jun 02, 2020
by
Carl Schaffer
Browse files
reformatting, removing dependency on pypeline
parent
421788ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
kis_tools/bbi/bbi_header.py
View file @
38c0e7af
...
...
@@ -6,18 +6,17 @@ from os.path import basename, isdir, join
import
numpy
as
np
import
tqdm
import
yaml
from
astropy.io
import
fits
from
sunpy.coordinates.sun
import
earth_distance
from
kis_tools.bbi
import
settings
from
kis_tools.bbi.
plotting
import
get_wl
from
kis_tools.bbi.
util
import
get_wl
from
kis_tools.interface
import
BasicArgParser
from
kis_tools.util.util
import
setup_outdir
from
pypeline
import
pipeline
from
.bbi_sort_observations
import
get_obs_info
from
.settings
import
get_settings
from
..util.util
import
add_history
,
date_from_fn
from
sunpy.coordinates.sun
import
earth_distance
from
..util.util
import
get_filter
settings
=
get_settings
(
"bbi"
)
...
...
@@ -339,7 +338,8 @@ def convert_bbi_header(filename):
# get additional plots and info from reconstruction results
try
:
speck
=
pipeline
.
speckle
(
filename
+
'.log'
)
raise
KeyError
# speck = pipeline.speckle(filename + '.log')
except
:
print
(
'Could not find metadata'
)
speck
=
None
...
...
@@ -413,4 +413,4 @@ def run_bbi_header_conversion(args):
flipped
=
np
.
flip
(
data
,
axis
=
0
)
fits
.
writeto
(
out_file
,
flipped
,
new_header
,
overwrite
=
True
,
checksum
=
True
,
output_verify
=
'warn'
)
\ No newline at end of file
fits
.
writeto
(
out_file
,
flipped
,
new_header
,
overwrite
=
True
,
checksum
=
True
,
output_verify
=
'warn'
)
kis_tools/bbi/plotting.py
View file @
38c0e7af
...
...
@@ -14,10 +14,10 @@ from os.path import join, basename
from
warnings
import
catch_warnings
import
matplotlib
as
mpl
from
matplotlib
import
pyplot
as
plt
from
pypeline
import
pipeline
from
tqdm
import
tqdm
from
.util
import
get_wl
from
..util.util
import
merge_to_gif
,
gif_to_mp4
mpl
.
use
(
'Agg'
)
...
...
@@ -66,9 +66,6 @@ def alpha_preview(fits_file, fn_out):
speck
.
plot_info_alpha
(
save
=
True
,
filename
=
fn_out
)
return
fn_out
def
get_wl
(
fn
):
"""Extract wavelength from string"""
return
int
(
re
.
search
(
r
'WL(\d+)'
,
fn
).
group
(
1
))
def
bbi_gen_gif
(
folder
):
"""Check a folder and merge all images of the same type into gifs and mp4s"""
...
...
@@ -94,7 +91,6 @@ def bbi_gen_gif(folder):
def
run_bbi_preview
(
cmd_line_args
):
mpl
.
use
(
'Agg'
)
import
matplotlib
as
matplotlib
from
..interface.commandline_interface
import
add_arg_infiles
parser
=
argparse
.
ArgumentParser
()
add_arg_infiles
(
parser
)
...
...
kis_tools/bbi/util.py
0 → 100644
View file @
38c0e7af
import
re
def
get_wl
(
fn
):
"""Extract wavelength from string"""
return
int
(
re
.
search
(
r
'WL(\d+)'
,
fn
).
group
(
1
))
\ No newline at end of file
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