Processing EHT Data using oifits
¶
[1]:
from oifits.read import OIParser
Read the OIFITS file¶
[2]:
a = OIParser.read("test.oifits")
Get the Data in numpy array¶
[3]:
#output u1, v1, u2, v2, u3, v3, t3amp, t3phi, t3err
t3data = a.export_to_ascii()
[4]:
t3data
[4]:
array([[-9.20213077e+08, 2.24862919e+09, 4.10961013e+09, ...,
-1.15278000e+00, 2.40325297e-03, 1.57017926e+00],
[ 5.48462302e+08, 5.78208363e+08, 4.10961013e+09, ...,
3.01467000e-01, 1.47845916e-03, 9.35142886e-01],
[-1.46867538e+09, 1.67042083e+09, 4.65807243e+09, ...,
2.22968800e+00, 1.76167204e-03, 1.19469978e+00],
...,
[-7.87694372e+08, 2.25763849e+09, 4.01444035e+09, ...,
3.47386000e-01, 2.41208086e-03, 1.59243070e+00],
[ 5.71504343e+08, 5.72300483e+08, 4.01444035e+09, ...,
1.26194000e+00, 1.48569496e-03, 9.34430629e-01],
[-1.35919871e+09, 1.68533801e+09, 4.58594469e+09, ...,
5.00440000e-01, 1.75579165e-03, 1.23489333e+00]])
That’s it, now you can apply any type of data science model to analyse the data. The 500 lines of code you had to write everytime is reduced to mere 3 line code