Skip to content

Commit d78cfbf

Browse files
committed
Improve docstrings in rqatrend
1 parent ede4a0b commit d78cfbf

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/rqatrend.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ using Distances
66
"""rqatrend(cube;thresh=2, path=tempname() * ".zarr")
77
88
Compute the RQA trend metric for the datacube `cube` with the epsilon threshold `thresh`.
9+
`lowerbound` and `upperbound` are forwarded to the classification of the RQA Trend result.
910
"""
10-
function rqatrend(cube; thresh=2, outpath=tempname() * ".zarr", overwrite=false, kwargs...)
11-
mapCube(rqatrend, cube, thresh; indims=InDims("Time"), outdims=OutDims(; outtype=UInt8, path=outpath, fill_value=255, overwrite, kwargs...))
11+
function rqatrend(cube; thresh=2, lowerbound=-5, upperbound=-0.5, outpath=tempname() * ".zarr", overwrite=false, kwargs...)
12+
mapCube(rqatrend, cube, thresh, lowerbound, upperbound; indims=InDims("Time"), outdims=OutDims(; outtype=UInt8, path=outpath, fill_value=255, overwrite, kwargs...))
1213
end
1314

1415
@testitem "rqatrend cube" begin
@@ -37,16 +38,19 @@ end
3738
"""rqatrend(path::AbstractString; thresh=2, outpath=tempname()*".zarr")
3839
3940
Compute the RQA trend metric for the data that is available on `path`.
41+
See the `rqatrend` for a YAXArray for the description of the parameters.
4042
"""
41-
rqatrend(path::AbstractString; thresh=2, outpath=tempname() * ".zarr", overwrite=false, kwargs...) =
42-
rqatrend(Cube(path); thresh, outpath, overwrite, kwargs...)
43+
rqatrend(path::AbstractString; thresh=2, lowerbound=-5., upperbound=-0.5, outpath=tempname() * ".zarr", overwrite=false, kwargs...) =
44+
rqatrend(Cube(path); thresh, lowerbound, upperbound, outpath, overwrite, kwargs...)
4345

4446

4547
"""
4648
rqatrend(xout, xin, thresh)
4749
4850
Compute the RQA trend metric for the non-missing time steps of xin, and save it to xout.
49-
`thresh` specifies the epsilon threshold of the Recurrence Plot computation
51+
`thresh` specifies the epsilon threshold of the Recurrence Plot computation.
52+
`lowerbound` and `upperbound` are the bounds of the classification into UInt8.
53+
The result of rqatrend are UInt8 values between 0 (no change) to 254 (definitive change) with 255 as sentinel value for missing data.
5054
"""
5155
function rqatrend(pix_trend, pix, thresh=2, lowerbound=-5., upperbound=-0.5)
5256
pix_trend .= classify_rqatrend(rqatrend_impl(pix; thresh); lowerbound, upperbound)
@@ -56,6 +60,7 @@ end
5660
classify_rqatrend(trend; lowerbound=Float32(-5.0), upperbound=Float32(-0.5)))
5761
Classify the rqatrend and put it into 254 bins so that they can fit into a UInt8 encoding.
5862
This is a compromise between data storage and accuracy of the change detection.
63+
The value range is 0 (no change) to 254 (definitive change) with 255 kept free as a Sentinel value for missing data.
5964
"""
6065
function classify_rqatrend(trend; lowerbound=Float32(-5.0), upperbound=Float32(-0.5))
6166
isnan(trend) && return UInt8(255)

0 commit comments

Comments
 (0)