From 1b18ccfa44b91678da3a334266441c8a15b35ea0 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Thu, 29 Oct 2020 11:07:30 -0700 Subject: [PATCH 1/2] Initial cropping utilities --- isis/scripts/crop_chandrayaan.ipynb | 457 ++++++++++++++++++++++++++++ isis/scripts/crop_kaguya.ipynb | 350 +++++++++++++++++++++ isis/scripts/crop_leisa.ipynb | 173 +++++++++++ isis/scripts/crop_marci.ipynb | 236 ++++++++++++++ 4 files changed, 1216 insertions(+) create mode 100644 isis/scripts/crop_chandrayaan.ipynb create mode 100644 isis/scripts/crop_kaguya.ipynb create mode 100644 isis/scripts/crop_leisa.ipynb create mode 100644 isis/scripts/crop_marci.ipynb diff --git a/isis/scripts/crop_chandrayaan.ipynb b/isis/scripts/crop_chandrayaan.ipynb new file mode 100644 index 0000000000..a8e2643bd5 --- /dev/null +++ b/isis/scripts/crop_chandrayaan.ipynb @@ -0,0 +1,457 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import pvl\n", + "import struct\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import datetime\n", + "import os.path\n", + "import binascii" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "class RealIsisCubeLabelEncoder(pvl.encoder.IsisCubeLabelEncoder): \n", + " def encode_time(self, value):\n", + " if value.microsecond:\n", + " second = u'%02d.%06d' % (value.second, value.microsecond)\n", + " else:\n", + " second = u'%02d' % value.second\n", + "\n", + " time = u'%02d:%02d:%s' % (value.hour, value.minute, second)\n", + " return time.encode('utf-8')" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "chan_file = '/home/arsanders/testData/chandrayaan/forwardDescending/input/M3G20081129T171431_V03_L1B.LBL'\n", + "image_file = chan_file" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "header = pvl.load(chan_file)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "rdn_file = os.path.dirname(chan_file) + \"/\"+ header['RDN_FILE']['^RDN_IMAGE']\n", + "obs_file = os.path.dirname(chan_file) + \"/\"+ header['OBS_FILE']['^OBS_IMAGE']\n", + "loc_file = os.path.dirname(chan_file) + \"/\"+ header['LOC_FILE']['^LOC_IMAGE']\n", + "tab_file = os.path.dirname(chan_file) + \"/\"+ header['UTC_FILE']['^UTC_TIME_TABLE']" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [], + "source": [ + "with open(rdn_file, 'rb') as f:\n", + " # From the end, seek n_records * record_size backwards\n", + " f.seek(-header['RDN_FILE']['RECORD_BYTES'] * header['RDN_FILE']['FILE_RECORDS'], 2)\n", + " b_image_data = f.read()" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "n_lines = 5\n", + "line_length = header['RDN_FILE']['RDN_IMAGE']['LINE_SAMPLES'] * (header['RDN_FILE']['RDN_IMAGE']['SAMPLE_BITS']//8)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def read_chandrayaan(b_image_data, line_length, n_lines, n_bands):\n", + " image_data = []\n", + " for j in range(n_lines*n_bands):\n", + " image_sample = np.frombuffer(b_image_data[j*line_length:(j+1)*line_length],\n", + " dtype=np.float32, count=int(line_length/4))\n", + " image_data.append(image_sample)\n", + " return np.array(image_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "n_bands = header['RDN_FILE']['RDN_IMAGE']['BANDS']\n", + "n_output_bands = 3\n", + "image_data = read_chandrayaan(b_image_data, line_length, n_lines, n_bands)\n", + "cropped_image_data = image_data[np.where(np.arange(image_data.shape[0]) % n_bands < n_output_bands)]\n", + "#cropped_image_data = image_data" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(15, 304)" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cropped_image_data.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAAoCAYAAAAbporbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAANfklEQVR4nO2dbail11XHf//9nHPuvKTNSydNhnaaZqZTJWhpQwxCpF8UbfIlFvwQKVJBKIoFiwpGi1L9ICjoB6lGIhZUxIJvmI8NRRERG2ubSVLScTKTSNLEvHTSTNLM3HvOs5cf9utz7j137iQ3OT3H/Ycz57nPs5+113+ttdfee505z5GZ0dDQ0NCwnnDLVqChoaGh4a1DS/INDQ0Na4yW5BsaGhrWGC3JNzQ0NKwxWpJvaGhoWGO0JN/Q0NCwxthTkpf0MUmnJT0h6d4drkvSH8Xrj0i6df9VbWhoaGi4Ulw2yUvqgD8G7gRuAX5a0i1zze4ETsbXp4D79lnPhoaGhoY3gL2s5G8HnjCzc2a2BXwRuHuuzd3AX1rAfwDXSDq6z7o2NDQ0NFwhRnto8yHgByU9Dnjga8ArO7T5hKRfq+S+B3hukdCJNuwAh0GAAVK+lk7lYzPk4nzUOUjf0vXx3blwR7rJLMhT1YbYhxmz42NGZ7cGfebO0kFSwgycwnHqWyqNzUf9q75dx4nvf5mz37xmB+bVfaVDLr13xIFnZqVZ3a8qnbyFa12wh3UO9T6c6z3mPeq6eG/UtTamoq28D/ePR+F+b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7vQiLncDXzSzTTN7EniC4N/vWSzgtwgrw8/MnjOzr8XjV4HHCY/7Xnnf7cJtEVaJm5nZa/HPcXwZ++i3ZST59wBPV38/w+4OWwUY8CVJ/xWfzwNwg8WHtMX3dy9NuzePRVzWyZefjj9d+YVqa7yS/CS9H/gIYVW4Vr6b4wZr4DdJXfyi6QvAg2a2r35bRpLf6YtVq/5ffO4ws1sJP4P4i5I+umyF3iasiy/vA04AHyb80M0fxPMrx0/SVcDfA5+x8EyphU13OLdq3NbCb2bWm9mHCY9ov13SD+zS/Iq5LSPJPwMcq/7e8dnzqwQzeza+vwD8I2H79Hz6CcT4/sLyNHzTWMRlLXxpZs/HgeaBP6Nsf1eKn6QxIQn+tZn9Qzy9Fr7bidu6+C3BzL4D/AvwMfbRb8tI8vn59JImwD3AA0vQY18g6bDCL2Yh6TDw44QfWnkA+GRs9kngn5aj4b5gEZcHgHskbSj83sBJ4KEl6PemoOHvEX+c4D9YIX6SBPw58LjFJ8VGrLzvFnFbE79dL+maeHwQ+DHgm+yn35b0ifJdhE/IzwKfXfYn3G+Sy3HCp92ngG8kPsC7CD+TeCa+X7dsXffI528IW98pYdXwc7txAT4b/XgauHPZ+r9Bfn8FPAo8EgfR0VXjB/wIYdv+CPBwfN21Dr7bhds6+O1DwNcjh8eA34rn981v7RuvDQ0NDWuM9o3XhoaGhjVGS/INDQ0Na4yW5BsaGhrWGC3JNzQ0NKwxWpJvaGhoWGO0JN/Q0NCwxmhJvqGhoWGN0ZJ8Q0NDwxrj/wD3qPplM0WGxAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.imshow(cropped_image_data[0::n_output_bands])" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "with open(obs_file, 'rb') as f:\n", + " # From the end, seek n_records * record_size backwards\n", + " f.seek(-header['OBS_FILE']['RECORD_BYTES'] * header['OBS_FILE']['FILE_RECORDS'], 2)\n", + " b_image_data = f.read()" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "n_bands = header['OBS_FILE']['OBS_IMAGE']['BANDS']\n", + "obs_image_data = read_chandrayaan(b_image_data, line_length, n_lines, n_bands)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(50, 304)" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "obs_image_data.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAAoCAYAAAAbporbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAJ4klEQVR4nO2dXchlVRnHf/990jE1Mz+qSc20vBlKbBATDG+ScryZBC+MCINAioS8CLKEsO4K6iIsw0ioiISySLpJkSIi8rOZcWQyx1IyxVHswyL86H26WGvtvfY6e++z33fOzOnsnh+8s/d+1rPWfp6zZv/P2s/7nn1kZjiO4zjTpFp1AI7jOM6Rw0XecRxnwrjIO47jTBgXecdxnAnjIu84jjNhXOQdx3EmzCiRl3S5pEclHZR0Q0e7JH0ttu+TtHP5oTqO4zibZaHIS5oBXwd2ATuAD0naUbjtAs6LP9cCtyw5TsdxHGcLjFnJXwQcNLM/mtnLwO3A7sJnN/BdC/wWOFnS9iXH6jiO42yS14zwOR94l6QDwAbwEPD3Dp8PS/pMNu4ZwDN9gx6rbXYcJ8w3qP4nO1SHT9tv2DbCXpyiNnbZy3gybNQ5B2zF+HOfR+7ts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4CBhfv9n6cmvj7XJz8yeMbOH4v6LwAHC477Xfu4GcutjnXIzM/tnPDwm/hhLnLdViPwZwJ+z46cYnrB1wIC7JD0Yn88D8CaLD2mL2zeuLLrDpy+XKc3ldfGrK2/Lbo3XMj9JbwPeTVgVTmruitxgAvMmaRY/aHoIuNvMljpvqxD5rg9Wrfuf+FxiZjsJX4P4SUmXrjqgo8RU5vIW4O3ABYQvuvlKtK9dfpJOBO4Arjezfwy5dtjWLbdJzJuZ/cfMLiA8ov0iSe8ccN90bqsQ+aeAs7LjzmfPrxNm9nTcHgJ+Qrh9elbxKxDj9tDqIjxs+nKZxFya2bPxQtsAvkVz+7tW+cUHCd4BfN/MfhzNk5i7rtymMm8JM/sb8EvgcpY4b6sQ+fr59JKOBa4G7lxBHEtB0gkK35iFpBOA9xO+aOVO4Jrodg3w09VEuBT6crkTuFrSNoXvGzgPuG8F8R0Wan8f8ZWE+YM1yk+SgG8DB6z9pNi1n7u+3CYyb6dLOjnuvxa4DPg9y5y3Ff1G+QrCb8gfB25c9W+4DzOXcwm/7d4LPJLyAU4lfE3iY3F7yqpjHZnPDwi3vq8QVg0fG8oFuDHO46PArlXHv8X8vgc8DOyLF9H2dcsPeC/htn0fsCf+XDGFuRvIbQrzdj7wu5jDfuDz0b60efNPvDqO40wY/8Sr4zjOhHGRdxzHmTAu8o7jOBPGRd5xHGfCuMg7juNMGBd5x3GcCeMi7ziOM2Fc5B3HcSbMfwFimKj5PP7vlAAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.imshow(obs_image_data[1::10])" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": {}, + "outputs": [], + "source": [ + "with open(loc_file, 'rb') as f:\n", + " # From the end, seek n_records * record_size backwards\n", + " f.seek(-header['LOC_FILE']['RECORD_BYTES'] * header['LOC_FILE']['FILE_RECORDS'], 2)\n", + " b_image_data = f.read()" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [], + "source": [ + "line_length = header['LOC_FILE']['LOC_IMAGE']['LINE_SAMPLES'] * (header['LOC_FILE']['LOC_IMAGE']['SAMPLE_BITS']//8)\n", + "n_bands = header['LOC_FILE']['LOC_IMAGE']['BANDS']\n", + "image_data = []\n", + "for j in range(n_lines*n_bands):\n", + " image_sample = np.frombuffer(b_image_data[j*line_length:(j+1)*line_length],\n", + " dtype=np.float64, count=int(line_length/8))\n", + " image_data.append(image_sample)\n", + "loc_image_data = np.array(image_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAAoCAYAAAAbporbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAH+0lEQVR4nO2dXagdVxXHf/855qNN1RoTNdRaW81L0FJDiEKkLxZt8hILPkREWhCKYsE+CEYLUn1T0AepRiIWVMSCX5jHhqKIiI1tzU1S0ti0VqwtSUP9qCKp7Vk+7D2fZ+acufeee+bOuH5wmD1rr71mrbvurDuzz509MjMcx3GcYZJ07YDjOI6zdniRdxzHGTBe5B3HcQaMF3nHcZwB40XecRxnwHiRdxzHGTCtirykWyWdk3Re0uGafkn6Ruw/JWn3/F11HMdxlsvMIi9pBHwT2A/sAj4qaVdFbT+wM37uBI7M2U/HcRxnBbS5kt8LnDezp83sZeAB4GBF5yDwfQv8Drha0o45++o4juMsk9e00LkReLeks8AYeAz4R43OxyR9rmD3GuD5JqMbtck2syUXqNwQgFQepJLixJhaWclEnV7cqRwq75rssAlRw/gZNieeNW7Ub3H8FuNrn21uGhP7Vj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DfDHK55Y3f+LVcRxnwPgTr47jOAPGi7zjOM6A8SLvOI4zYLzIO47jDBgv8o7jOAPGi7zjOM6A8SLvOI4zYLzIO47jDJj/AQr1U02IxH/WAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.imshow(loc_image_data[0::n_bands])" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": {}, + "outputs": [], + "source": [ + "rdn_fn, rdn_ext = os.path.splitext(rdn_file)\n", + "obs_fn, obs_ext = os.path.splitext(obs_file)\n", + "loc_fn, loc_ext = os.path.splitext(loc_file)\n", + "tab_fn, tab_ext = os.path.splitext(tab_file)\n", + "\n", + "mini_rdn_fn = rdn_fn + '_cropped' + rdn_ext\n", + "mini_rdn_bn = os.path.basename(mini_rdn_fn)\n", + "\n", + "mini_obs_fn = obs_fn + '_cropped' + obs_ext\n", + "mini_obs_bn = os.path.basename(mini_obs_fn)\n", + "\n", + "mini_loc_fn = loc_fn + '_cropped' + loc_ext\n", + "mini_loc_bn = os.path.basename(mini_loc_fn)\n", + "\n", + "mini_tab_fn = tab_fn + '_cropped' + tab_ext\n", + "mini_tab_bn = os.path.basename(mini_tab_fn)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [], + "source": [ + "header['RDN_FILE']['^RDN_IMAGE'] = mini_rdn_bn\n", + "header['OBS_FILE']['^OBS_IMAGE'] = mini_obs_bn\n", + "header['LOC_FILE']['^LOC_IMAGE'] = mini_loc_bn\n", + "header['UTC_FILE']['^UTC_TIME_TABLE'] = mini_tab_bn\n", + "\n", + "header['RDN_FILE']['FILE_RECORDS'] = n_lines\n", + "header['RDN_FILE']['RDN_IMAGE']['LINES'] = n_lines\n", + "header['RDN_FILE']['RDN_IMAGE']['BANDS'] = n_output_bands\n", + "header['RDN_FILE']['RECORD_BYTES'] = int(n_output_bands * (header['RDN_FILE']['RDN_IMAGE']['SAMPLE_BITS']/8) *header['RDN_FILE']['RDN_IMAGE']['LINE_SAMPLES'])\n", + "\n", + "header['LOC_FILE']['FILE_RECORDS'] = n_lines\n", + "header['LOC_FILE']['LOC_IMAGE']['LINES'] = n_lines\n", + "\n", + "header['OBS_FILE']['FILE_RECORDS'] = n_lines\n", + "header['OBS_FILE']['OBS_IMAGE']['LINES'] = n_lines\n", + "\n", + "header['UTC_FILE']['FILE_RECORDS'] = n_lines\n", + "header['UTC_FILE']['UTC_TIME_TABLE']['ROWS'] = n_lines" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": {}, + "outputs": [], + "source": [ + "label_fn, label_ext = os.path.splitext(chan_file)\n", + "out_label = label_fn + '_cropped' + label_ext\n", + "pvl.dump(header, out_label, cls=RealIsisCubeLabelEncoder)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "with open(mini_rdn_fn, 'wb+') as f:\n", + " b_reduced_image_data = cropped_image_data.tobytes()\n", + " f.seek(0, 2)\n", + " f.write(b_reduced_image_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": {}, + "outputs": [], + "source": [ + "with open(mini_loc_fn, 'wb+') as f:\n", + " b_reduced_image_data = loc_image_data.tobytes()\n", + " f.seek(0, 2)\n", + " f.write(b_reduced_image_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "with open(mini_obs_fn, 'wb+') as f:\n", + " b_reduced_image_data = obs_image_data.tobytes()\n", + " f.seek(0, 2)\n", + " f.write(b_reduced_image_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": {}, + "outputs": [], + "source": [ + "with open(tab_file) as f:\n", + " head = [next(f) for x in range(n_lines)]\n", + " head = \"\".join(head)\n", + "with open(mini_tab_fn, 'w+') as f:\n", + " f.write(head)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python autocnet", + "language": "python", + "name": "autocnet" + }, + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/isis/scripts/crop_kaguya.ipynb b/isis/scripts/crop_kaguya.ipynb new file mode 100644 index 0000000000..9dec7ac3eb --- /dev/null +++ b/isis/scripts/crop_kaguya.ipynb @@ -0,0 +1,350 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 80, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import pvl\n", + "import struct\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import datetime\n", + "import os.path\n", + "import binascii" + ] + }, + { + "cell_type": "code", + "execution_count": 120, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "#kaguya_file = '/scratch/arsanders/kaguyatc/TC2S2B0_01_03043N107E3384.img'\n", + "#kaguya_file = '/home/arsanders/testData/apollo/AS15-M-1450.lbl'\n", + "kaguya_file = '/home/arsanders/testData/marci/MOI_000009_0294_MU_00N044W.IMG'\n", + "image_file = kaguya_file" + ] + }, + { + "cell_type": "code", + "execution_count": 121, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "header = pvl.load(kaguya_file)" + ] + }, + { + "cell_type": "code", + "execution_count": 122, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "PVLModule([\n", + " ('PDS_VERSION_ID', 'PDS3')\n", + " ('FILE_NAME', 'MOI_000009_0294_MU_00N044W.IMG')\n", + " ('RECORD_TYPE', 'FIXED_LENGTH')\n", + " ('RECORD_BYTES', 128)\n", + " ('FILE_RECORDS', 2259)\n", + " ('LABEL_RECORDS', 11)\n", + " ('^IMAGE', 12)\n", + " ('SPACECRAFT_NAME', 'MARS_RECONNAISSANCE_ORBITER')\n", + " ('INSTRUMENT_NAME', 'MARS COLOR IMAGER')\n", + " ('INSTRUMENT_HOST_NAME', 'MARS RECONNAISSANCE ORBITER')\n", + " ('MISSION_PHASE_NAME', 'POSTMOI')\n", + " ('TARGET_NAME', 'MARS')\n", + " ('INSTRUMENT_ID', 'MARCI')\n", + " ('PRODUCER_ID', 'MRO_MARCI_TEAM')\n", + " ('DATA_SET_ID', 'MRO-M-MARCI-2-EDR-L0-V1.0')\n", + " ('PRODUCT_CREATION_TIME', datetime.datetime(2007, 5, 17, 18, 31, 28))\n", + " ('SOFTWARE_NAME', 'makepds05 $Revision: 1.7 $')\n", + " ('UPLOAD_ID', 'UNK')\n", + " ('ORIGINAL_PRODUCT_ID', '4A_05_0001000200')\n", + " ('PRODUCT_ID', 'MOI_000009_0294_MU_00N044W')\n", + " ('START_TIME', datetime.datetime(2006, 3, 24, 4, 25, 53, 96000))\n", + " ('STOP_TIME', datetime.datetime(2006, 3, 24, 4, 55, 48, 296000))\n", + " ('SPACECRAFT_CLOCK_START_COUNT', '827641567:30')\n", + " ('SPACECRAFT_CLOCK_STOP_COUNT', 'N/A')\n", + " ('INTERFRAME_DELAY', Units(value=3.2, units='SECONDS'))\n", + " ('FOCAL_PLANE_TEMPERATURE', Units(value=240.9, units='K'))\n", + " ('SAMPLE_BIT_MODE_ID', 'SQROOT')\n", + " ('LINE_EXPOSURE_DURATION', Units(value=3112.237, units='MSEC'))\n", + " ('SAMPLING_FACTOR', 8)\n", + " ('SAMPLE_FIRST_PIXEL', 0)\n", + " ('FILTER_NAME', {'LONG_UV', 'SHORT_UV'})\n", + " ('RATIONALE_DESC', 'Post-MOI image of Argyre and Mare Erythraeum region')\n", + " ('DATA_QUALITY_DESC', 'OK')\n", + " ('ORBIT_NUMBER', 9)\n", + " ('IMAGE',\n", + " {'CHECKSUM': 12820826,\n", + " 'LINES': 2248,\n", + " 'LINE_PREFIX_BYTES': 0,\n", + " 'LINE_SAMPLES': 128,\n", + " 'LINE_SUFFIX_BYTES': 0,\n", + " 'SAMPLE_BITS': 8,\n", + " 'SAMPLE_BIT_MASK': 255,\n", + " 'SAMPLE_TYPE': 'UNSIGNED_INTEGER'})\n", + "])" + ] + }, + "execution_count": 122, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "header" + ] + }, + { + "cell_type": "code", + "execution_count": 123, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "12" + ] + }, + "execution_count": 123, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "header[\"^IMAGE\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 132, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "with open(kaguya_file, 'rb') as f:\n", + " try:\n", + " image_offset = header[\"^IMAGE\"].value-(header['IMAGE']['SAMPLE_BITS']//8)\n", + " f.seek(image_offset)\n", + " b_image_data = f.read()\n", + " except AttributeError:\n", + " # If detached label, \"^IMAGE\" will be a list.\n", + " image_file = os.path.dirname(kaguya_file) + \"/\" + header[\"^IMAGE\"][0]\n", + " image_offset = header[\"^IMAGE\"][1].value\n", + " with open(image_file, 'rb') as im_f:\n", + " b_image_data = im_f.read()" + ] + }, + { + "cell_type": "code", + "execution_count": 133, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "n_lines = 40\n", + "line_length = header['IMAGE']['LINE_SAMPLES'] * (header['IMAGE']['SAMPLE_BITS']//8)" + ] + }, + { + "cell_type": "code", + "execution_count": 137, + "metadata": {}, + "outputs": [ + { + "ename": "ValueError", + "evalue": "buffer is smaller than requested size", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0mimage_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mj\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mrange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mn_lines\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mimage_sample\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfrombuffer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb_image_data\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mj\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mline_length\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mj\u001b[0m\u001b[0;34m+\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mline_length\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mint16\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcount\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mline_length\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4\u001b[0m \u001b[0mimage_data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage_sample\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mimage_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mimage_data\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mValueError\u001b[0m: buffer is smaller than requested size" + ] + } + ], + "source": [ + "image_data = []\n", + "for j in range(n_lines):\n", + " image_sample = np.frombuffer(b_image_data[j*line_length:(j+1)*line_length], dtype=np.int16, count=int(line_length/2))\n", + " image_data.append(image_sample)\n", + "image_data = np.array(image_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 136, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(40, 64)" + ] + }, + "execution_count": 136, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "image_data.shape" + ] + }, + { + "cell_type": "code", + "execution_count": 135, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 135, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAADyCAYAAABUFp5YAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAc50lEQVR4nO3de3Bc5XkG8OfZXdkyssF2MNQFTwiUps0wiUkVhwSSOOZmOxBCJslAphnaMmP+CB1oyTROOm2T9o9CSkjTIaV1ihs3TUkJl8K45mIcKGGGgGUwxsY2BuIEg7G4Gdu67uXtHzoehL73sGe1e1b65Oc3o5H06Zzd76ykV6t9z/kemhlERCQ+hYmegIiIjI8KuIhIpFTARUQipQIuIhIpFXARkUipgIuIR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znsKgDbR30e+/EAwKfNbOGo0+1iPqbvA7jXzH4PwIcw8r3K93jMrG1vAD4G4L5Rn38DwDfaOYcWHstJALaO+nwngPnJx/MB7JzoOTZxbHcBOHcqHBOAowA8AeCjMR8PgBOTArAEwNpkLNrjSea8G8CxY8aiPCYARwP4FZK+YruOp90voZwA4MVRn+9JxqaC481sLwAk74+b4PmMC8mTAJwO4DFEfEzJyw2bAfQCWG9mUR8PgH8E8BcARq9lG/PxACMx1PeT3ERyRTIW6zGdDOBVAP+evMz1byS7kPPxtLuAewsP6zSYSYLkTAC3A7jazA5M9HyaYWZVM1uIkWeui0ieNtFzGi+SFwDoNbNNEz2XFjvTzD6MkZdUv0rykxM9oSaUAHwYwE1mdjqAPrTh5Z92F/A9ABaM+vxEAC+3eQ552UdyPgAk73sneD4NIdmBkeL9EzO7IxmO+pgAwMz2A3gIIz2LWI/nTACfJbkbwE8BLCH5n4j3eAAAZvZy8r4XwJ0AFiHeY9oDYE/ynx4A3IaRgp7r8bS7gG8EcCrJ95GcBuASAHe3eQ55uRvAZcnHl2HkdeQokCSAmwFsN7MbRn0pymMiOY/k7OTjGQDOAbADkR6PmX3DzE40s5Mw8jvzczP7Q0R6PABAsovkrMMfAzgPwFZEekxm9gqAF0m+Pxk6G8AzyPt4JuDF/uUAngXwPIC/nOjmwziP4RYAewGUMfKX93IA78FIk2lX8n7uRM+zgeM5CyMvZW0BsDl5Wx7rMQH4IIAnk+PZCuCvk/Eoj2fMsS3G203MaI8HI68ZP5W8bTtcCyI/poUAepKfu/8BMCfv49GVmCIikdKVmCIikVIBFxGJlAq4iEikVMBFRCKlAi4iEikVcBGRSKmAi4hESgVcRCRS/w8d2w/Pypy3AQAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.imshow(image_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 112, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "class RealIsisCubeLabelEncoder(pvl.encoder.IsisCubeLabelEncoder): \n", + " def encode_time(self, value):\n", + " if value.microsecond:\n", + " second = u'%02d.%06d' % (value.second, value.microsecond)\n", + " else:\n", + " second = u'%02d' % value.second\n", + "\n", + " time = u'%02d:%02d:%s' % (value.hour, value.minute, second)\n", + " return time.encode('utf-8')" + ] + }, + { + "cell_type": "code", + "execution_count": 113, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "image_fn, image_ext = os.path.splitext(image_file)\n", + "mini_image_fn = image_fn + '_cropped' + image_ext\n", + "mini_image_bn = os.path.basename(mini_image_fn)\n", + "\n", + "# Overwrite the number of lines in the label\n", + "header['IMAGE']['LINES'] = n_lines\n", + "\n", + "if kaguya_file != image_file:\n", + " # If detached label, point the mini label to the mini image\n", + " header['^IMAGE'] = [mini_image_bn, pvl._collections.Units(1, 'BYTES')]\n", + " header['FILE_NAME'] = mini_image_bn\n", + "else:\n", + " # If attached label, calculate the new offset\n", + " header['^IMAGE'] = pvl._collections.Units(len(pvl.dumps(header, cls=RealIsisCubeLabelEncoder)), 'BYTES')" + ] + }, + { + "cell_type": "code", + "execution_count": 114, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "label_fn, label_ext = os.path.splitext(kaguya_file)\n", + "out_label = label_fn + '_cropped' + label_ext\n", + "\n", + "pvl.dump(header, out_label, cls=RealIsisCubeLabelEncoder)" + ] + }, + { + "cell_type": "code", + "execution_count": 115, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "with open(mini_image_fn, 'ab+') as f:\n", + " b_reduced_image_data = image_data.tobytes()\n", + " f.seek(0, 2)\n", + " f.write(b_reduced_image_data)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python autocnet", + "language": "python", + "name": "autocnet" + }, + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/isis/scripts/crop_leisa.ipynb b/isis/scripts/crop_leisa.ipynb new file mode 100644 index 0000000000..47b9b21426 --- /dev/null +++ b/isis/scripts/crop_leisa.ipynb @@ -0,0 +1,173 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from astropy.io import fits" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": {}, + "outputs": [], + "source": [ + "#test_data_filename = './tsts/badfiles/input/lsb_0034933739_0x53c_sci_1.fit'\n", + "#test_data_filename = './tsts/calib/input/lsb_0034933739_0x53c_sci_1.fit'\n", + "#test_data_filename = './tsts/qualityReplacement/input/lsb_0034931099_0x53c_sci_1.fit'\n", + "test_data_filename = './tsts/raw/input/lsb_0030594839_0x53d_eng_1.fit'\n", + "original_fits = fits.open(test_data_filename, mode='readonly')" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[, ]" + ] + }, + "execution_count": 42, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "original_fits" + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Filename: ./tsts/raw/input/lsb_0030594839_0x53d_eng_1.fit\n", + "No. Name Ver Type Cards Dimensions Format\n", + " 0 PRIMARY 1 PrimaryHDU 283 (256, 256, 319) int16 \n", + " 1 HOUSEKEEPING 1 BinTableHDU 183 46R x 75C [J, B, B, B, B, B, B, I, I, I, I, I, I, I, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, I, I, I, B, B, B, B, B, B, B, B, B, B, B, B, I, I, I, I, I, I, I, I, I, J, J, B, I, I, I, I, I, I, I, I, I, J] \n" + ] + } + ], + "source": [ + "fits.info(test_data_filename)" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "## This fuction creates and populates the HDU (Header Data Unit) for each FITS extension\n", + "## I fully expect that this function would need to be modified for other special-case FITS data.\n", + "def to_extension(header, data):\n", + " hdu = fits.ImageHDU()\n", + " hdu.data = data\n", + " \n", + " # Special case:\n", + " # These FITS files do not meet the FITS standard, so two keywords needed to be added to the header of \n", + " # most extensions so that astropy would write out a FITS file without error. \n", + " \n", + " # Don't add 'PCOUNT' or 'GCOUNT' to the primary image or the first extension\n", + " # These keywords aren't needed for the primary image and the first extenison already has them \n", + " if not('SIMPLE' in header.keys() or 'WCSNAME' in header.keys()):\n", + " header['PCOUNT'] = 0\n", + " header['GCOUNT'] = 1\n", + " hdu.header = header\n", + " return hdu" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "new_fits = fits.HDUList() \n", + "\n", + "# Copy cropped data from original FITS file into new FITS file.\n", + "for hdu in original_fits:\n", + " try:\n", + " new_fits.append(to_extension(hdu.header, hdu.data[0:3, 0:25]))\n", + " except:\n", + " pass" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "new_fits.writeto(\"./cropped/raw.fit\", overwrite='True')" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Filename: ./cropped/raw.fit\n", + "No. Name Ver Type Cards Dimensions Format\n", + " 0 PRIMARY 1 PrimaryHDU 280 (256, 25, 3) int16 \n" + ] + } + ], + "source": [ + "fits.info(\"./cropped/raw.fit\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "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.5.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/isis/scripts/crop_marci.ipynb b/isis/scripts/crop_marci.ipynb new file mode 100644 index 0000000000..41fffec6be --- /dev/null +++ b/isis/scripts/crop_marci.ipynb @@ -0,0 +1,236 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "import pvl\n", + "import struct\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "import datetime\n", + "import os.path\n", + "import binascii" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": {}, + "outputs": [], + "source": [ + "#kaguya_file = '/scratch/arsanders/kaguyatc/TC2S2B0_01_03043N107E3384.img'\n", + "#kaguya_file = '/home/arsanders/testData/apollo/AS15-M-1450.lbl'\n", + "marci_file = '/home/arsanders/testData/marci/T02_001251_1292_MU_00N237W.IMG'\n", + "image_file = marci_file" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "header = pvl.load(marci_file)" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "with open(marci_file, 'rb') as f:\n", + " try:\n", + " image_offset = ((header[\"^IMAGE\"]-1) * header[\"RECORD_BYTES\"]) - (header['IMAGE']['SAMPLE_BITS']//8)\n", + " f.seek(image_offset)\n", + " b_image_data = f.read()\n", + " except AttributeError:\n", + " # If detached label, \"^IMAGE\" will be a list.\n", + " image_file = os.path.dirname(marci_file) + \"/\" + header[\"^IMAGE\"][0]\n", + " image_offset = header[\"^IMAGE\"][1].value\n", + " with open(image_file, 'rb') as im_f:\n", + " b_image_data = im_f.read()" + ] + }, + { + "cell_type": "code", + "execution_count": 73, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "n_lines = 100\n", + "line_length = header['IMAGE']['LINE_SAMPLES'] * (header['IMAGE']['SAMPLE_BITS']//8)" + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "image_data = []\n", + "for j in range(n_lines):\n", + " image_sample = np.frombuffer(b_image_data[j*line_length:(j+1)*line_length], dtype=np.uint8, count=int(line_length))\n", + " image_data.append(image_sample)\n", + "image_data = np.array(image_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 75, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 75, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAATgAAAD7CAYAAAD+dIjEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO29e7hlV1Un+pt7n3PqXalK5Z0KqbxIiISXAYLa3WgQ0eaT7mvDRcFOK/3RfT9tRfiuF9p7r4qoKDa3bbXbjkjrp1wQESQ3ogSC0AYwECCQhKLyrNS7Tr3Oo85jP9ae948xxlxzjjXXOvtU1XnUqfH7vvPts9aar7323muOOeZv/Ibz3sNgMBjWIlorPQCDwWBYKtgDzmAwrFnYA85gMKxZ2APOYDCsWdgDzmAwrFnYA85gMKxZnNUDzjn3GufcHufck865d56rQRkMBsO5gDtTHpxzrg3gcQA/COAAgK8C+HHv/bfP3fAMBoPhzDFyFnVfBuBJ7/3TAOCc+wiA1wGofcCNuXV+PTZlr7mRtvwHAPD9/lkM7cxx4wtmwv8e9PDvqD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d+Nrp0bse7jE7GHwHtljwF4JeW28k5xPi+D2QKfwvAw/z3IwB2gJz5T/DrxSs9VjXuV6LcZFi1YwXwIgAP8f39awDbV+t4AfwqgO8AeBTAnwFYt5rGCuDDIP9gD2TxvKVpfAB+iX93ewD88CoZ75MgX5v81v5wKcZroVoGg2HNwiIZDAbDmoU94AwGw5qFPeAMBsOahT3gDAbDmoU94AwGw5qFPeAMBsOahT3gDAbDmsX/D7JBfjFC/VSfAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "plt.imshow(image_data)" + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "class RealIsisCubeLabelEncoder(pvl.encoder.IsisCubeLabelEncoder): \n", + " def encode_time(self, value):\n", + " if value.microsecond:\n", + " second = u'%02d.%06d' % (value.second, value.microsecond)\n", + " else:\n", + " second = u'%02d' % value.second\n", + "\n", + " time = u'%02d:%02d:%s' % (value.hour, value.minute, second)\n", + " return time.encode('utf-8')" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "image_fn, image_ext = os.path.splitext(image_file)\n", + "mini_image_fn = image_fn + '_cropped' + image_ext\n", + "mini_image_bn = os.path.basename(mini_image_fn)\n", + "\n", + "# Overwrite the number of lines in the label\n", + "header['IMAGE']['LINES'] = n_lines\n", + "\n", + "if marci_file != image_file:\n", + " # If detached label, point the mini label to the mini image\n", + " #header['^IMAGE'] = [mini_image_bn, pvl._collections.Units(1, 'BYTES')]\n", + " header['FILE_NAME'] = mini_image_bn\n", + "else:\n", + " # If attached label, calculate the new offset\n", + " header['^IMAGE'] = pvl._collections.Units(len(pvl.dumps(header, cls=RealIsisCubeLabelEncoder)), 'BYTES')" + ] + }, + { + "cell_type": "code", + "execution_count": 78, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "label_fn, label_ext = os.path.splitext(marci_file)\n", + "out_label = label_fn + '_cropped' + label_ext\n", + "\n", + "pvl.dump(header, out_label, cls=RealIsisCubeLabelEncoder)" + ] + }, + { + "cell_type": "code", + "execution_count": 79, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "with open(mini_image_fn, 'ab+') as f:\n", + " b_reduced_image_data = image_data.tobytes()\n", + " #f.seek(0, 2)\n", + " f.write(b_reduced_image_data)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python autocnet", + "language": "python", + "name": "autocnet" + }, + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From b570544a2a09753afc28dd65975c9652d01013c3 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Thu, 29 Oct 2020 18:40:11 -0700 Subject: [PATCH 2/2] Moved notebooks from scripts to notebooks directory --- isis/{scripts => notebooks}/crop_chandrayaan.ipynb | 0 isis/{scripts => notebooks}/crop_kaguya.ipynb | 0 isis/{scripts => notebooks}/crop_leisa.ipynb | 0 isis/{scripts => notebooks}/crop_marci.ipynb | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename isis/{scripts => notebooks}/crop_chandrayaan.ipynb (100%) rename isis/{scripts => notebooks}/crop_kaguya.ipynb (100%) rename isis/{scripts => notebooks}/crop_leisa.ipynb (100%) rename isis/{scripts => notebooks}/crop_marci.ipynb (100%) diff --git a/isis/scripts/crop_chandrayaan.ipynb b/isis/notebooks/crop_chandrayaan.ipynb similarity index 100% rename from isis/scripts/crop_chandrayaan.ipynb rename to isis/notebooks/crop_chandrayaan.ipynb diff --git a/isis/scripts/crop_kaguya.ipynb b/isis/notebooks/crop_kaguya.ipynb similarity index 100% rename from isis/scripts/crop_kaguya.ipynb rename to isis/notebooks/crop_kaguya.ipynb diff --git a/isis/scripts/crop_leisa.ipynb b/isis/notebooks/crop_leisa.ipynb similarity index 100% rename from isis/scripts/crop_leisa.ipynb rename to isis/notebooks/crop_leisa.ipynb diff --git a/isis/scripts/crop_marci.ipynb b/isis/notebooks/crop_marci.ipynb similarity index 100% rename from isis/scripts/crop_marci.ipynb rename to isis/notebooks/crop_marci.ipynb