Commit 38c0e7af authored by Carl Schaffer's avatar Carl Schaffer
Browse files

reformatting, removing dependency on pypeline

parent 421788ee
......@@ -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')
......@@ -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)
......
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment