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:
plotted as raw data diagnostics map plots.
visualized as a text summary
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 % |
1 | 122 | 22 - 23 | 2019-06-02T02:04:53 | 47.98 | -65.09 | 2019-06-02T02:11:56 | 97.61 | -62.04 | 416 | 1.92% |
2 | 122 | 42 - 43 | 2019-06-02T20:47:21 | 112.56 | -62.90 | 2019-06-02T20:54:08 | 161.09 | -64.80 | 401 | 1.50% |
3 | 122 | 98 - 99 | 2019-06-05T01:17:23 | 52.07 | -65.25 | 2019-06-05T01:24:09 | 99.87 | -62.20 | 400 | 0.00% |
4 | 122 | 170 - 171 | 2019-06-07T20:41:41 | 91.96 | -61.05 | 2019-06-07T20:50:53 | 155.09 | -63.29 | 543 | 1.84% |
5 | 122 | 174 - 175 | 2019-06-08T00:29:23 | 52.61 | -64.96 | 2019-06-08T00:36:33 | 103.19 | -62.07 | 424 | 0.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()

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()
