Skip to content

Commit

Permalink
Update dataloader.py
Browse files Browse the repository at this point in the history
fix bugs for mean vector estimation
  • Loading branch information
ZechangSun authored Apr 3, 2023
1 parent 16ade10 commit 2bf0fde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions QFA/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def __init__(self, config: CN):
self.data_size = self.flux.shape[0]

s = np.hstack((np.exp(1*self._tau(self.zabs)), np.ones((self.data_size, self.Nr), dtype=float)))
self._mu = np.sum(self.flux*s, axis=0)/np.sum(self.flux!=0., axis=0)
self._mu = np.sum(self.flux*s*self.mask, axis=0)/np.sum(self.flux!=-999., axis=0)
self._mu = smooth(self._mu, window_len=config.TRAIN.WINDOW_LENGTH_FOR_MU)

def have_next_batch(self):
Expand Down Expand Up @@ -188,4 +188,4 @@ def __getitem__(self, idx):

@property
def mu(self):
return self._mu
return self._mu

0 comments on commit 2bf0fde

Please sign in to comment.