DeDop L1B Comparison

Use the following plot methods for displaying scaled waveform data:

  • comp.plot.waveforms_delta_im() - to draw the waveforms difference image
  • comp.plot.waveforms_scatter() - to draw the waveforms scatter plot
  • comp.p1/p2.plot.waveform_line() - to draw a simple waveform line plot
  • comp.p1/p2.plot.waveform_im() - to draw a waveform image
  • comp.p1/p2.plot.waveform_hist() to draw a waveform histogram
  • comp.plot.locations() - to draw the footprints of the two L1B products on a map

Use the following generic methods for displaying any other variables:

  • comp.p1/p2.plot.line(x, y) - to draw two 1D variables (line plots)
  • comp.p1/p2.plot.im_line(z) - to draw a 2D variable (images + and line plots)
  • comp.p1/p2.plot.im(z) - to draw a 2D variable (images)

Usage hints:

  • In menu Cell select Run All to run all notebook cells
  • Place cursor over a any field or function in a cell and press SHIFT + TAB to display help on that element.
  • Type comp. or comp.plot. then press TAB key to get a list of available elements of the comp and comp.plot objects for auto-completion.
  • Some functions have a color argument. Please refer to the Matplotlib Colors API to learn how colors can be specified.
  • Some functions have a cmap argument, which names a colour map. Please refer to the Matplotlib Colormaps Reference for possible names.

In [1]:
from dedop.ui.compare import compare_l1b_products
%matplotlib inline

In [ ]:
comp = compare_l1b_products(__L1B_FILE_PATH_1__,
                            __L1B_FILE_PATH_2__)

In [ ]:
comp.plot.locations()

In [ ]:
comp.plot.waveforms_delta_im()

In [ ]:
comp.plot.waveforms_hist()

In [ ]:
comp.plot.waveforms_delta_hist()

In [ ]:
comp.plot.waveforms_hexbin()

In [ ]:
comp.plot.waveforms_scatter()

In [ ]:
comp.waveforms

In [ ]:
comp.waveforms_delta

In [ ]:
comp.waveforms_delta_range

Basic outlier detection in waveforms_delta using numpy

The following code is an example of how this Notebook may be used to do some basic statstics with numpy or scipy.

Here, we define probability bands whose widths are 2k times the standard deviation centered on the mean (of a normal distribution) of waveforms_delta. By doing this, any data points from the N samples that lie outside this probability band are considered to be outliers.


In [ ]:
import numpy as np

x = comp.waveforms_delta
x_min, x_max = comp.waveforms_delta_range

mean = x.mean()
std = x.std()

k_max = (x_max - x_min) / std if std else 1

print()
print('mean =', mean, ' std =', std, '  k_max = ', k_max)
print()

for k in [1., 2., 3., 4., 5.]:
    num_outliers = np.logical_or(x < mean - k * std, x > mean + k * std).sum()
    num_within = x.size - num_outliers
    ratio_outliers = num_outliers / x.size
    ratio_within = 1.0 - ratio_outliers 

    print('k =', k, ':')
    print('  num_within =', num_within, ' ratio_within =', 100 * ratio_within, '%')
    print('  num_outliers =', num_outliers, ' ratio_outliers =', 100 * ratio_outliers, '%')

In [ ]:
(x < x_min + 1e7).sum()

In [ ]:
(x > x_max - 1e7).sum()

In [ ]: