Skip to content

Commit

Permalink
fix: repair debug commands
Browse files Browse the repository at this point in the history
  • Loading branch information
hollandjg committed Mar 4, 2024
1 parent 7c52f15 commit ea2920f
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/icesat2_tracks/ICEsat2_SI_tools/spectral_estimates.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,11 @@ def get_stancil_var_apply(stancil):
stancil_vars.append(I)

_logger.debug('Parcevals Theorem:')
_logger.debug('variance of unweighted timeseries: ',DATA.var())
_logger.debug('mean variance of detrended chunks: ', np.array(stancil_vars).mean())
_logger.debug('variance of unweighted timeseries: %s', DATA.var())
_logger.debug('mean variance of detrended chunks: %s', np.array(stancil_vars).mean())
#_logger.debug('variance of weighted timeseries: ',self.phi.var() )
#self.calc_var(self)
_logger.debug('variance of the pwelch Spectrum: ', self.calc_var())
_logger.debug('variance of the pwelch Spectrum: %s', self.calc_var())

if add_attrs:
self.G.attrs['variance_unweighted_data'] = DATA.var()
Expand Down Expand Up @@ -912,11 +912,11 @@ def get_stancil_var_apply(stancil):
stancil_weighted_variance = np.nansum(np.array(stancil_vars))/Nphotons

_logger.debug('Parcevals Theorem:')
_logger.debug('variance of timeseries: ', DATA.var())
_logger.debug('mean variance of stancils: ', stancil_weighted_variance )
_logger.debug('variance of timeseries: %s', DATA.var())
_logger.debug('mean variance of stancils: %s', stancil_weighted_variance )
#_logger.debug('variance of weighted timeseries: ',self.phi.var() )
#self.calc_var(self)
_logger.debug('variance of the optimzed windowed LS Spectrum: ', self.calc_var())
_logger.debug('variance of the optimzed windowed LS Spectrum: %s', self.calc_var())

if add_attrs:
self.G.attrs['variance_unweighted_data'] = DATA.var()
Expand Down Expand Up @@ -1027,10 +1027,10 @@ def __init__(self,data, x, L, ov=None, window=None, save_chunks=False, plot_chun
else:
if plot_chunks:
_logger.debug('end of TS is reached')
_logger.debug('last spec No: '+str(last_k))
_logger.debug('spec container: '+str(specs.shape))
_logger.debug('last used Timestep: '+str(last_used_TS))
_logger.debug('length of TS '+ str(dsize) +'ms')
_logger.debug('last spec No: %s', str(last_k))
_logger.debug('spec container: %s', str(specs.shape))
_logger.debug('last used Timestep: %s', str(last_used_TS))
_logger.debug('length of TS %s ms', str(dsize))

k+=1

Expand Down Expand Up @@ -1089,11 +1089,12 @@ def error(self, ci=0.95):

def parceval(self):
_logger.debug('Parcevals Theorem:')
_logger.debug('variance of unweighted timeseries: ',self.data.var())
_logger.debug('mean variance of timeseries chunks: ',self.chunks.var(axis=1).mean() if self.save_chunks is True else 'data not saved')
_logger.debug('variance of unweighted timeseries: %s',self.data.var())
_logger.debug('mean variance of timeseries chunks: %s',self.chunks.var(axis=1).mean() if
self.save_chunks is True else 'data not saved')
#_logger.debug('variance of weighted timeseries: ',self.phi.var() )
#self.calc_var(self)
_logger.debug('variance of the pwelch Spectrum: ',self.var)
_logger.debug('variance of the pwelch Spectrum: %s',self.var)

def calc_var(self):
""" Compute total variance from spectrum """
Expand Down

0 comments on commit ea2920f

Please sign in to comment.