jbloom commited on
Commit
c9db20e
1 Parent(s): 13d6592

add tiny dataset and related files

Browse files
GBI-16-2D.py CHANGED
@@ -6,6 +6,8 @@ from huggingface_hub import hf_hub_download
6
 
7
 
8
  from astropy.io import fits
 
 
9
  import datasets
10
  from datasets import DownloadManager
11
  from fsspec.core import url_to_fs
@@ -69,6 +71,10 @@ class GBI_16_2D(datasets.GeneratorBasedBuilder):
69
  "dec": datasets.Value("float64"),
70
  "pixscale": datasets.Value("float64"),
71
  "image_id": datasets.Value("string"),
 
 
 
 
72
  }
73
  ),
74
  supervised_keys=None,
@@ -108,6 +114,10 @@ class GBI_16_2D(datasets.GeneratorBasedBuilder):
108
  "dec": item["dec"],
109
  "pixscale": item["pixscale"],
110
  "image_id": item["image_id"],
 
 
 
 
111
  }
112
  )
113
  if locally_run:
@@ -151,7 +161,7 @@ class GBI_16_2D(datasets.GeneratorBasedBuilder):
151
  with fits.open(filepath, memmap=False) as hdul:
152
  # the first axis is length one, so we take the first element
153
  # the second axis is the time axis and varies between images
154
- image_data = hdul["SCI"].data[:, :].tolist()
155
  yield task_instance_key, {**{"image": image_data}, **item}
156
 
157
 
@@ -192,15 +202,25 @@ def make_split_jsonl_files(
192
  print(file, flush=True, end="...")
193
  with fits.open(file, memmap=False) as hdul:
194
  image_id = os.path.basename(file).split(".fits")[0]
195
- ra = hdul["SCI"].header.get("CRVAL1", 0)
196
- dec = hdul["SCI"].header.get("CRVAL2", 0)
197
- pixscale = hdul["SCI"].header.get("CD1_2", 0.396)
 
 
 
 
 
 
198
  item = {
199
  "image_id": image_id,
200
  "image": file,
201
  "ra": ra,
202
  "dec": dec,
203
  "pixscale": pixscale,
 
 
 
 
204
  }
205
  out_f.write(json.dumps(item) + "\n")
206
 
 
6
 
7
 
8
  from astropy.io import fits
9
+ from astropy.coordinates import Angle
10
+ from astropy import units as u
11
  import datasets
12
  from datasets import DownloadManager
13
  from fsspec.core import url_to_fs
 
71
  "dec": datasets.Value("float64"),
72
  "pixscale": datasets.Value("float64"),
73
  "image_id": datasets.Value("string"),
74
+ "rotation_angle": datasets.Value("float64"),
75
+ "dim_1": datasets.Value("int64"),
76
+ "dim_2": datasets.Value("int64"),
77
+ "exposure_time": datasets.Value("float64"),
78
  }
79
  ),
80
  supervised_keys=None,
 
114
  "dec": item["dec"],
115
  "pixscale": item["pixscale"],
116
  "image_id": item["image_id"],
117
+ "rotation_angle": item["rotation_angle"],
118
+ "dim_1": item["dim_1"],
119
+ "dim_2": item["dim_2"],
120
+ "exposure_time": item["exposure_time"],
121
  }
122
  )
123
  if locally_run:
 
161
  with fits.open(filepath, memmap=False) as hdul:
162
  # the first axis is length one, so we take the first element
163
  # the second axis is the time axis and varies between images
164
+ image_data = hdul[0].data[:, :].tolist()
165
  yield task_instance_key, {**{"image": image_data}, **item}
166
 
167
 
 
202
  print(file, flush=True, end="...")
203
  with fits.open(file, memmap=False) as hdul:
204
  image_id = os.path.basename(file).split(".fits")[0]
205
+ ras = hdul[0].header.get("RA", "0")
206
+ ra = float(Angle(f'{ras} hours').to_string(unit=u.degree, decimal=True))
207
+ decs = hdul[0].header.get("DEC", "0")
208
+ dec = float(Angle(f'{decs} degrees').to_string(unit=u.degree, decimal=True))
209
+ pixscale = hdul[0].header.get("CD1_2", 0.135)
210
+ rotation = hdul[0].header.get("ROTPOSN", 0.0)
211
+ dim_1 = hdul[0].header.get("NAXIS1", 0)
212
+ dim_2 = hdul[0].header.get("NAXIS2", 0)
213
+ exposure_time = hdul[0].header.get("TTIME", 0.0)
214
  item = {
215
  "image_id": image_id,
216
  "image": file,
217
  "ra": ra,
218
  "dec": dec,
219
  "pixscale": pixscale,
220
+ "rotation_angle": rotation,
221
+ "dim_1": dim_1,
222
+ "dim_2": dim_2,
223
+ "exposure_time": exposure_time,
224
  }
225
  out_f.write(json.dumps(item) + "\n")
226
 
data/LR.20071010.27305.fits ADDED

Git LFS Details

  • SHA256: b7e0c8f3ca18c81909dfe4ab5883cfd657708868bfae8bf60e5cef31f3c94b56
  • Pointer size: 131 Bytes
  • Size of remote file: 498 kB
data/LR.20090219.53662.fits ADDED

Git LFS Details

  • SHA256: 642fafb8827ad5b45fc36b98d33ea2be71455fc823fa90ed3de4e8d2096f6c70
  • Pointer size: 132 Bytes
  • Size of remote file: 9.23 MB
data/LR.20100708.41739.fits ADDED

Git LFS Details

  • SHA256: e4798a2e1fc9478c713cd9bc490cfa3eac386eda4c82eb693a696e5b7bd8e010
  • Pointer size: 133 Bytes
  • Size of remote file: 19.1 MB
splits/tiny_test.jsonl ADDED
@@ -0,0 +1 @@
 
 
1
+ {"image_id": "LR.20100708.41739", "image": "./data/LR.20100708.41739.fits", "ra": 264.942, "dec": 27.3245, "pixscale": 0.135, "rotation_angle": -89.9999583, "dim_1": 0, "dim_2": 0, "exposure_time": 270}
splits/tiny_train.jsonl ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ {"image_id": "LR.20090219.53662", "image": "./data/LR.20090219.53662.fits", "ra": 258.967, "dec": 55.3849, "pixscale": 0.135, "rotation_angle": 270.00076907, "dim_1": 2248, "dim_2": 2048, "exposure_time": 270}
2
+ {"image_id": "LR.20071010.27305", "image": "./data/LR.20071010.27305.fits", "ra": 288.061, "dec": -32.4109, "pixscale": 0.135, "rotation_angle": -89.99965647, "dim_1": 600, "dim_2": 400, "exposure_time": 30}