Use the following plot methods for displaying scaled waveform data:
comp.plot.waveforms_delta_im()
- to draw the waveforms difference imagecomp.plot.waveforms_scatter()
- to draw the waveforms scatter plotcomp.p1/p2.plot.waveform_line()
- to draw a simple waveform line plotcomp.p1/p2.plot.waveform_im()
- to draw a waveform imagecomp.p1/p2.plot.waveform_hist()
to draw a waveform histogramcomp.plot.locations()
- to draw the footprints of the two L1B products on a mapUse 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:
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.color
argument. Please refer to the
Matplotlib Colors API to learn how colors can be specified.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
waveforms_delta
using numpyThe 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 [ ]: