{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "954fc21e-70af-40a6-b660-bba761a21cfb",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import pandas\n",
    "import os\n",
    "import glob\n",
    "import matplotlib.patheffects as pe\n",
    "import matplotlib as mpl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "7373eb14-0664-4e81-90b9-bc3abd1ceafc",
   "metadata": {},
   "outputs": [],
   "source": [
    "new_rc_params = {'text.usetex': False,\n",
    "\"svg.fonttype\": 'none'\n",
    "}\n",
    "mpl.rcParams.update(new_rc_params)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "315a4dcb-3613-4e98-acda-0600a5a89af3",
   "metadata": {},
   "outputs": [],
   "source": [
    "os.chdir(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\Fig 1')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "bb71081d-f289-468a-b6c0-a2adb845bbcb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(99, 81)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\cb23\\AppData\\Local\\Temp\\ipykernel_39740\\1874454970.py:20: UserWarning: Tight layout not applied. tight_layout cannot make Axes height small enough to accommodate all Axes decorations.\n",
      "  plt.tight_layout()\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 36056 characters]",
      "text/plain": [
       "<Figure size 300x600 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "image = np.genfromtxt(r'MFM 201-MS43-SO4-3Reps-(Ir-CoB-Pt)_rotated.txt', skip_header = 4)\n",
    "\n",
    "image = np.flipud(image)*1e2\n",
    "\n",
    "print(image.shape)\n",
    "\n",
    "plt.figure(figsize = (3,6))\n",
    "ax1 = plt.subplot2grid((24,12), (0,0), rowspan = 20, colspan = 12)\n",
    "im = ax1.imshow(image[2:-2, 3:-8], origin = 'lower', cmap = 'gray', extent = (0,3.5,0,4.75), vmin = -8, vmax = 8, aspect = 'auto')\n",
    "# ax1.plot([0.2,1.2], [0.2,0.2], color = 'k', lw = 10)#path_effects=[pe.Stroke(linewidth=20, foreground='k'), pe.Normal()])\n",
    "ax1.set_xlabel(r'$x\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.set_ylabel(r'$y\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.tick_params(axis='both', labelsize= 12)\n",
    "\n",
    "ax2 = plt.subplot2grid((24,12), (23,0), rowspan = 2, colspan = 12)\n",
    "cbar = plt.colorbar(mappable = im, cax = ax2, orientation = 'horizontal', shrink = 0.7, aspect = 20)\n",
    "cbar.ax.tick_params(labelsize=12)\n",
    "cbar.set_label(label = r'Phase Shift ($\\times 10^{-2}\\ ^{\\circ}$)', size=15)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\Fig 1\\MFM_Fig.svg', format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 202,
   "id": "5e954521-a0eb-46f4-bf26-6bfd90e62f8e",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true,
     "source_hidden": true
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(456,)\n",
      "(569, 456)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x18707fa2660>]"
      ]
     },
     "execution_count": 202,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 15868 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 47328 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "image = np.genfromtxt(r'Scan-14_4.5x6.5um_512_774px_0.02Hz_0.5Hz_SP_+1V_TipHeater_6V_Ch_Out_0.5uV-P2-ve-P10+ve-(Analayed)c.txt', skip_header = 4)\n",
    "\n",
    "bg = bg_sk\n",
    "ave = 10\n",
    "\n",
    "sums = []\n",
    "for i in range(len(image-ave)):\n",
    "    mean = np.mean(image[i:i+ave], axis = 0)\n",
    "    \n",
    "    sums.append(np.sum(mean - bg[:,1]))\n",
    "plt.figure()\n",
    "plt.plot(np.array(sums)*1e8, 'b.')\n",
    "# plt.ylim(-1,1)\n",
    "plt.xlim(260,270)\n",
    "plt.grid()\n",
    "\n",
    "av = np.mean(image[263:273], axis = 0)\n",
    "print(av.shape)\n",
    "print(image.shape)\n",
    "\n",
    "# av = []\n",
    "# for i in range(0, len(image[70])-10, 10):\n",
    "#     av.append(np.mean(bg[:,1][i:i+10]))\n",
    "\n",
    "plt.figure()\n",
    "plt.plot(bg[:,0], bg[:,1], 'b-')\n",
    "plt.plot(bg[:,0], image[268], 'r-')\n",
    "plt.plot(bg[:, 0], av, 'k-')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "b8779d7c-6b28-47e3-84a5-c8abc1259764",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(566, 459)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\cb23\\AppData\\Local\\Temp\\ipykernel_39740\\965566029.py:27: UserWarning: Tight layout not applied. tight_layout cannot make Axes height small enough to accommodate all Axes decorations.\n",
      "  plt.tight_layout()\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 227848 characters]",
      "text/plain": [
       "<Figure size 300x600 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(566, 459)"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "image = np.genfromtxt(r'Scan-14_4.5x6.5um_512_774px_0.02Hz_0.5Hz_SP_+1V_TipHeater_6V_Ch_Out_0.5uV-P2-ve-P10+ve-(Analayed)c_rotated.txt', skip_header = 4)\n",
    "\n",
    "# image = image - np.flip(bg[:,1])\n",
    "# image = image-bg[:,1]\n",
    "\n",
    "image = image*1e7\n",
    "\n",
    "print(image.shape)\n",
    "\n",
    "plt.figure(figsize = (3,6))\n",
    "ax1 = plt.subplot2grid((24,12), (0,0), rowspan = 20, colspan = 12)\n",
    "im = ax1.imshow(image[5:, 5:-5], origin = 'lower', cmap = 'seismic', extent = (0,3.91,0,4.926), vmin = -3, vmax = 3, aspect = 'auto')\n",
    "ax1.plot([0,3.91], [(31/569)*4.926,(31/569)*4.926], 'c--')\n",
    "ax1.plot([0,3.91], [(131/569)*4.926,(131/569)*4.926], 'c--')\n",
    "ax1.plot([0,3.91], [(258/569)*4.926,(258/569)*4.926], 'm--')\n",
    "ax1.plot([0,3.91], [(268/569)*4.926,(268/569)*4.926], 'm--')\n",
    "# ax1.plot([0.2,1.2], [0.2,0.2], color = 'k', lw = 10)#path_effects=[pe.Stroke(linewidth=20, foreground='k'), pe.Normal()])\n",
    "ax1.set_xlabel(r'$x\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.set_ylabel(r'$y\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.tick_params(axis='both', labelsize= 12)\n",
    "\n",
    "ax2 = plt.subplot2grid((24,12), (23,0), rowspan = 2, colspan = 12)\n",
    "cbar = plt.colorbar(mappable = im, cax = ax2, orientation = 'horizontal', shrink = 0.7, aspect = 20)\n",
    "cbar.ax.tick_params(labelsize=12)\n",
    "cbar.set_label(label = r'Local V$_{\\mathrm{TE}}$ ($\\times 10^{-7}\\ \\mathrm{V}$)', size=15)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\Fig 1\\SThM_Fig.svg', format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()\n",
    "\n",
    "image.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "b76e3273-0fc9-4b20-bd2e-bc4cde688c63",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(566, 459)\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 105948 characters]",
      "text/plain": [
       "<Figure size 500x250 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(566, 459)"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "image = np.genfromtxt(r'Scan-14_4.5x6.5um_512_774px_0.02Hz_0.5Hz_SP_+1V_TipHeater_6V_Ch_Out_0.5uV-P2-ve-P10+ve-(Analayed)c_rotated.txt', skip_header = 4)\n",
    "\n",
    "# image = image - np.flip(bg[:,1])\n",
    "# image = image-bg[:,1]\n",
    "\n",
    "image = image*1e6\n",
    "\n",
    "print(image.shape)\n",
    "\n",
    "plt.figure(figsize = (5,2.5))\n",
    "ax1 = plt.subplot2grid((2,10),(0,0), rowspan = 2, colspan = 9)\n",
    "im = ax1.imshow(image[200:-220, 80:-90], origin = 'lower', cmap = 'seismic', extent = (0,2.538,0,1.282), vmin = -.3, vmax = .3, aspect = 'auto')\n",
    "# ax1.plot([0.2,1.2], [0.2,0.2], color = 'k', lw = 10)#path_effects=[pe.Stroke(linewidth=20, foreground='k'), pe.Normal()])\n",
    "ax1.set_xlabel(r'$x\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.set_ylabel(r'$y\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.tick_params(axis='both', labelsize= 12)\n",
    "\n",
    "ax2 = plt.subplot2grid((2,10), (0,9), rowspan = 2, colspan = 1)\n",
    "cbar = plt.colorbar(im, cax = ax2)#, shrink = 0.7, aspect = 20)\n",
    "# cbar.ax.tick_params(labelsize=12)\n",
    "cbar.set_label(label = r'Local V$_{\\mathrm{TE}}$ ($\\mathrm{\\mu V}$)', size=15)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\Fig 4\\Exp_Zoom.svg', format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()\n",
    "\n",
    "image.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "421acdc0-2839-4176-84a7-e13160dc6c91",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 229,
   "id": "c941375c-57ec-4ab8-b11f-b7496386fe15",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 19020 characters]",
      "text/plain": [
       "<Figure size 350x300 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "[encoded data, 22924 characters]",
      "text/plain": [
       "<Figure size 350x300 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "bg_plan = np.genfromtxt('ANE BG for Figure - 100px Average.txt', skip_header = 2)\n",
    "bg_sk = np.genfromtxt('SKX TE for Figure - 10px Average-For Paper.txt', skip_header = 2)\n",
    "plt.figure(figsize = (3.5,3))\n",
    "plt.plot(bg_plan[:,0]*1e6, bg_plan[:,1]*1e7, 'c-', linewidth = 3)\n",
    "plt.xlabel(r'x ($\\mu$m)', size = 15)\n",
    "plt.ylabel(r'$\\mathrm{V_{TE}}\\ \\times 10^{-7}$ V', size = 15)\n",
    "plt.xticks(fontsize = 12)\n",
    "plt.yticks(fontsize = 12)\n",
    "plt.ylim(-2.6, 2.6)\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\Fig 1\\ANE_LineProfile.svg',\n",
    "            format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()\n",
    "\n",
    "plt.figure(figsize = (3.5,3))\n",
    "plt.plot(bg_sk[:,0]*1e6, bg_sk[:,1]*1e7, 'm-', linewidth = 3)\n",
    "plt.xlabel(r'x ($\\mu$m)', size = 15)\n",
    "plt.ylabel(r'$\\mathrm{V_{TE}}\\ \\times 10^{-7}$ V', size = 15)\n",
    "plt.xticks(fontsize = 12)\n",
    "plt.yticks(fontsize = 12)\n",
    "plt.ylim(-2.6, 2.6)\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\Fig 1\\SkX_TE_LineProfile.svg',\n",
    "            format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 262,
   "id": "f484c092-c858-47e6-bfa1-6de1a8352133",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\cb23\\AppData\\Local\\Temp\\ipykernel_25608\\3175004127.py:19: UserWarning: Tight layout not applied. tight_layout cannot make Axes height small enough to accommodate all Axes decorations.\n",
      "  plt.tight_layout()\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 138608 characters]",
      "text/plain": [
       "<Figure size 300x600 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "image = np.genfromtxt(r'Topography 201-MS43-SO4-3Reps-(Ir-CoB-Pt).txt', skip_header = 4)\n",
    "\n",
    "image = image*1e9\n",
    "\n",
    "plt.figure(figsize = (3,6))\n",
    "ax1 = plt.subplot2grid((24,12), (0,0), rowspan = 20, colspan = 12)\n",
    "im = ax1.imshow(image, origin = 'lower', cmap = 'YlOrBr', extent = (0,4,0,5), vmin = 0, vmax = 40, aspect = 'auto')\n",
    "# ax1.plot([0.2,1.2], [0.2,0.2], color = 'k', lw = 10)#path_effects=[pe.Stroke(linewidth=20, foreground='k'), pe.Normal()])\n",
    "ax1.set_xlabel(r'$x\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.set_ylabel(r'$y\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.tick_params(axis='both', labelsize= 12)\n",
    "# ax1.axis('off')\n",
    "\n",
    "ax2 = plt.subplot2grid((24,12), (23,0), rowspan = 2, colspan = 12)\n",
    "cbar = plt.colorbar(mappable = im, cax = ax2, orientation = 'horizontal', shrink = 0.7, aspect = 20)\n",
    "cbar.ax.tick_params(labelsize=12)\n",
    "cbar.set_label(label = 'Lift Height (nm)', size=15)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\Fig 1\\AFM_Fig.svg', format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "id": "b7c3d153-acd0-478b-88dc-98bc602a2e53",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(256, 513)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\cb23\\AppData\\Local\\Temp\\ipykernel_39740\\3956934112.py:22: UserWarning: Tight layout not applied. tight_layout cannot make Axes height small enough to accommodate all Axes decorations.\n",
      "  plt.tight_layout()\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 157592 characters]",
      "text/plain": [
       "<Figure size 600x300 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "os.chdir(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Misc Experimental\\local-ANE-Skyrmions-CoFeB\\SI_Data')\n",
    "\n",
    "image = np.genfromtxt(r'AsSet MFM.gwy', skip_header = 4)\n",
    "\n",
    "image = np.flipud(image)*1e2\n",
    "\n",
    "print(image.shape)\n",
    "\n",
    "plt.figure(figsize = (6,3))\n",
    "ax1 = plt.subplot2grid((24,24), (0,0), rowspan = 24, colspan = 23)\n",
    "im = ax1.imshow(image[40:-20, 200:-8], origin = 'lower', cmap = 'gray', extent = (0,5.95,0,3.82), vmin = -15, vmax = 15, aspect = 'auto')\n",
    "# ax1.plot([0.2,1.2], [0.2,0.2], color = 'k', lw = 10)#path_effects=[pe.Stroke(linewidth=20, foreground='k'), pe.Normal()])\n",
    "ax1.set_xlabel(r'$x\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.set_ylabel(r'$y\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.tick_params(axis='both', labelsize= 12)\n",
    "\n",
    "ax2 = plt.subplot2grid((24,24), (0,23), rowspan = 24, colspan = 1)\n",
    "cbar = plt.colorbar(mappable = im, cax = ax2, orientation = 'vertical', aspect = 1)\n",
    "cbar.ax.tick_params(labelsize=12)\n",
    "cbar.set_label(label = r'Phase Shift ($\\times 10^{-2}\\ ^{\\circ}$)', size=15)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\SI Figs\\MFM_AsSet.svg', format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 192,
   "id": "c1b89832-2d0d-4e2a-86a9-560d388c6440",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(359, 582)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\cb23\\AppData\\Local\\Temp\\ipykernel_39740\\1175346208.py:26: UserWarning: Tight layout not applied. tight_layout cannot make Axes height small enough to accommodate all Axes decorations.\n",
      "  plt.tight_layout()\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 278092 characters]",
      "text/plain": [
       "<Figure size 600x300 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(359, 582)"
      ]
     },
     "execution_count": 192,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "image = np.genfromtxt(r'AsSet SThM Scan 6.gwy', skip_header = 4)\n",
    "\n",
    "# image = image - np.flip(bg[:,1])\n",
    "# image = image-bg[:,1]\n",
    "\n",
    "image = image*0.5 + 0.372\n",
    "\n",
    "image = np.rot90(image)\n",
    "image = np.flipud(image)\n",
    "\n",
    "print(image.shape)\n",
    "\n",
    "plt.figure(figsize = (6,3))\n",
    "ax1 = plt.subplot2grid((24,24), (0,0), rowspan = 24, colspan = 23)\n",
    "im = ax1.imshow(image[:, :-60], origin = 'lower', cmap = 'seismic', extent = (0,5.38,0,3.70), aspect = 'auto')#, vmin = -.3, vmax = .3, aspect = 'auto')\n",
    "# ax1.plot([0.2,1.2], [0.2,0.2], color = 'k', lw = 10)#path_effects=[pe.Stroke(linewidth=20, foreground='k'), pe.Normal()])\n",
    "ax1.set_xlabel(r'$x\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.set_ylabel(r'$y\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.tick_params(axis='both', labelsize= 12)\n",
    "\n",
    "ax2 = plt.subplot2grid((24,24), (0,23), rowspan = 24, colspan = 1)\n",
    "cbar = plt.colorbar(im, cax = ax2)#, shrink = 0.7, aspect = 20)\n",
    "# cbar.ax.tick_params(labelsize=12)\n",
    "cbar.set_label(label = r'Local V$_{\\mathrm{TE}}$ ($\\mathrm{\\mu V}$)', size=15)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\SI Figs\\SThM_AsSet.svg', format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()\n",
    "\n",
    "image.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "id": "32a9cf9e-0da6-432a-92b0-350a07cfb9da",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(100, 439)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\cb23\\AppData\\Local\\Temp\\ipykernel_39740\\3816359254.py:24: UserWarning: Tight layout not applied. tight_layout cannot make Axes height small enough to accommodate all Axes decorations.\n",
      "  plt.tight_layout()\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 229280 characters]",
      "text/plain": [
       "<Figure size 1200x300 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "os.chdir(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Misc Experimental\\local-ANE-Skyrmions-CoFeB\\SI_Data')\n",
    "\n",
    "image = np.genfromtxt(r'ReSet MFM.gwy', skip_header = 4)\n",
    "\n",
    "image = np.flipud(image)\n",
    "\n",
    "image = image + 1\n",
    "\n",
    "print(image.shape)\n",
    "\n",
    "plt.figure(figsize = (12,3))\n",
    "ax1 = plt.subplot2grid((24,24), (0,0), rowspan = 24, colspan = 23)\n",
    "im = ax1.imshow(image[20:-10, 50:-50], origin = 'lower', cmap = 'gray', extent = (0,16.95,0,3.6), vmin = -.5, vmax = .5, aspect = 'auto')\n",
    "# ax1.plot([0.2,1.2], [0.2,0.2], color = 'k', lw = 10)#path_effects=[pe.Stroke(linewidth=20, foreground='k'), pe.Normal()])\n",
    "ax1.set_xlabel(r'$x\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.set_ylabel(r'$y\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.tick_params(axis='both', labelsize= 12)\n",
    "\n",
    "ax2 = plt.subplot2grid((24,24), (0,23), rowspan = 24, colspan = 1)\n",
    "cbar = plt.colorbar(mappable = im, cax = ax2, orientation = 'vertical', aspect = 1)\n",
    "cbar.ax.tick_params(labelsize=12)\n",
    "cbar.set_label(label = r'Phase Shift ($\\times 10^{-2}\\ ^{\\circ}$)', size=15)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\SI Figs\\MFM_ReSet.svg', format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 140,
   "id": "b9ba7cc2-42ca-422f-a765-48b0fad01f7a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(512, 1024)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\cb23\\AppData\\Local\\Temp\\ipykernel_39740\\121032245.py:26: UserWarning: Tight layout not applied. tight_layout cannot make Axes height small enough to accommodate all Axes decorations.\n",
      "  plt.tight_layout()\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 296888 characters]",
      "text/plain": [
       "<Figure size 600x300 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(512, 1024)"
      ]
     },
     "execution_count": 140,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "image = np.genfromtxt(r'ReSet SThM 1.gwy', skip_header = 4)\n",
    "\n",
    "# image = image - np.flip(bg[:,1])\n",
    "# image = image-bg[:,1]\n",
    "\n",
    "image = image*0.5 - 0.2\n",
    "\n",
    "# image = np.rot90(image)\n",
    "image = np.flipud(image)\n",
    "\n",
    "print(image.shape)\n",
    "\n",
    "plt.figure(figsize = (6,3))\n",
    "ax1 = plt.subplot2grid((24,24), (0,0), rowspan = 24, colspan = 23)\n",
    "im = ax1.imshow(image[70:-100, :], origin = 'lower', cmap = 'seismic', extent = (0,9.00,0,3.01), aspect = 'auto')#, vmin = -.3, vmax = .3, aspect = 'auto')\n",
    "# ax1.plot([0.2,1.2], [0.2,0.2], color = 'k', lw = 10)#path_effects=[pe.Stroke(linewidth=20, foreground='k'), pe.Normal()])\n",
    "ax1.set_xlabel(r'$x\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.set_ylabel(r'$y\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.tick_params(axis='both', labelsize= 12)\n",
    "\n",
    "ax2 = plt.subplot2grid((24,24), (0,23), rowspan = 24, colspan = 1)\n",
    "cbar = plt.colorbar(im, cax = ax2)#, shrink = 0.7, aspect = 20)\n",
    "# cbar.ax.tick_params(labelsize=12)\n",
    "cbar.set_label(label = r'Local V$_{\\mathrm{TE}}$ ($\\mathrm{\\mu V}$)', size=15)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\SI Figs\\SThM_ReSet1.svg', format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()\n",
    "\n",
    "image.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 193,
   "id": "e81ce282-7b32-499c-8202-7c17a63e58a1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(512, 1024)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\cb23\\AppData\\Local\\Temp\\ipykernel_39740\\3340948434.py:26: UserWarning: Tight layout not applied. tight_layout cannot make Axes height small enough to accommodate all Axes decorations.\n",
      "  plt.tight_layout()\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 288084 characters]",
      "text/plain": [
       "<Figure size 600x300 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(512, 1024)"
      ]
     },
     "execution_count": 193,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "image = np.genfromtxt(r'ReSet SThM 2.gwy', skip_header = 4)\n",
    "\n",
    "# image = image - np.flip(bg[:,1])\n",
    "# image = image-bg[:,1]\n",
    "\n",
    "image = image*0.5 -0.075\n",
    "\n",
    "# image = np.rot90(image)\n",
    "image = np.flipud(image)\n",
    "\n",
    "print(image.shape)\n",
    "\n",
    "plt.figure(figsize = (6,3))\n",
    "ax1 = plt.subplot2grid((24,24), (0,0), rowspan = 24, colspan = 23)\n",
    "im = ax1.imshow(image[70:-60, :], origin = 'lower', cmap = 'seismic', extent = (0,9.00,0,3.36), aspect = 'auto')#, vmin = -.3, vmax = .3, aspect = 'auto')\n",
    "# ax1.plot([0.2,1.2], [0.2,0.2], color = 'k', lw = 10)#path_effects=[pe.Stroke(linewidth=20, foreground='k'), pe.Normal()])\n",
    "ax1.set_xlabel(r'$x\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.set_ylabel(r'$y\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.tick_params(axis='both', labelsize= 12)\n",
    "\n",
    "ax2 = plt.subplot2grid((24,24), (0,23), rowspan = 24, colspan = 1)\n",
    "cbar = plt.colorbar(im, cax = ax2)#, shrink = 0.7, aspect = 20)\n",
    "# cbar.ax.tick_params(labelsize=12)\n",
    "cbar.set_label(label = r'Local V$_{\\mathrm{TE}}$ ($\\mathrm{\\mu V}$)', size=15)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\SI Figs\\SThM_ReSet2.svg', format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()\n",
    "\n",
    "image.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 189,
   "id": "44578bc4-8fa1-4af4-b33b-9c30dae4339a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(100, 200)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\cb23\\AppData\\Local\\Temp\\ipykernel_39740\\2541917124.py:25: UserWarning: Tight layout not applied. tight_layout cannot make Axes width small enough to accommodate all Axes decorations\n",
      "  plt.tight_layout()\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 127836 characters]",
      "text/plain": [
       "<Figure size 600x300 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "os.chdir(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Misc Experimental\\local-ANE-Skyrmions-CoFeB\\SI_Data')\n",
    "\n",
    "image = np.genfromtxt(r'201-MS43-SO4-3Reps-(Ir-CoB-Pt)_MFM.gwy', skip_header = 4)\n",
    "\n",
    "# image = np.flipud(image)*1e2\n",
    "\n",
    "image = np.rot90(image)\n",
    "image = np.flipud(image)*1e2\n",
    "\n",
    "print(image.shape)\n",
    "\n",
    "plt.figure(figsize = (6,3))\n",
    "ax1 = plt.subplot2grid((24,24), (0,0), rowspan = 24, colspan = 23)\n",
    "im = ax1.imshow(image[:, :], origin = 'lower', cmap = 'gray', extent = (0,10,0,5), vmin = -10, vmax = 10, aspect = 'auto')\n",
    "# ax1.plot([0.2,1.2], [0.2,0.2], color = 'k', lw = 10)#path_effects=[pe.Stroke(linewidth=20, foreground='k'), pe.Normal()])\n",
    "ax1.set_xlabel(r'$x\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.set_ylabel(r'$y\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.tick_params(axis='both', labelsize= 12)\n",
    "\n",
    "ax2 = plt.subplot2grid((24,24), (0,23), rowspan = 24, colspan = 1)\n",
    "cbar = plt.colorbar(mappable = im, cax = ax2, orientation = 'vertical', aspect = 1)\n",
    "cbar.ax.tick_params(labelsize=12)\n",
    "cbar.set_label(label = r'Phase Shift ($\\times 10^{-2}\\ ^{\\circ}$)', size=15)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\SI Figs\\3_Rep_MFM.svg', format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 188,
   "id": "8c7e5ebd-1e70-4663-9d65-105e6f7f5e69",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(256, 512)\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\cb23\\AppData\\Local\\Temp\\ipykernel_39740\\4035080776.py:26: UserWarning: Tight layout not applied. tight_layout cannot make Axes width small enough to accommodate all Axes decorations\n",
      "  plt.tight_layout()\n"
     ]
    },
    {
     "data": {
      "image/png": "[encoded data, 301996 characters]",
      "text/plain": [
       "<Figure size 600x300 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(256, 512)"
      ]
     },
     "execution_count": 188,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "image = np.genfromtxt(r'201-MS43-SO4-3Reps-(Ir-CoB-Pt)_SThM.gwy', skip_header = 4)\n",
    "\n",
    "# image = image - np.flip(bg[:,1])\n",
    "# image = image-bg[:,1]\n",
    "\n",
    "# image = image*0.5 -0.075\n",
    "\n",
    "image = np.rot90(image) *1e6 + 0.0065\n",
    "image = np.flipud(image)\n",
    "\n",
    "print(image.shape)\n",
    "\n",
    "plt.figure(figsize = (6,3))\n",
    "ax1 = plt.subplot2grid((24,24), (0,0), rowspan = 24, colspan = 23)\n",
    "im = ax1.imshow(image[:, :], origin = 'lower', cmap = 'seismic', extent = (0,10.00,0,5), aspect = 'auto', vmin = -.2, vmax = .2)\n",
    "# ax1.plot([0.2,1.2], [0.2,0.2], color = 'k', lw = 10)#path_effects=[pe.Stroke(linewidth=20, foreground='k'), pe.Normal()])\n",
    "ax1.set_xlabel(r'$x\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.set_ylabel(r'$y\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "ax1.tick_params(axis='both', labelsize= 12)\n",
    "\n",
    "ax2 = plt.subplot2grid((24,24), (0,23), rowspan = 24, colspan = 1)\n",
    "cbar = plt.colorbar(im, cax = ax2)#, shrink = 0.7, aspect = 20)\n",
    "# cbar.ax.tick_params(labelsize=12)\n",
    "cbar.set_label(label = r'Local V$_{\\mathrm{TE}}$ ($\\mathrm{\\mu V}$)', size=15)\n",
    "\n",
    "plt.tight_layout()\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\SI Figs\\3_rep_SThM.svg', format = 'svg', bbox_inches = 'tight')\n",
    "plt.show()\n",
    "\n",
    "image.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "46926e76-fbce-4d61-a52c-519a50c11482",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "[encoded data, 184564 characters]",
      "text/plain": [
       "<Figure size 2000x2000 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "image = np.genfromtxt(r'Scan-14_4.5x6.5um_512_774px_0.02Hz_0.5Hz_SP_+1V_TipHeater_6V_Ch_Out_0.5uV-P2-ve-P10+ve-(Analayed)c_rotated.txt', skip_header = 4)\n",
    "\n",
    "# image = image - np.flip(bg[:,1])\n",
    "# image = image-bg[:,1]\n",
    "\n",
    "image = image*1e7\n",
    "\n",
    "# print(image.shape)\n",
    "\n",
    "# plt.figure(figsize = (3,6))\n",
    "# ax1 = plt.subplot2grid((24,12), (0,0), rowspan = 20, colspan = 12)\n",
    "# im = ax1.imshow(image[5:, 5:-5], origin = 'lower', cmap = 'seismic', extent = (0,3.91,0,4.926), vmin = -3, vmax = 3, aspect = 'auto')\n",
    "# # ax1.plot([0.2,1.2], [0.2,0.2], color = 'k', lw = 10)#path_effects=[pe.Stroke(linewidth=20, foreground='k'), pe.Normal()])\n",
    "# ax1.set_xlabel(r'$x\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "# ax1.set_ylabel(r'$y\\ \\mathrm{(\\mu m)}$', size = 15)\n",
    "# ax1.tick_params(axis='both', labelsize= 12)\n",
    "\n",
    "# ax2 = plt.subplot2grid((24,12), (23,0), rowspan = 2, colspan = 12)\n",
    "# cbar = plt.colorbar(mappable = im, cax = ax2, orientation = 'horizontal', shrink = 0.7, aspect = 20)\n",
    "# cbar.ax.tick_params(labelsize=12)\n",
    "# cbar.set_label(label = r'Local V$_{\\mathrm{TE}}$ ($\\times 10^{-7}\\ \\mathrm{V}$)', size=15)\n",
    "\n",
    "# plt.tight_layout()\n",
    "# # plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\Fig 1\\SThM_Fig.svg', format = 'svg', bbox_inches = 'tight')\n",
    "# plt.show()\n",
    "\n",
    "# image.shape\n",
    "\n",
    "\n",
    "X = np.linspace(0,3.91, 449)\n",
    "Y = np.linspace(0, 4.926, 561)\n",
    "X, Y = np.meshgrid(X, Y)\n",
    "Z = image[5:, 5:-5]\n",
    "\n",
    "# print(Z.shape)\n",
    "\n",
    "fig, ax = plt.subplots(nrows = 1, ncols = 1, subplot_kw={\"projection\": \"3d\"}, figsize=(20,20))\n",
    "ax.set_box_aspect((np.ptp(X), np.ptp(Y)*1.25, np.ptp(Z)*0.125))  # aspect ratio is 1:1:1 in data space\n",
    "\n",
    "surf = ax.plot_surface(X, Y, Z, cmap='seismic',\n",
    "                       linewidth=0, antialiased=False)\n",
    "\n",
    "ax.view_init(elev=30., azim=-40)\n",
    "ax.set_zlim(-5, 5)\n",
    "# ax = plt.gca(projection='3d') \n",
    "ax._axis3don = False\n",
    "\n",
    "plt.savefig(r'C:\\Users\\cb23\\OneDrive - National Physical Laboratory\\Documents\\Manuscripts\\Thermoelectric-Skyrmion-Paper\\Paper\\Figures\\3d_plot.svg', bbox_inches = 'tight')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "baafb9b5-f8f6-4b6a-b793-0c9280d81fea",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-60 30 10\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\cb23\\AppData\\Local\\Temp\\ipykernel_32128\\4243283320.py:1: MatplotlibDeprecationWarning: The dist attribute was deprecated in Matplotlib 3.6 and will be removed two minor releases later.\n",
      "  print(ax.azim, ax.elev, ax.dist)\n"
     ]
    }
   ],
   "source": [
    "print(ax.azim, ax.elev, ax.dist)"
   ]
  }
 ],
 "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.10.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
