|
46 | 46 | " file.write(f\"{cell_id}\")"
|
47 | 47 | ]
|
48 | 48 | },
|
49 |
| - { |
50 |
| - "cell_type": "code", |
51 |
| - "execution_count": null, |
52 |
| - "metadata": { |
53 |
| - "execution": { |
54 |
| - "iopub.execute_input": "2024-12-09T23:31:06.534345Z", |
55 |
| - "iopub.status.busy": "2024-12-09T23:31:06.533855Z", |
56 |
| - "iopub.status.idle": "2024-12-09T23:32:48.427823Z", |
57 |
| - "shell.execute_reply": "2024-12-09T23:32:48.427067Z" |
58 |
| - } |
59 |
| - }, |
60 |
| - "outputs": [ |
61 |
| - { |
62 |
| - "data": { |
63 |
| - "text/plain": [ |
64 |
| - "set()" |
65 |
| - ] |
66 |
| - }, |
67 |
| - "execution_count": 2, |
68 |
| - "metadata": {}, |
69 |
| - "output_type": "execute_result" |
70 |
| - } |
71 |
| - ], |
72 |
| - "source": [ |
73 |
| - "### perform change detection ###\n", |
74 |
| - "cell_directories = glob.glob(\"data/HR6/*\")\n", |
75 |
| - "\n", |
76 |
| - "# remove directories where data is still to be downloaded\n", |
77 |
| - "cells_completed = read_processed_cells(\".CD_completed_cells.log\")\n", |
78 |
| - "cells_failed = read_processed_cells(\".CD_failed_cells.log\")\n", |
79 |
| - "\n", |
80 |
| - "\n", |
81 |
| - "#cell_directories = [i for i in cell_directories if i[9:] not in remaining_downloads]\n", |
82 |
| - "\n", |
83 |
| - "def batch_iterator(iterable, batch_size):\n", |
84 |
| - " for i in range(0, len(iterable), batch_size):\n", |
85 |
| - " yield iterable[i:i + batch_size]\n", |
86 |
| - "\n", |
87 |
| - "# def process_cells(folder):\n", |
88 |
| - "# img_dir = glob.glob(f\"{folder}/images/*.tif\")\n", |
89 |
| - "# for img in img_dir:\n", |
90 |
| - "# monitoringutils.convert_image(img)\n", |
91 |
| - "\n", |
92 |
| - " \n", |
93 |
| - "# for dir in tqdm.tqdm(batch_iterator(cell_directories, 50)):\n", |
94 |
| - "# process_map(process_cells, dir)\n", |
95 |
| - "\n" |
96 |
| - ] |
97 |
| - }, |
98 |
| - { |
99 |
| - "cell_type": "code", |
100 |
| - "execution_count": 6, |
101 |
| - "metadata": { |
102 |
| - "execution": { |
103 |
| - "iopub.execute_input": "2024-12-09T23:32:48.431765Z", |
104 |
| - "iopub.status.busy": "2024-12-09T23:32:48.430978Z", |
105 |
| - "iopub.status.idle": "2024-12-09T23:32:48.434722Z", |
106 |
| - "shell.execute_reply": "2024-12-09T23:32:48.434199Z" |
107 |
| - } |
108 |
| - }, |
109 |
| - "outputs": [], |
110 |
| - "source": [ |
111 |
| - "def check_images(folder):\n", |
112 |
| - " print(folder)\n", |
113 |
| - " img_dir = glob.glob(f\"{folder}/images/*.kea\")\n", |
114 |
| - " aoi = f\"{folder}/aoi_mask.kea\"\n", |
115 |
| - " for img in img_dir:\n", |
116 |
| - " monitoringutils.check_input_image(img, aoi) # remove images\n", |
117 |
| - " monitoringutils.remove_images_from_metadata(folder)" |
118 |
| - ] |
119 |
| - }, |
120 | 49 | {
|
121 | 50 | "cell_type": "code",
|
122 | 51 | "execution_count": 6,
|
|
937 | 866 | " with open(fn, 'w') as file:\n",
|
938 | 867 | " file.write(f\"{cell_id}\")\n",
|
939 | 868 | "\n",
|
| 869 | + "\n", |
| 870 | + "cell_directories = glob.glob('data/HR6/*')\n", |
| 871 | + "\n", |
940 | 872 | "for i in cell_directories:\n",
|
941 | 873 | " check_metadata_record(i)"
|
942 | 874 | ]
|
|
0 commit comments