rithwiks commited on
Commit
23ea72d
·
verified ·
1 Parent(s): cdb36d2

Update utils/eval_baselines.py

Browse files
Files changed (1) hide show
  1. utils/eval_baselines.py +8 -8
utils/eval_baselines.py CHANGED
@@ -89,30 +89,30 @@ def main(dim):
89
 
90
  for path in tqdm(file_paths):
91
  with fits.open(path) as hdul:
92
- if dim == '2d':
93
  arr = hdul[0].data[0][2]
94
  arrs = [arr]
95
- elif dim == '2d-top':
96
  arr = hdul[0].data[0][2]
97
  arr = split_uint16_to_uint8(arr)[0]
98
  arrs = [arr]
99
- elif dim == '2d-bottom':
100
  arr = hdul[0].data[0][2]
101
  arr = split_uint16_to_uint8(arr)[1]
102
  arrs = [arr]
103
- elif dim == '3dt' and len(hdul[0].data) > 2:
104
  arr = hdul[0].data[0:3][2]
105
  arrs = [arr]
106
- elif dim == '3dw' and len(hdul[0].data[0]) > 2:
107
  arr = hdul[0].data[0][0:3]
108
  arrs = [arr]
109
- elif dim == '3dt_reshape' and len(hdul[0].data) > 2:
110
  arr = hdul[0].data[0:3][2].reshape((800, -1))
111
  arrs = [arr]
112
- elif dim == '3dw_reshape' and len(hdul[0].data[0]) > 2:
113
  arr = hdul[0].data[0][0:3].reshape((800, -1))
114
  arrs = [arr]
115
- elif dim == 'tw':
116
  init_arr = hdul[0].data
117
  def arrs_gen():
118
  for i in range(init_arr.shape[-2]):
 
89
 
90
  for path in tqdm(file_paths):
91
  with fits.open(path) as hdul:
92
+ if dim == '2d': # compress the first timestep frame, R wavelength band (index 2)
93
  arr = hdul[0].data[0][2]
94
  arrs = [arr]
95
+ elif dim == '2d-top': # same as 2d, but only top 8 bits. This is to compare with similarly preprocessed neural approaches.
96
  arr = hdul[0].data[0][2]
97
  arr = split_uint16_to_uint8(arr)[0]
98
  arrs = [arr]
99
+ elif dim == '2d-bottom': # same as 2d, but only bottom 8 bits. This is to compare with similarly preprocessed neural approaches.
100
  arr = hdul[0].data[0][2]
101
  arr = split_uint16_to_uint8(arr)[1]
102
  arrs = [arr]
103
+ elif dim == '3dt' and len(hdul[0].data) > 2: # 3D tensor with first 3 timestep frames of wavelength band index 2
104
  arr = hdul[0].data[0:3][2]
105
  arrs = [arr]
106
+ elif dim == '3dw' and len(hdul[0].data[0]) > 2: # 3D tensor with first timestep frame on wavelength bands of indices 1,2,3 (G, R, I bands)
107
  arr = hdul[0].data[0][0:3]
108
  arrs = [arr]
109
+ elif dim == '3dt_reshape' and len(hdul[0].data) > 2: # Same as 3dt but reshape into 2D array, for compatibility with JPEG-LS and RICE
110
  arr = hdul[0].data[0:3][2].reshape((800, -1))
111
  arrs = [arr]
112
+ elif dim == '3dw_reshape' and len(hdul[0].data[0]) > 2: # Same as 3dw but reshape into 2D array, for compatibility with JPEG-LS and RICE
113
  arr = hdul[0].data[0][0:3].reshape((800, -1))
114
  arrs = [arr]
115
+ elif dim == 'tw': # Iterate through all possible arrays where the x,y spatial location is fixed, and the remaining 2D array consists of ALL timesteps, ALL wavelengths.
116
  init_arr = hdul[0].data
117
  def arrs_gen():
118
  for i in range(init_arr.shape[-2]):