ppak10 commited on
Commit
8f5cac6
1 Parent(s): c28ac8f

Adds converted `.pkl` and `.gif` files for data.

Browse files
convert_mat.ipynb ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "# Convert `.mat`\n",
8
+ "Converts Camera Signal and Radiant Temperature of `.mat` files to `.p` filetype."
9
+ ]
10
+ },
11
+ {
12
+ "cell_type": "code",
13
+ "execution_count": 1,
14
+ "metadata": {},
15
+ "outputs": [],
16
+ "source": [
17
+ "import imageio\n",
18
+ "import numpy as np\n",
19
+ "import pickle\n",
20
+ "import scipy"
21
+ ]
22
+ },
23
+ {
24
+ "cell_type": "code",
25
+ "execution_count": 2,
26
+ "metadata": {},
27
+ "outputs": [],
28
+ "source": [
29
+ "folder = \"powder_plate_7_bare_pad_195_w_800_mm_s\""
30
+ ]
31
+ },
32
+ {
33
+ "cell_type": "code",
34
+ "execution_count": 3,
35
+ "metadata": {},
36
+ "outputs": [
37
+ {
38
+ "name": "stdout",
39
+ "output_type": "stream",
40
+ "text": [
41
+ "(501, 127, 360)\n",
42
+ "16367\n"
43
+ ]
44
+ }
45
+ ],
46
+ "source": [
47
+ "filename = \"camera_signal\"\n",
48
+ "\n",
49
+ "mat = scipy.io.loadmat(f\"data/{folder}/{filename}.mat\")\n",
50
+ "video = mat[\"CameraSignal\"]\n",
51
+ "\n",
52
+ "# Reshapes from (y, x, f) to (f, x, y)\n",
53
+ "video_reshaped = np.transpose(video, (2, 0, 1))\n",
54
+ "print(video_reshaped.shape)\n",
55
+ "print(np.max(video_reshaped))\n",
56
+ "\n",
57
+ "with open(f\"data/{folder}/{filename}.pkl\", \"wb\") as file:\n",
58
+ " pickle.dump(video_reshaped, file)\n",
59
+ "\n",
60
+ "# Normalizes the video for visual output\n",
61
+ "video_normalized = np.interp(\n",
62
+ " video_reshaped,\n",
63
+ " (video_reshaped.min(), video_reshaped.max()),\n",
64
+ " (0, 255)\n",
65
+ ")\n",
66
+ "\n",
67
+ "frames = []\n",
68
+ "for frame in video_normalized:\n",
69
+ " frames.append(frame)\n",
70
+ "\n",
71
+ "imageio.mimsave(f\"data/{folder}/{filename}.gif\", frames)"
72
+ ]
73
+ },
74
+ {
75
+ "cell_type": "code",
76
+ "execution_count": 4,
77
+ "metadata": {},
78
+ "outputs": [
79
+ {
80
+ "name": "stdout",
81
+ "output_type": "stream",
82
+ "text": [
83
+ "(501, 127, 360)\n",
84
+ "1073.1382220207333\n"
85
+ ]
86
+ }
87
+ ],
88
+ "source": [
89
+ "filename = \"radiant_temperature\"\n",
90
+ "\n",
91
+ "mat = scipy.io.loadmat(f\"data/{folder}/{filename}.mat\")\n",
92
+ "video = mat[\"RadiantTemperature\"]\n",
93
+ "\n",
94
+ "# Reshapes from (x, y, f) to (f, x, y)\n",
95
+ "video_reshaped = np.transpose(video, (2, 0, 1))\n",
96
+ "print(video_reshaped.shape)\n",
97
+ "print(np.max(video_reshaped))\n",
98
+ "\n",
99
+ "with open(f\"data/{folder}/{filename}.pkl\", \"wb\") as file:\n",
100
+ " pickle.dump(video_reshaped, file)\n",
101
+ "\n",
102
+ "# Normalizes the video for visual output\n",
103
+ "video_normalized = np.interp(\n",
104
+ " video_reshaped,\n",
105
+ " (video_reshaped.min(), video_reshaped.max()),\n",
106
+ " (0, 255)\n",
107
+ ")\n",
108
+ "\n",
109
+ "frames = []\n",
110
+ "for frame in video_normalized:\n",
111
+ " frames.append(frame)\n",
112
+ "\n",
113
+ "imageio.mimsave(f\"data/{folder}/{filename}.gif\", frames)"
114
+ ]
115
+ },
116
+ {
117
+ "cell_type": "code",
118
+ "execution_count": null,
119
+ "metadata": {},
120
+ "outputs": [],
121
+ "source": []
122
+ }
123
+ ],
124
+ "metadata": {
125
+ "kernelspec": {
126
+ "display_name": "venv",
127
+ "language": "python",
128
+ "name": "python3"
129
+ },
130
+ "language_info": {
131
+ "codemirror_mode": {
132
+ "name": "ipython",
133
+ "version": 3
134
+ },
135
+ "file_extension": ".py",
136
+ "mimetype": "text/x-python",
137
+ "name": "python",
138
+ "nbconvert_exporter": "python",
139
+ "pygments_lexer": "ipython3",
140
+ "version": "3.12.2"
141
+ }
142
+ },
143
+ "nbformat": 4,
144
+ "nbformat_minor": 2
145
+ }
data.ipynb DELETED
@@ -1,57 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "markdown",
5
- "metadata": {},
6
- "source": [
7
- "# Data"
8
- ]
9
- },
10
- {
11
- "cell_type": "code",
12
- "execution_count": 1,
13
- "metadata": {},
14
- "outputs": [],
15
- "source": [
16
- "import matplotlib.pyplot as plt\n",
17
- "import numpy as np\n",
18
- "\n",
19
- "from PIL import Image"
20
- ]
21
- },
22
- {
23
- "cell_type": "code",
24
- "execution_count": null,
25
- "metadata": {},
26
- "outputs": [],
27
- "source": [
28
- "file = \"data/RawCameraData/20170215_PowderPlate7_Bare_Pad_195W_800mmPs_clipped.img\"\n",
29
- "\n",
30
- "with open(file, \"rb\") as f:\n",
31
- " img = np.fromfile(f)\n",
32
- "\n"
33
- ]
34
- }
35
- ],
36
- "metadata": {
37
- "kernelspec": {
38
- "display_name": "venv",
39
- "language": "python",
40
- "name": "python3"
41
- },
42
- "language_info": {
43
- "codemirror_mode": {
44
- "name": "ipython",
45
- "version": 3
46
- },
47
- "file_extension": ".py",
48
- "mimetype": "text/x-python",
49
- "name": "python",
50
- "nbconvert_exporter": "python",
51
- "pygments_lexer": "ipython3",
52
- "version": "3.12.2"
53
- }
54
- },
55
- "nbformat": 4,
56
- "nbformat_minor": 2
57
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
data/powder_plate_1_single_line/camera_signal.gif ADDED

