{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import bz2\n",
    "import copy\n",
    "import json\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "# %matplotlib qt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "125.0\n"
     ]
    }
   ],
   "source": [
    "in_name = '../dunevd-resp-isoc3views.json.bz2'\n",
    "in_name = '../pcbro-response-avg.json.bz2'\n",
    "orig = json.loads(bz2.BZ2File(in_name, 'r').read())\n",
    "orig['FieldResponse']['origin'] = 100 + 25.0 #89.2\n",
    "btext = json.dumps(orig, indent=2).encode()\n",
    "bz2.BZ2File('test.json.bz2', 'w').write(btext)\n",
    "test = json.loads(bz2.BZ2File('test.json.bz2', 'r').read())\n",
    "print(test['FieldResponse']['origin'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-1.9895196601282805e-13"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "3005.0700000000002-2815.8700000000003-189.20000000000002"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "189.2\n"
     ]
    }
   ],
   "source": [
    "in_name = '../dunevd-resp-isoc3views-18d92.json.bz2'\n",
    "orig = json.loads(bz2.BZ2File(in_name, 'r').read())\n",
    "print(orig['FieldResponse']['origin'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "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.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
