Using both HDU1 and 4 now
Browse files- SBI-16-2D.py +11 -6
SBI-16-2D.py
CHANGED
|
@@ -143,15 +143,20 @@ class SBI_16_2D(datasets.GeneratorBasedBuilder):
|
|
| 143 |
return ret
|
| 144 |
|
| 145 |
def _generate_examples(self, filepaths, split_file, split, data_metadata):
|
| 146 |
-
|
| 147 |
|
| 148 |
for idx, (filepath, item) in enumerate(zip(filepaths, data_metadata)):
|
| 149 |
-
task_instance_key = f"{self.config.name}-{split}-{idx}"
|
| 150 |
with fits.open(filepath, memmap=False) as hdul:
|
| 151 |
-
#
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
yield
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 155 |
|
| 156 |
|
| 157 |
def make_split_jsonl_files(
|
|
|
|
| 143 |
return ret
|
| 144 |
|
| 145 |
def _generate_examples(self, filepaths, split_file, split, data_metadata):
|
| 146 |
+
"""Generate SBI-16-2D examples"""
|
| 147 |
|
| 148 |
for idx, (filepath, item) in enumerate(zip(filepaths, data_metadata)):
|
|
|
|
| 149 |
with fits.open(filepath, memmap=False) as hdul:
|
| 150 |
+
# Process image data from HDU index 1
|
| 151 |
+
image_data_1 = hdul[1].data[:, :].tolist()
|
| 152 |
+
task_instance_key_1 = f"{self.config.name}-{split}-{idx}-HDU1"
|
| 153 |
+
yield task_instance_key_1, {**{"image": image_data_1}, **item}
|
| 154 |
+
|
| 155 |
+
# Process image data from HDU index 4
|
| 156 |
+
image_data_4 = hdul[4].data[:, :].tolist()
|
| 157 |
+
task_instance_key_4 = f"{self.config.name}-{split}-{idx}-HDU4"
|
| 158 |
+
yield task_instance_key_4, {**{"image": image_data_4}, **item}
|
| 159 |
+
|
| 160 |
|
| 161 |
|
| 162 |
def make_split_jsonl_files(
|