Git LFS Details

  • SHA256: 18c3f1c671a6880adc59d24c2826e3abbc6644f94acb28cf10b8d6db8454fd29
  • Pointer size: 131 Bytes
  • Size of remote file: 181 kB
data/powder_plate_1_single_line/camera_signal.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5ae7ce80d9e1a48987b0b272730ecd3bfd67bd82c85e7abd66ec3d63dc6c9af6
3
+ size 5120804
data/powder_plate_1_single_line/radiant_temperature.gif ADDED

Git LFS Details

  • SHA256: c063b501dfb96d25ff22f2445a6c145f8ed51d8b58d71b9af06089e7be66d9f9
  • Pointer size: 130 Bytes
  • Size of remote file: 42 kB
data/powder_plate_1_single_line/radiant_temperature.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:719eee3c8bc94818f13607eb77b3f3b5be1373b254d6c28396549ba89721d9b5
3
+ size 20482724
data/powder_plate_2_pad/camera_signal.gif ADDED

Git LFS Details

  • SHA256: 862b9ba9c47fe5d0e4495c27b8f0e6e43860c08ca6dad9ff6fc80e4c9a55d02a
  • Pointer size: 132 Bytes
  • Size of remote file: 2.57 MB
data/powder_plate_2_pad/camera_signal.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb6d00d565ed446f53e6c152d1c9698f5242de528dd9e51e5b766e7490b868e1
3
+ size 46908885
data/powder_plate_2_pad/radiant_temperature.gif ADDED

Git LFS Details

  • SHA256: d7034c21d8901d245416792432611c336f8125a96301b31f455b30bf62d03612
  • Pointer size: 132 Bytes
  • Size of remote file: 1.41 MB
data/powder_plate_2_pad/radiant_temperature.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2fa676efdb9bac3114dd1240ddba0269035563177caa60fa6c3b0c6d04e25c6
3
+ size 187635045
data/powder_plate_6_bare_single_line_195_w_800_mm_s/camera_signal.gif ADDED

Git LFS Details

  • SHA256: d43ec9fc5b377d3e9504daf4e97b33bd80369a23d09af7dcc47fa11da7effd18
  • Pointer size: 130 Bytes
  • Size of remote file: 93.3 kB
data/powder_plate_6_bare_single_line_195_w_800_mm_s/camera_signal.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6c5e2be94eae5f344810285c61c44827c75195cbb73ef083aba6c2346e18796
3
+ size 3109124
data/powder_plate_6_bare_single_line_195_w_800_mm_s/radiant_temperature.gif ADDED

Git LFS Details

  • SHA256: fdb773174e644c4e7693cb526d9cad4e2663e5572cb031403b111a7ecc0eecea
  • Pointer size: 130 Bytes
  • Size of remote file: 11.6 kB
data/powder_plate_6_bare_single_line_195_w_800_mm_s/radiant_temperature.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:10bc9d4b9b4ba2df22ce777e23ada3ff1a45d2f9d662cf1b0e892dc143387257
3
+ size 12436004
data/powder_plate_7_bare_pad_195_w_800_mm_s/camera_signal.gif ADDED

Git LFS Details

  • SHA256: b751f3d277782ae62fddbb949e890c8335e32a69a0cb51893b3b917d3a876181
  • Pointer size: 132 Bytes
  • Size of remote file: 1.98 MB
data/powder_plate_7_bare_pad_195_w_800_mm_s/camera_signal.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0bb4f752e0b21465722d349b3b1239bf777a982ab5db5c97130e93cc0e48d7d7
3
+ size 45811605
data/powder_plate_7_bare_pad_195_w_800_mm_s/radiant_temperature.gif ADDED

Git LFS Details

  • SHA256: c74f2c919445951f9e08406b7e214f05f451806c1a3f8b56cbea01fd360bee9b
  • Pointer size: 131 Bytes
  • Size of remote file: 878 kB
data/powder_plate_7_bare_pad_195_w_800_mm_s/radiant_temperature.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:db366b368d3e0e31a571007dea444ec7bb34989476d2a81bf2f0c81cf7e6f510
3
+ size 183245925