Skip to content

Commit

Permalink
feat(DelaySpectrumEstimator, DelaySpectrumEstimatorBase): add initial…
Browse files Browse the repository at this point in the history
…_amplitude parameter
  • Loading branch information
sjforeman committed Nov 15, 2022
1 parent a478b4d commit 8f1b757
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions draco/analysis/delay.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ class DelaySpectrumEstimator(task.SingleTask, random.RandomTask):
Whether to assume the original time samples that were channelized into a
frequency spectrum were purely real (False) or complex (True). If True,
`freq_zero`, `nfreq`, and `skip_nyquist` are ignored. Default: False.
initial_amplitude : float, optional
The Gibbs sampler will be initialized with a flat power spectrum with
this amplitude. Default: 10.
"""

nsamp = config.Property(proptype=int, default=20)
Expand All @@ -374,6 +377,7 @@ class DelaySpectrumEstimator(task.SingleTask, random.RandomTask):
["nuttall", "blackman_nuttall", "blackman_harris"], default="nuttall"
)
complex_timedomain = config.Property(proptype=bool, default=False)
initial_amplitude = config.Property(proptype=float, default=10.0)

def setup(self, telescope):
"""Set the telescope needed to generate Stokes I.
Expand Down Expand Up @@ -437,7 +441,7 @@ def process(self, ss):
delay_spec.redistribute("baseline")
delay_spec.spectrum[:] = 0.0

initial_S = np.ones_like(delays) * 1e1
initial_S = np.ones_like(delays) * self.initial_amplitude

# Initialize the random number generator we'll use
rng = self.rng
Expand Down Expand Up @@ -535,6 +539,9 @@ class DelaySpectrumEstimatorBase(task.SingleTask, random.RandomTask):
Whether to assume the original time samples that were channelized into a
frequency spectrum were purely real (False) or complex (True). If True,
`freq_zero`, `nfreq`, and `skip_nyquist` are ignored. Default: False.
initial_amplitude : float, optional
The Gibbs sampler will be initialized with a flat power spectrum with
this amplitude. Default: 10.
"""

nsamp = config.Property(proptype=int, default=20)
Expand All @@ -549,6 +556,7 @@ class DelaySpectrumEstimatorBase(task.SingleTask, random.RandomTask):
dataset = config.Property(proptype=str, default="vis")
average_axis = config.Property(proptype=str)
complex_timedomain = config.Property(proptype=bool, default=False)
initial_amplitude = config.Property(proptype=float, default=10.0)

def setup(self, telescope: io.TelescopeConvertible):
"""Set the telescope needed to generate Stokes I.
Expand Down Expand Up @@ -665,7 +673,7 @@ def process(self, ss: FreqContainerType) -> containers.DelaySpectrum:
delay_spec.create_index_map(ax, ss.index_map[ax])
delay_spec.attrs["baseline_axes"] = bl_axes

initial_S = np.ones_like(delays) * 1e1
initial_S = np.ones_like(delays) * self.initial_amplitude

# Initialize the random number generator we'll use
rng = self.rng
Expand Down

0 comments on commit 8f1b757

Please sign in to comment.