{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Processing EHT Data using `oifits`" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from oifits.read import OIParser" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Read the OIFITS file" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "a = OIParser.read(\"test.oifits\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Get the Data in numpy array" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "#output u1, v1, u2, v2, u3, v3, t3amp, t3phi, t3err\n", "t3data = a.export_to_ascii()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[-9.20213077e+08, 2.24862919e+09, 4.10961013e+09, ...,\n", " -1.15278000e+00, 2.40325297e-03, 1.57017926e+00],\n", " [ 5.48462302e+08, 5.78208363e+08, 4.10961013e+09, ...,\n", " 3.01467000e-01, 1.47845916e-03, 9.35142886e-01],\n", " [-1.46867538e+09, 1.67042083e+09, 4.65807243e+09, ...,\n", " 2.22968800e+00, 1.76167204e-03, 1.19469978e+00],\n", " ...,\n", " [-7.87694372e+08, 2.25763849e+09, 4.01444035e+09, ...,\n", " 3.47386000e-01, 2.41208086e-03, 1.59243070e+00],\n", " [ 5.71504343e+08, 5.72300483e+08, 4.01444035e+09, ...,\n", " 1.26194000e+00, 1.48569496e-03, 9.34430629e-01],\n", " [-1.35919871e+09, 1.68533801e+09, 4.58594469e+09, ...,\n", " 5.00440000e-01, 1.75579165e-03, 1.23489333e+00]])" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t3data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "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" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }