Skip to content

Commit

Permalink
modified: pspecdata.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nkern committed Apr 1, 2018
1 parent 06770e7 commit 35213dd
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions hera_pspec/pspecdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@
import pyuvdata
from .utils import hash, cov

def raise_warning(warning, verbose=True):
'''warning function'''
if verbose:
print(warning)


class PSpecData(object):

Expand Down Expand Up @@ -121,7 +116,7 @@ def validate_datasets(self, verbose=True):
# raise warning if frequencies don't match
freq_diffs = np.array(map(lambda dset: np.unique(self.dsets[0].freq_array) - np.unique(dset.freq_array), self.dsets[1:]))
if np.max(np.abs(lst_diffs)) > 0.001e6:
raise_warning("Warning: taking power spectra between frequency bins misaligned by more than 0.1 MHz",
raise_warning("Warning: taking power spectra between frequency bins misaligned by more than 0.001 MHz",
verbose=verbose)

# Check for the same polarizations
Expand Down Expand Up @@ -849,3 +844,10 @@ def pspec(self, bls, beam=None, input_data_weight='identity', norm='I',
pairs.append((key1, key2))

return np.array(pvs), pairs


def raise_warning(warning, verbose=True):
'''warning function'''
if verbose:
print(warning)

0 comments on commit 35213dd

Please sign in to comment.