Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 35db3d12 authored by PAduverne's avatar PAduverne
Browse files

Merge branch 'undefined' of gitlab.in2p3.fr:duverne1/MUPHOTEN into undefined

parents 38b76ae7 7694a464
"""Console script for muphoten."""
import argparse
import sys
def main():
"""Console script for muphoten."""
parser = argparse.ArgumentParser()
parser.add_argument('_', nargs='*')
args = parser.parse_args()
print("Arguments: " + str(args._))
print("Replace this message by putting your code into "
"muphoten.cli.main")
return 0
if __name__ == "__main__":
sys.exit(main()) # pragma: no cover
{"name": "sathiyajith", "rollno": 56, "cgpa": [3, 3], "phonenumber": "9976770500"}
\ No newline at end of file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 26 08:57:51 2020
@author: duverne
"""
import numpy as np
from astropy.table import Table
import matplotlib.pyplot as plt
from astropy.io import ascii
import plot_image as plotim
def select_band_ref(band):
cata_prentice = Table.read('/home/duverne/Documents/Entrainement_calibration/Plots et resultats/data_photometry_prentice.tex')
cata_kuin = Table.read('/home/duverne/Documents/Entrainement_calibration/Plots et resultats/data_photometry_kuin.tex')
cata_margutti = Table.read('/home/duverne/Documents/Entrainement_calibration/Plots et resultats/data_photometry_Margutti.tex')
cata_perley = Table.read('/home/duverne/Documents/Entrainement_calibration/Plots et resultats/data_photometry_perley.tex')
mask_prentice_filter = (cata_prentice['Filter'] == band)
cata_prentice = cata_prentice[mask_prentice_filter]
cata_prentice['time'] = cata_prentice['MJD'] - 58285.441
cata_prentice['err_mag'] = cata_prentice['error_magnitude']
mask_kuin_filter = (cata_kuin['filter'] == band)
cata_kuin = cata_kuin[mask_kuin_filter]
cata_kuin['time'] = cata_kuin['MJD'] - 58285.441
cata_kuin['err_mag'] = cata_kuin['error_mag']
bands = ['B', 'V', 'R', 'I']
if band in bands:
cata_margutti['time'] = cata_margutti['Phase']
cata_margutti['magnitude'] = cata_margutti[band]
cata_margutti['err_mag'] = cata_margutti['err_' + band]
cata_margutti = cata_margutti['time', 'magnitude', 'err_mag']
cata_perley['time'] = cata_perley['MJD'] - 58285.441
cata_perley['err_mag'] = cata_perley['error_magnitude']
mask_perley_filter = (cata_perley['Filter'] == band)
cata_perley = cata_perley[mask_perley_filter]
return cata_prentice, cata_kuin, cata_margutti, cata_perley
def opening(filename):
catalog = ascii.read(filename)
catalog.info()
return catalog
cata_prentice = Table.read('/home/duverne/Documents/Entrainement_calibration/Plots et resultats/data_photometry_prentice.tex')
cata_kuin = Table.read('/home/duverne/Documents/Entrainement_calibration/Plots et resultats/data_photometry_kuin.tex')
cata_margutti = Table.read('/home/duverne/Documents/Entrainement_calibration/Plots et resultats/data_photometry_Margutti.tex')
cata_perley = Table.read('/home/duverne/Documents/Entrainement_calibration/Plots et resultats/data_photometry_perley.tex')
prentice, kuin, marguttti, perley = select_band_ref('g')
# path2save = '/home/duverne/Documents/agatha_pipeline/'
result = Table.read('/home/duverne/Documents/agatha_pipeline/g_iris.dat', format='ascii.commented_header')
mask = result['flag_dist'] == 0
result = result[mask]
# result_SUB = Table.read(path2save+'results_SUB_images.dat', format='ascii.commented_header')
# result_LT = Table.read('/home/duverne/Documents/AT2018cow_data/g_band_LT_V1.dat', format='ascii.commented_header')
result_LT = Table.read('/home/duverne/Documents/AT2018cow_data/g_band_LT_V2.dat', format='ascii.commented_header')
# result_LT = Table.read('/home/duverne/Documents/AT2018cow_data/B_band_LT_V1.dat', format='ascii.commented_header')
mask = result_LT['flag_dist'] == 0
resultLT = result_LT[mask]
result_TCH = Table.read('/home/duverne/Documents/agatha_pipeline/TCH_g_band_4.dat', format='ascii.commented_header')
mask = result_TCH['flag_dist'] == 0
resultTCH = result_TCH[mask]
result_KEPD = Table.read('/home/duverne/Documents/agatha_pipeline/KEPD_g_band.dat', format='ascii.commented_header')
mask = result_KEPD['flag_dist'] == 0
resultKEPD = result_KEPD[mask]
# reu = plotim.prepare_light_curve('/home/duverne/Documents/agatha_pipeline/results/iris_g_paper.dat', 2)
# reu = plotim.prepare_light_curve('/home/duverne/Documents/agatha_pipeline/results/g_band_LT_paper.dat', 2)
# reu = plotim.prepare_light_curve('/home/duverne/Documents/agatha_pipeline/results/g_band_LT_paper----.dat', 2)
# reu = plotim.prepare_light_curve('/home/duverne/Documents/agatha_pipeline/results/g_band_LT_paper_v2.dat', 3)
reu = plotim.prepare_light_curve('/home/duverne/Documents/agatha_pipeline/results/iris_g_paper_v2.dat', 2.0)
# reu = plotim.prepare_light_curve('/home/duverne/Documents/agatha_pipeline/results/g_band_LT_paper_v3_isophotal_radius_5.dat', 2.)
reu = plotim.prepare_light_curve('/home/duverne/Documents/agatha_pipeline/results/g_band_iris_paper_v3_isophotal_radius_5.dat', 3.0)
# ref_file = '/home/duverne/Documents/test_de_la_fin/IRIS_AT2018cow_g_reference_parameters.txt'
# result_iso = opening(ref_file)
# mask = result_iso['flag_dist'] == 0
# result_iso = result_iso[mask]
fig, main_axes = plt.subplots(1,1)
plt.gcf().subplots_adjust(left = 0.1, bottom = 0.1,
right = 0.9, top = 0.9, wspace = 2.5, hspace = 0.5)
main_axes.errorbar(perley['time'], perley['magnitude'],
yerr=perley['error_magnitude'],
label= r'$g$ $band$ $Perley$ $&$ $al$',
marker = 'x', linestyle = 'none', color = 'red', ms=5, markeredgewidth =2)
# main_axes.errorbar(prentice['time'], prentice['magnitude'],
# yerr=prentice['err_mag'],
# label= r'$g$ $band$ $Prentice$ $&$ $al$',
# marker = 'x', linestyle = 'none', color = 'blue', ms=5)
main_axes.errorbar(resultLT['time'], resultLT['gmag'],
label= r'$Liverpool$ $Telescope$',
marker = 'x', linestyle = 'none', color = 'black', ms=5)
main_axes.errorbar(resultKEPD['time'], resultKEPD['gmag'],
label= r'$Kitt$ $Peak$ $Telescope$',
marker = 'x', linestyle = 'none', color = 'blue', ms=5)
main_axes.errorbar(resultTCH['time'], resultTCH['gmag'],
label= r'$TAROT$ $Chili$',
marker = 'x', linestyle = 'none', color = 'orange', ms=5)
main_axes.errorbar(result['time'], result['gmag'],
label= r'$g$ $band$ $IRIS$',
marker = 'x', linestyle = 'none', color = 'green', ms=5)
main_axes.errorbar(reu['time'], reu['gmag'],yerr=reu['error_tot'],
label= r'$g$ $band$ $IRIS$',
marker = 'x', linestyle = 'none', color = 'pink', ms=5)
# main_axes.errorbar(result_SUB['time'], result_SUB['gmag'],
# label= r'$g$ $band$ $PA$ $SUB$',
# marker = 'x', linestyle = 'none', color = 'brown', ms=5)
main_axes.set_xlabel(r'$Time$ $-$ $MJD$ $58285.441$ $(days)$')
main_axes.set_ylabel(r'$Magnitude$')
# main_axes.set_title(r'$Resultats$ $pour$ $la$ $bande$ $B$ $de$ $IRIS$')
main_axes.set_title(r'$Lightcurve$ $the$ $Cow$ $for$ $IRIS$')
main_axes.legend()
main_axes.invert_yaxis()
fig, main_axes = plt.subplots(1,1)
plt.gcf().subplots_adjust(left = 0.1, bottom = 0.1,
right = 0.9, top = 0.9, wspace = 2.5, hspace = 0.5)
main_axes.errorbar(reu['time'], reu['star_ref_magnitude'],yerr=reu['star_ref_error_tot'],
label= r'$g$ $band$ $IRIS$',
marker = 'x', linestyle = 'none', color = 'red', ms=5)
main_axes.errorbar(reu['time'], reu['star_ref_magnitude_cata'],yerr=reu['star_ref_error_cata'],
label= r'$g$ $band$ $IRIS$',
linestyle = '-', color = 'black', ms=5)
main_axes.set_xlabel(r'$Time$ $-$ $MJD$ $58285.441$ $(days)$')
main_axes.set_ylabel(r'$Magnitude$')
# main_axes.set_title(r'$Resultats$ $pour$ $la$ $bande$ $B$ $de$ $IRIS$')
main_axes.set_title(r'$Lightcurve$ $the$ $Cow$ $for$ $IRIS$')
main_axes.legend()
main_axes.invert_yaxis()
fig, main_axes = plt.subplots(1,1)
plt.gcf().subplots_adjust(left = 0.1, bottom = 0.1,
right = 0.9, top = 0.9, wspace = 2.5, hspace = 0.5)
main_axes.errorbar(reu['time'], reu['SNR'],
label= r'$g$ $band$ $IRIS$',
marker = 'x', linestyle = 'none', color = 'red', ms=5)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 7 13:13:10 2020
@author: duverne
"""
from astropy.io import fits
from astropy.time import Time
import glob
def add_filter(fits_file, band):
with fits.open(fits_file, mode = 'update') as hdul:
hdul[0].header.append(('FILTER', band))
def add_MJD(fits_file, mjd):
with fits.open(fits_file, mode = 'update') as hdul:
hdul[0].header.append(('MJD-OBS', mjd))
file = '/home/duverne/gmadet/final_kepd/gmadet_results/ATLAS18qqn_0_g_20180620_043424.017130_o/ATLAS18qqn_0_g_20180620_043424.017130_o.fits'
# list_file = glob.glob('/home/duverne/Documents/AT2018cow_data/kped/g_band'+'/*')
list_file = glob.glob('/media/duverne/DISQUE ESSB/AT2018cow/kepd/r_band'+'/*')
list_file=[file for file in list_file if '_psf' not in file and 'sub_' not in file]
for file in list_file:
# add_filter(file, 'g')
name = file.split('/')[-1]
obs = name.split('_')
y = obs[3][0:4]
m = obs[3][4:6]
d = obs[3][6:8]
time = y + '-' + m + '-' + d +'T'
h = obs[4][0:2]
mi = obs[4][2:4]
sec = obs[4][4:]
time+=h+':'+mi+':'+sec
time_utc = Time(time, format='isot')
mjd = time_utc.mjd
print(mjd)
add_MJD(file, mjd)
\ No newline at end of file
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 26 16:50:27 2021
@author: duverne, IJClab, Orsay, duverne@protonmail.com
"""
import numpy as np
from astropy.table import Table
import matplotlib.pyplot as plt
B_band = Table.read('/home/duverne/Documents/agatha_pipeline/results/B_muphoten.dat',
format='ascii.commented_header')
g_band = Table.read('/home/duverne/Documents/agatha_pipeline/results/g_muphoten.dat',
format='ascii.commented_header')
r_band = Table.read('/home/duverne/Documents/agatha_pipeline/results/r_muphoten.dat',
format='ascii.commented_header')
from scipy.interpolate import UnivariateSpline
from scipy.interpolate import CubicSpline
# interpolate g band
spl = UnivariateSpline(g_band['time'], g_band['gmag'],
1/g_band['error_tot'],
k=2,
s=1000)
# spl.set_smoothing_factor(0.1)
# Derive interpolation for g
dspl = spl.derivative()
# interpolate B band
spl2 = UnivariateSpline(B_band['time'], np.array(B_band['BMag']),
1/B_band['error_tot'],
k=1.0,s=75)#,
# s=1)
# spl2.set_smoothing_factor(0.1)
# derive interpolation for B
dspl2 = spl2.derivative()
# r_band['time'].sort
spl3 = UnivariateSpline(r_band['time'], np.array(r_band['rmag']),
1/r_band['error_tot'],
k=2.0,s=900)
xnew1 = np.linspace(np.min(r_band['time']), np.max(r_band['time']), 10000)
dspl3 = spl3.derivative()
fig, main_axes = plt.subplots(2,1, figsize=(7.5, 15), sharex=True)
plt.gcf().subplots_adjust(left = 0.1, bottom = 0.05,
right = 0.95, top = 0.95, wspace = 0.5, hspace = 0.2)
main_axes[0].errorbar(r_band['time'], r_band['rmag'],
yerr=r_band['error_tot'],
label= r'Muphoten r band',
marker = 'o', linestyle = 'none',
color = 'blue',
ms=5)
main_axes[0].plot(xnew1, spl3(xnew1), color = 'black')
main_axes[0].set_xlabel(r'$Time$ $-$ $MJD$ $58285.441$ $(days)$')
main_axes[0].set_ylabel(r'$Magnitude$')
main_axes[0].set_title(r'$Lightcurve$ $the$ $Cow$ $r$')
main_axes[0].legend()
main_axes[0].invert_yaxis()
main_axes[1].plot(xnew1, dspl3(xnew1), color = 'black',
label = 'r band')#, linestyle='none', marker='o', ms=6)
main_axes[1].set_xlabel(r'$Time$ $-$ $MJD$ $58285.441$ $(days)$')
main_axes[1].set_ylabel(r'Decay Rate [mag/day]')
main_axes[1].set_title(r'Decay Rate r')
main_axes[1].legend()
fig, main_axes = plt.subplots(3,1, figsize=(7.5, 15), sharex=True)
plt.gcf().subplots_adjust(left = 0.1, bottom = 0.05,
right = 0.95, top = 0.95, wspace = 0.5, hspace = 0.2)
sup = np.max((np.max(g_band['time']), np.max(r_band['time'])))
inf = np.min((np.min(g_band['time']), np.min(r_band['time'])))
xnew3 = np.linspace(inf, sup, 100)
spl4 = spl(xnew3) - spl3(xnew3)
main_axes[0].plot(xnew3,spl4)
main_axes[0].set_xlabel(r'$Time$ $-$ $MJD$ $58285.441$ $(days)$')
main_axes[0].set_ylabel(r'$g-r$')
main_axes[0].set_title(r'Color Evolution the Cow')
main_axes[1].errorbar(r_band['time'], r_band['rmag'],
yerr=r_band['error_tot'],
label= r'Muphoten r band',
marker = 'o', linestyle = 'none',
color = 'blue',
ms=5)
main_axes[1].plot(xnew3, spl3(xnew3), color = 'black')
main_axes[1].set_xlabel(r'$Time$ $-$ $MJD$ $58285.441$ $(days)$')
main_axes[1].set_ylabel(r'$Magnitude$')
main_axes[1].set_title(r'$Lightcurve$ $the$ $Cow$ $r$')
main_axes[1].legend()
main_axes[1].invert_yaxis()
main_axes[2].errorbar(g_band['time'], g_band['gmag'],
yerr=g_band['error_tot'],
label= r'Muphoten g band',
marker = 'o', linestyle = 'none',
color = 'blue',
ms=5)
main_axes[2].plot(xnew3, spl(xnew3), color = 'black')
main_axes[2].set_xlabel(r'$Time$ $-$ $MJD$ $58285.441$ $(days)$')
main_axes[2].set_ylabel(r'$Magnitude$')
main_axes[2].set_title(r'$Lightcurve$ $the$ $Cow$ $g$')
main_axes[2].legend()
main_axes[2].invert_yaxis()
# Find the extrema of x axis
sup = np.max((np.max(g_band['time']), np.max(B_band['time'])))
inf = np.min((np.min(g_band['time']), np.min(B_band['time'])))
xnew = np.linspace(inf, sup, 100)
xnew2 = np.linspace(np.min(B_band['time']), np.max(B_band['time']), 100000)
# plot the interpolations and color evolution
fig, main_axes = plt.subplots(3,1, figsize=(7.5, 15), sharex=True)
plt.gcf().subplots_adjust(left = 0.1, bottom = 0.05,
right = 0.95, top = 0.95, wspace = 0.5, hspace = 0.2)
main_axes[0].errorbar(g_band['time'], g_band['gmag'],
yerr=g_band['error_tot'],
label= r'Muphoten g band',
marker = 'o', linestyle = 'none',
color = 'blue',
ms=5)
main_axes[0].plot(xnew, spl(xnew), color = 'black')
main_axes[0].set_xlabel(r'$Time$ $-$ $MJD$ $58285.441$ $(days)$')
main_axes[0].set_ylabel(r'$Magnitude$')
main_axes[0].set_title(r'$Lightcurve$ $the$ $Cow$ $g$')
main_axes[0].legend()
main_axes[0].invert_yaxis()
main_axes[1].errorbar(B_band['time'], B_band['BMag'],
yerr=B_band['error_tot'],
label= r'Muphoten B band',
marker = 'o', linestyle = 'none',
color = 'blue',
ms=5)
main_axes[1].plot(xnew, spl2(xnew), color = 'black')
main_axes[1].set_xlabel(r'$Time$ $-$ $MJD$ $58285.441$ $(days)$')
main_axes[1].set_ylabel(r'$Magnitude$')
main_axes[1].set_title(r'$Lightcurve$ $the$ $Cow$ $B$')
main_axes[1].legend()
main_axes[1].invert_yaxis()
spl3 = spl2(xnew) - spl(xnew)
main_axes[2].plot(xnew,spl3)
main_axes[2].set_xlabel(r'$Time$ $-$ $MJD$ $58285.441$ $(days)$')
main_axes[2].set_ylabel(r'$B-g$')
main_axes[2].set_title(r'Color Evolution the Cow')
##### Plot the decay rate #####
fig, main_axes = plt.subplots(2,1, figsize=(7.5, 15), sharex=True)
plt.gcf().subplots_adjust(left = 0.1, bottom = 0.05,
right = 0.95, top = 0.95, wspace = 0.5, hspace = 0.2)
main_axes[0].plot(xnew, dspl(xnew), color = 'black', label = 'g band')
main_axes[0].set_xlabel(r'$Time$ $-$ $MJD$ $58285.441$ $(days)$')
main_axes[0].set_ylabel(r'Decay Rate [mag/day]')
main_axes[0].set_title(r'Decay Rate g')
main_axes[0].legend()
main_axes[1].plot(xnew2, dspl2(xnew2), color = 'black',
label = 'B band')#, linestyle='none', marker='o', ms=6)
main_axes[1].set_xlabel(r'$Time$ $-$ $MJD$ $58285.441$ $(days)$')
main_axes[1].set_ylabel(r'Decay Rate [mag/day]')
main_axes[1].set_title(r'Decay Rate B')
main_axes[1].legend()
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 30 19:41:25 2021
@author: duverne, IJClab, Orsay, duverne@protonmail.com
"""
import glob
from muphoten.utils import list_files
import shutil
kped = '/media/duverne/DISQUE ESSB/AT2018cow/kepd/r_tempo/'
lt_r = '/media/duverne/DISQUE ESSB/AT2018cow/LT/tempo/'
lt_i = '/media/duverne/DISQUE ESSB/AT2018cow/LT/tempo_i/'
tch_i = '/home/duverne/gmadet/TCH_sub/i_band/'
tch_r = '/home/duverne/gmadet/TCH_sub/r_band/'
l_kped = glob.glob(kped+'*/*/*', recursive=True)
l_lt_r = glob.glob(lt_r+'*/*/*', recursive=True)
l_lt_i = glob.glob(lt_i+'*/*/*', recursive=True)
l_tch_i = glob.glob(tch_i+'*/*/*', recursive=True)
l_tch_r = glob.glob(tch_r+'*/*/*', recursive=True)
def keep_sub(list_file):
list_file=[file for file in list_file if 'unconv' not in file and '0_sub' in file and 'mask' not in file]
# list_file=[file for file in list_file if 'ATLAS' in file]
return list_file
l_kped = keep_sub(l_kped)
l_lt_r = keep_sub(l_lt_r)
l_lt_i = keep_sub(l_lt_i)
l_tch_i = keep_sub(l_tch_i)
l_tch_r = keep_sub(l_tch_r)
# for im in l_kped:
# name='sub_'+im.split('/')[-3]+'.fits'
# # print(name)
# filePath = shutil.copy(im,
# '/media/duverne/DISQUE ESSB/AT2018cow/kepd/r_band/'+name)
# for im in l_lt_i:
# name='sub_'+im.split('/')[-3]+'.fits'
# print(name)
# filePath = shutil.copy(im,
# '/media/duverne/DISQUE ESSB/AT2018cow/LT/i_sdss/'+name)
# for im in l_lt_r:
# name='sub_'+im.split('/')[-3]+'.fits'
# print(name)
# filePath = shutil.copy(im,
# '/media/duverne/DISQUE ESSB/AT2018cow/LT/r_sdss/'+name)
for im in l_tch_i:
name='sub_'+im.split('/')[-3]+'.fit'
print(name)
filePath = shutil.copy(im,
'/media/duverne/DISQUE ESSB/AT2018cow/TCH/TCH_i/'+name)
for im in l_tch_r:
name='sub_'+im.split('/')[-3]+'.fit'
print(name)
filePath = shutil.copy(im,
'/media/duverne/DISQUE ESSB/AT2018cow/TCH/TCH_r/'+name)
# l_lt_r = dlen()
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 6 22:18:07 2021
@author: duverne, IJClab, Orsay, duverne@protonmail.com
"""
from astropy.io import fits
from astropy.time import Time
# hdu = fits.open('/home/duverne/Documents/AT2018cow_data/LT/g_band_to_test/h_e_20180806_23_2_1_1.fits')[0]
# header_lt = hdu.header
# hdu = fits.open('/home/duverne/Documents/atlas_cow_klotz/TCH_g/TCH_20180621_013618_g.fits')[0]
# header_tch = hdu.header
# hdu = fits.open('/home/duverne/Documents/muphoten/tests/test_im/2018cow_20180620_043132_Jun8kevf_kait_B_c/2018cow_20180620_043132_Jun8kevf_kait_B_c.fit')[0]
# header_kait = hdu.header
# hdu = fits.open('/home/duverne/Documents/ATLAS18qqn-S001-R001-C001-SDSS_g_ref_g.fits')[0]
# header_iris = hdu.header
images = ['/home/duverne/Documents/AT2018cow_data/LT/g_band_to_test/h_e_20180806_23_2_1_1.fits',
'/home/duverne/Documents/atlas_cow_klotz/TCH_g/TCH_20180621_013618_g.fits',
'/home/duverne/Documents/muphoten/tests/test_im/2018cow_20180620_043132_Jun8kevf_kait_B_c/2018cow_20180620_043132_Jun8kevf_kait_B_c.fit',
'/home/duverne/Documents/ATLAS18qqn-S001-R001-C001-SDSS_g_ref_g.fits',
'/media/duverne/DISQUE ESSB/25z_AbAO/image/15 42 36 +28 25 55-001R.fits',
'/media/duverne/DISQUE ESSB/25z_AbAO/image/16 04 09 +24 19 50-001R.fits',
'/media/duverne/DISQUE ESSB/AT2018cow_data/hct/20180620/20180620_sn18cow_B.fits',
'/media/duverne/DISQUE ESSB/AT2018cow_data/kped/20180707/ATLAS18qqn_0_g_20180707_043840.873786_o_0000.fits',
'/home/duverne/Documents/Entrainement_calibration/Non calibree AZT 8/8-004Rm.fit']
# headers = [header_lt, header_tch, header_kait, header_iris]
# def set_time(header):
# header = header_kait
def clean_time(header):
times = ['JD','DATE','DATE-OBS',
'BJD-OBS', 'HJD-OBS', 'JD-OBS']
if 'MJD-OBS' not in header:
for time in times:
if time in header:
try:
mjd = Time(header[time]).mjd
header["MJD-OBS"] = mjd
break
except ValueError:
continue
else:
time = 'MJD-OBS'
mjd = header["MJD-OBS"]
print(mjd, time)
for image in images:
hdu = fits.open(image)[0]
header = hdu.header
clean_time(header)
# mjd = header_kait.get('MJD-OBS')
# if mjd:
# pass