Skip to content

Commit

Permalink
feat(sensitivity): add option: divide by estimate
Browse files Browse the repository at this point in the history
Closes #79
  • Loading branch information
nritsche committed Nov 27, 2020
1 parent 0d451f0 commit 9feb3c3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bondia/plot/sensitivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class SensitivityPlot(RaHeatMapPlot, Reader):
polarization = param.ObjectSelector()
mark_day_time = param.Boolean(default=True)
mask_rfi = param.Boolean(default=True)
divide_by_estimate = param.Boolean(default=False)

def __init__(self, data, config, **params):
self.data = data
Expand All @@ -51,7 +52,7 @@ def __init__(self, data, config, **params):
RaHeatMapPlot.__init__(
self, "Sensitivity", activated=True, config=config, **params
)
self.height = 600
self.height = 650
self.read_config(config)
self.logarithmic_colorscale = True

Expand Down Expand Up @@ -83,6 +84,7 @@ def update_pol(self):
"flag_mask",
"flags",
"height",
"divide_by_estimate",
)
def view(self):
if self.lsd is None:
Expand Down Expand Up @@ -131,6 +133,13 @@ def view(self):
rfi = np.squeeze(rfi_container.mask[:])
sens *= np.where(rfi, np.nan, 1)

if self.divide_by_estimate:
estimate = np.squeeze(sens_container.radiometer[:, sel_pol])
if self.polarization == self.mean_pol_text:
estimate = np.squeeze(np.nanmean(estimate, axis=1))
estimate = np.where(estimate == 0, np.nan, estimate)
sens = sens / estimate

if self.transpose:
sens = sens.T
index_x = index_map_f
Expand Down

0 comments on commit 9feb3c3

Please sign in to comment.