{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "7d7ec9b3-a8f6-4e85-a472-8d5552c53eed",
   "metadata": {},
   "source": [
    "数据处理笔记与记录"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "21bdcaa3-3761-4c92-be8f-e51fc2d99df8",
   "metadata": {},
   "outputs": [],
   "source": [
    "from matplotlib import pyplot as plt\n",
    "import os\n",
    "import numpy as np\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8834938f-8857-45f2-9ab2-739fdc081fef",
   "metadata": {},
   "source": [
    "# 常用文件变量\n",
    "1. 参数项\n",
    "```\n",
    "-id D:\\codestorage\\testpolsarpro50\\prosarpro_sufarce_oh2004\\testpolsarpro50\\testpolsarpro50\\testpolsarpro50\\TestData\\TempData\\lee_filter  -od D:\\codestorage\\testpolsarpro50\\prosarpro_sufarce_oh2004\\testpolsarpro50\\testpolsarpro50\\testpolsarpro50\\TestData\\TempData\\out_result -iodf   T3   -ang  D:\\codestorage\\testpolsarpro50\\prosarpro_sufarce_oh2004\\testpolsarpro50\\testpolsarpro50\\testpolsarpro50\\TestData\\TempData\\incidence.dat    -ofr 0 -ofc 0 -fnr 8064 -fnc 7086 -fr 5.3 -un 0 -th1 100.0  -th2 700.0\n",
    "```\n",
    "2. 程序所在地址\n",
    "```\n",
    "D:\\codestorage\\testpolsarpro50\\prosarpro_sufarce_oh2004\\testpolsarpro50\\testpolsarpro50\\x64\\Release\n",
    "```\n",
    "3. 数据工作空间\n",
    "```\n",
    "D:\\codestorage\\testpolsarpro50\\prosarpro_sufarce_oh2004\\testpolsarpro50\\testpolsarpro50\\testpolsarpro50\\TestData\n",
    "```\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "7064c90e-143e-4e8f-88a0-18bdb6a7e27f",
   "metadata": {},
   "outputs": [],
   "source": [
    "T3_folder=r\"D:\\codestorage\\testpolsarpro50\\prosarpro_sufarce_oh2004\\testpolsarpro50\\testpolsarpro50\\testpolsarpro50\\TestData\\TempData\\lee_filter\"\n",
    "inc_folder=r\"D:\\codestorage\\testpolsarpro50\\prosarpro_sufarce_oh2004\\testpolsarpro50\\testpolsarpro50\\testpolsarpro50\\TestData\\TempData\\incidence.dat\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "824ac42f-8d7a-43a9-b9c5-69f0208faa2f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " 驱动器 D 中的卷是 新加卷\n",
      " 卷的序列号是 D0A2-A693\n",
      "\n",
      " D:\\codestorage\\testpolsarpro50\\prosarpro_sufarce_oh2004\\testpolsarpro50\\testpolsarpro50\\testpolsarpro50\\TestData\\TempData\\lee_filter 的目录\n",
      "\n",
      "2024/02/07  03:49    <DIR>          .\n",
      "2024/02/07  03:49    <DIR>          ..\n",
      "2024/01/24  17:36                97 config.txt\n",
      "2024/01/24  17:39       228,566,016 T11.bin\n",
      "2024/02/07  03:49        76,106,970 T11.bin.enp\n",
      "2024/02/07  03:49               243 T11.hdr\n",
      "2024/01/24  17:39       228,566,016 T12_imag.bin\n",
      "2024/01/24  17:39       228,566,016 T12_real.bin\n",
      "2024/01/24  17:39       228,566,016 T13_imag.bin\n",
      "2024/01/24  17:39       228,566,016 T13_real.bin\n",
      "2024/01/24  17:39       228,566,016 T22.bin\n",
      "2024/01/24  17:39       228,566,016 T23_imag.bin\n",
      "2024/01/24  17:39       228,566,016 T23_real.bin\n",
      "2024/01/24  17:39       228,566,016 T33.bin\n",
      "              12 个文件  2,133,201,454 字节\n",
      "               2 个目录 471,848,288,256 可用字节\n"
     ]
    }
   ],
   "source": [
    "!dir D:\\codestorage\\testpolsarpro50\\prosarpro_sufarce_oh2004\\testpolsarpro50\\testpolsarpro50\\testpolsarpro50\\TestData\\TempData\\lee_filter"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ea19f925-cbcf-463b-83d6-3f2627d2c780",
   "metadata": {},
   "source": [
    "# 展示原始数据数据 T3、入射角数据\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "258bc4f2-3bc2-4195-83ac-7619418d21de",
   "metadata": {},
   "outputs": [],
   "source": [
    "T11=np.fromfile(os.path.join(T3_folder,\"T11.bin\"),dtype=np.float32)\n",
    "T12=np.fromfile(os.path.join(T3_folder,\"T12_real.bin\"),dtype=np.float32)+np.fromfile(os.path.join(T3_folder,\"T12_imag.bin\"),dtype=np.float32)*1j\n",
    "T13=np.fromfile(os.path.join(T3_folder,\"T13_real.bin\"),dtype=np.float32)+np.fromfile(os.path.join(T3_folder,\"T13_imag.bin\"),dtype=np.float32)*1j\n",
    "T22=np.fromfile(os.path.join(T3_folder,\"T22.bin\"),dtype=np.float32) \n",
    "T23=np.fromfile(os.path.join(T3_folder,\"T23_real.bin\"),dtype=np.float32)+np.fromfile(os.path.join(T3_folder,\"T23_imag.bin\"),dtype=np.float32)*1j\n",
    "T33=np.fromfile(os.path.join(T3_folder,\"T33.bin\"),dtype=np.float32)\n",
    "incidenceData=np.fromfile(r\"D:\\codestorage\\testpolsarpro50\\prosarpro_sufarce_oh2004\\testpolsarpro50\\testpolsarpro50\\testpolsarpro50\\TestData\\TempData\\incidence.dat\",dtype=np.float32)\n",
    "# 数据格式重整化\n",
    "T11=T11.reshape(8064,7086)\n",
    "T12=T12.reshape(8064,7086)\n",
    "T13=T13.reshape(8064,7086)\n",
    "T22=T22.reshape(8064,7086)\n",
    "T23=T23.reshape(8064,7086)\n",
    "T33=T33.reshape(8064,7086)\n",
    "incidenceData=incidenceData.reshape(8781,10520)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f95a7843-3fd8-480a-aa4c-a36950607821",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8f72330a-2a6f-453b-8aad-18b4a59cd0cf",
   "metadata": {},
   "outputs": [],
   "source": [
    "print(\"T11\")\n",
    "plt.matshow(T11,cmap=\"gist_rainbow\" ,vmin=0, vmax=1)\n",
    "plt.colorbar(cmap=\"gist_rainbow\")\n",
    "plt.show()\n",
    "print(\"T12 amp\")\n",
    "plt.matshow(np.abs(T12),cmap=\"gist_rainbow\" ,vmin=0, vmax=1)\n",
    "plt.colorbar(cmap=\"gist_rainbow\")\n",
    "plt.show()\n",
    "print(\"T13 amp\")\n",
    "plt.matshow(np.abs(T13),cmap=\"gist_rainbow\" ,vmin=0, vmax=1)\n",
    "plt.colorbar(cmap=\"gist_rainbow\")\n",
    "plt.show()\n",
    "print(\"T12 pha\")\n",
    "plt.matshow(np.angle(T12),cmap=\"gist_rainbow\")\n",
    "plt.colorbar(cmap=\"gist_rainbow\")\n",
    "plt.show()\n",
    "print(\"T13 pha\")\n",
    "plt.matshow(np.angle(T13),cmap=\"gist_rainbow\")\n",
    "plt.colorbar(cmap=\"gist_rainbow\")\n",
    "plt.show()\n",
    "print(\"T22\")\n",
    "plt.matshow(T22,cmap=\"gist_rainbow\" ,vmin=0, vmax=1)\n",
    "plt.colorbar(cmap=\"gist_rainbow\")\n",
    "plt.show()\n",
    "print(\"T23 amp \")\n",
    "plt.matshow(np.abs(T23),cmap=\"gist_rainbow\" ,vmin=0, vmax=1)\n",
    "plt.colorbar(cmap=\"gist_rainbow\")\n",
    "plt.show()\n",
    "print(\"T23 pha \")\n",
    "plt.matshow(np.angle(T23),cmap=\"gist_rainbow\")\n",
    "plt.colorbar(cmap=\"gist_rainbow\")\n",
    "plt.show()\n",
    "print(\"T33\")\n",
    "plt.matshow(T11,cmap=\"gist_rainbow\" ,vmin=0, vmax=1)\n",
    "plt.colorbar(cmap=\"gist_rainbow\")\n",
    "plt.show()\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "99f573d2-5716-43ab-9dfc-0a79c056ef87",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "83c217d4-55b2-4e4a-95cf-814c98db113b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "1fd36d09-f3c2-493a-8e2f-46c47f9786f3",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "12ef75ae-cdca-4791-b3e8-352a41375b43",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d7c9af73-b57e-44eb-a362-eceb74beb126",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "433ff571-113b-42c1-b50d-92398ca64d38",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a0fca093-b2ae-48ee-9d8e-f8d4c037db07",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c5c4605b-0510-4999-9f33-268f311727f9",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fdb6324f-8afa-4590-ab86-473f48fdc666",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4a85daac-8298-48c6-ad2c-e541d9750401",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "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.8.18"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
