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

Commit f00ced35 authored by DUVERNE Pierre-Alexandre's avatar DUVERNE Pierre-Alexandre
Browse files

Delete harry_plotter.py

parent 2757efce
#!/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)
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