Skip to content

Commit

Permalink
Store zero in case the spectral resolution is set to None in add_object
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Stolker committed Apr 10, 2020
1 parent 028d2db commit 2a19df4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions species/data/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,10 +664,15 @@ def add_object(self,
h5_file.create_dataset(f'objects/{object_name}/spectrum/{key}/inv_covariance',
data=np.linalg.inv(read_cov[key]))

print(f' - {key}: {value[2]:.2f}')

dset = h5_file[f'objects/{object_name}/spectrum/{key}']
dset.attrs['specres'] = value[2]

if value[2] is None:
print(f' - {key}: None')
dset.attrs['specres'] = 0.

else:
print(f' - {key}: {value[2]:.2f}')
dset.attrs['specres'] = value[2]

h5_file.close()

Expand Down

0 comments on commit 2a19df4

Please sign in to comment.