rithwiks commited on
Commit
1547ad8
·
verified ·
1 Parent(s): aa38a2d

Using both HDU1 and 4 now

Browse files
Files changed (1) hide show
  1. 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
- """Generate SBI-16-2D examples"""
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
- # the first axis is length one, so we take the first element
152
- # the second axis is the time axis and varies between images
153
- image_data = hdul["SCI"].data[:, :].tolist()
154
- yield task_instance_key, {**{"image": image_data}, **item}
 
 
 
 
 
 
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(