Advertisement
AntonioRicardoDammae

Untitled

Mar 24th, 2021 (edited)
940
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.43 KB | None | 0 0
  1. #import subprocess
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4. plt.rcParams['figure.figsize'] = [50, 25]
  5.  
  6. ###################### Banda I ######################
  7. data_i_teo_x, data_i_teo_y = np.loadtxt("data_i_teo.dat", ndmin=2, usecols=(0, 1), unpack = True)
  8. data_i_ph_x, data_i_ph_y, data_i_ph_yerr = np.loadtxt("data_i_ph.dat", ndmin=2, usecols=(0, 1, 2), unpack = True)
  9.  
  10. plt.plot(data_i_ph_x, data_i_ph_y, '.', color="grey", label="Dados", linewidth=0.05)
  11. plt.plot(data_i_teo_x, data_i_teo_y, '-', color="r" ,label="Modelo", linewidth=1.0)
  12.  
  13. plt.errorbar(data_i_ph_x, data_i_ph_y, yerr=data_i_ph_yerr, fmt='ro', label="data", ecolor='black')
  14.  
  15.  
  16. plt.text(0.9, 14.95, 'Banda I',
  17.          #rotation=45,
  18.          horizontalalignment='center',
  19.          verticalalignment='top',
  20.          multialignment='center')
  21. #####################################################
  22.  
  23. ###################### Banda V ######################
  24. data_v_teo_x, data_v_teo_y = np.loadtxt("data_v_teo.dat", ndmin=2, usecols=(0, 1), unpack = True)
  25. data_v_ph_x, data_v_ph_y = np.loadtxt("data_v_ph.dat", ndmin=2, usecols=(0, 1), unpack = True)
  26.  
  27. plt.plot(data_v_ph_x, data_v_ph_y, '.', color="grey",  linewidth=0.05)
  28. plt.plot(data_v_teo_x, data_v_teo_y, '-', color="r", linewidth=1.0)
  29.  
  30. plt.text(0.9, 15.25, 'Banda V',
  31.          #rotation=45,
  32.          horizontalalignment='center',
  33.          verticalalignment='top',
  34.          multialignment='center')
  35.  
  36. #####################################################
  37.  
  38.  
  39. plt.title("VFTS 061")
  40. plt.xlim([-0.02, 1.02])
  41. plt.ylim([15.7, 14.9 ])
  42. plt.xlabel("Orbital Phase")
  43. plt.ylabel("Mag")
  44. plt.legend()
  45. #plt.savefig("polyfit_pfcsv.pdf")
  46.  
  47.  
  48. #from itertools import zip_longest as z
  49.  
  50. ##########################################################################################################
  51.  
  52. ###################### RV I ######################
  53. rv1_teo_x, rv1_teo_y = np.loadtxt("rv1_teo.dat", ndmin=2, usecols=(0, 1), unpack = True)
  54. rv1_obs_x, rv1_obs_y = np.loadtxt("rv1_obs.dat", ndmin=2, usecols=(0, 1), unpack = True)
  55.  
  56. #plt.plot(t1, t2 ,'.', color="r" , label="Modelo", linewidth=1.0)
  57.  
  58. l = list(rv1_teo_x)
  59. t1=list(np.sort(rv1_teo_x))
  60.  
  61. t2 = [rv1_teo_y[j] for j in [l.index(i) for i in t1]]
  62.  
  63. plt.plot(t1, t2 ,'-', color="r" , label="Modelo", linewidth=1.0)
  64. #plt.plot(rv1_teo_x, rv1_teo_y ,'.', color="r" , label="Modelo", linewidth=1.0)
  65. plt.plot( rv1_obs_x, rv1_obs_y ,'+', color="k", label="Dados", linewidth=0.05)
  66. #####################################################
  67.  
  68. ###################### RV II ######################
  69. rv2_teo_x, rv2_teo_y = np.loadtxt("rv2_teo.dat", ndmin=2, usecols=(0, 1), unpack = True)
  70. rv2_obs_x, rv2_obs_y = np.loadtxt("rv2_obs.dat", ndmin=2, usecols=(0, 1), unpack = True)
  71.  
  72. l2 = list(rv2_teo_x)
  73. t12=list(np.sort(rv2_teo_x))
  74.  
  75. t22 = [rv2_teo_y[j] for j in [l2.index(i) for i in t12]]
  76.  
  77. plt.plot(t12, t22 ,'-', color="r" , label="Modelo", linewidth=1.0)
  78.  
  79. #plt.plot(rv2_teo_x, rv2_teo_y ,'-', color="r" ,label="Modelo", linewidth=1.0)
  80. plt.plot(rv2_obs_x, rv2_obs_y ,'+', color="k", label="Dados", linewidth=0.05)
  81.  
  82.  
  83. #####################################################
  84. #tmp1 = z(rv1_teo_x, rv1_teo_y)
  85.  
  86.  
  87.  
  88. #print(rv1_teo_y)
  89. #print(t2)
  90. #t2=np.array([[i] for i in  )
  91. #t2=np.array(tmp1[i] for i in )
  92. #t2=np.array(rv1_teo_x==i for i in t1)
  93. #print(list(t2)
  94.  
  95. #print(dir(rv1_teo_x))
  96. #print(len(ttt1),len(set(ttt1)))
  97. #print(len(rv1_teo_y), len(set(rv1_teo_y)))
  98.  
  99. #print(rv1_teo_x)
  100. #print(rv1_teo_y)
  101.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement