Skip to content

Commit

Permalink
fix comments in fits
Browse files Browse the repository at this point in the history
also put the device message in logging
  • Loading branch information
segasai committed Nov 16, 2024
1 parent 50392ac commit 69c827a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion py/rvspecfit/desi/desi_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,12 @@ def get_specdata(waves,
def comment_filler(tab, desc):
""" Fill comments in the FITS header """
for i, k in enumerate(tab.data.columns):
tab.header['TCOMM%d' % (i + 1)] = desc.get(k.name)[1] or ''
comm = desc.get(k.name)
if comm is None:
comm = ''
else:
comm = comm[1]
tab.header['TCOMM%d' % (i + 1)] = comm
return tab


Expand Down
3 changes: 2 additions & 1 deletion py/rvspecfit/nn/RVSInterpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import scipy.spatial
import numpy as np
import os
import logging

device_env_name = 'RVS_NN_DEVICE'
if device_env_name in os.environ:
Expand All @@ -27,7 +28,7 @@ def __init__(self, kwargs):
# self.device = list(self.nni.children())[0][0].pc_layer.weight.device

self.nni.to(self.device)
print('RVS NN interpolator device:', self.device)
logging.debug(f'RVS NN interpolator device: {self.device}')
self.nni.eval()

def __call__(self, x):
Expand Down

0 comments on commit 69c827a

Please sign in to comment.