Section analyses

Section analyses diagnostics are added using the add_section_analysis() method.
Section analyses research portion of data matching the provided conditions.
Add the computation of a section analysis. Section analyses research
portion of data matching the provided conditions.

Section analysis plots can be created using special keywords:

* sections parameter:

    * sections="all" (default): data from all sections
    * sections=1: data limited to section 1
    * sections=[1, 2, 10, 14]: data limited to sections 1, 2, 10 and 14

Parameters
----------
name
    Name of the analysis.
condition
    Clip condition determining the section.
min_length
    Minimum number of point required to accept the section.
fill_missing
    Whether to fill missing values with False values (require parameter
    max_percent_of_false to be greater than 0 to have an effect on the result)
max_percent_of_false
    Maximum percent of False value accepted in the section.

This kind of diagnostic can be:

Diagnostic setting

In the following example we are setting a diagnostic searching for sections having a minimum length of 400 measurements, allowing missing values and having a tolerance of 2.5% of measurements not respecting its condition.
ad.add_section_analysis(
    name="Analysis 1",
    condition="IIF3(FLAG_SURFACE_TYPE :== 0 && FLAG_VAL.ALTI :!= 0, 1, 0, 0)",
    min_length=400,
    fill_missing=True,
    max_percent_of_false=2.5,
)

ad.compute()

Diagnostic text report and numerical result

Using the get_data() method allows get an analysis which will be displayed as a text report in notebooks.
ad.get_data(name="Analysis 1")
First position Last position
# Cycle Pass Date Longitude Latitude Date Longitude Latitude Length False %
112222 - 232019-06-02T02:04:5347.98-65.092019-06-02T02:11:5697.61-62.044161.92%
212242 - 432019-06-02T20:47:21112.56-62.902019-06-02T20:54:08161.09-64.804011.50%
312298 - 992019-06-05T01:17:2352.07-65.252019-06-05T01:24:0999.87-62.204000.00%
4122170 - 1712019-06-07T20:41:4191.96-61.052019-06-07T20:50:53155.09-63.295431.84%
5122174 - 1752019-06-08T00:29:2352.61-64.962019-06-08T00:36:33103.19-62.074240.00%
These results can be used through the parameters of the AnalysisResults class:
  • sections: List of found sections with their properties

  • mean_length: Mean length of sections

  • full_positions: xarray dataset containing all resulting sections

analysis = ad.get_data(name="Analysis 1")
res = analysis.result

res.mean_length
np.float64(436.8)

Diagnostic plotting

CasysPlot uses a sections parameter to determine which sections to display.
  • sections = “all” (default): show all sections

  • sections = 1: Number of the section to show

  • sections = [1 , 4, 10]: List of numbers of sections to show

Plotting all sections
from casys import CasysPlot, PlotParams

plot = CasysPlot(
    data=ad,
    data_name="Analysis 1",
    plot_params=PlotParams(x_limits=(40, 180), y_limits=(-90, 0)),
)

plot.show()
../_images/section_analyses_5_0.png
Only plotting sections 1, 2, 5 and 10.
plot = CasysPlot(
    data=ad,
    data_name="Analysis 1",
    plot_params=PlotParams(x_limits=(40, 180), y_limits=(-90, 0)),
    sections=[1, 2, 5],
)

plot.show()
../_images/section_analyses_6_0.png