Hi Henri,

If you're working with angles, or any data with a modulo applied to it, you 
should really "unmodulo" it before using the data. This will make most 
computations a lot easier, including finding the MAD on buckets. At the end 
of the script, you can just reapply the mod if you need to.

Here is a utility macro I use to "unmodulo" a GTS or a list thereof:
<%
SAVE 'context' STORE

[ 'gts' 'modulo' ] STORE
0 'add_val' STORE

[ 
$gts 
<%
'mw' STORE

$mw 0 GET // Tick
$mw 4 GET -1 GET // Lat
$mw 5 GET -1 GET // Lon
$mw 6 GET -1 GET // Elev
$mw 7 GET -1 GET 
$mw 7 GET 0 GET - 'diff' STORE
$diff ABS $modulo 2.0 / >
<%
$diff 0 <
<% $add_val $modulo + 'add_val' STORE %>
<% $add_val $modulo - 'add_val' STORE %>
IFTE
%>
IFT
$mw 7 GET -1 GET $add_val + // Value
%> 
1 SNAPSHOTN EVAL
{ 'modulo' $modulo } DEREF
MACROMAPPER
1 0 0
]
MAP

$gts TYPEOF 'LIST' !=
<% 0 GET %>
IFT

$context RESTORE
%>

You can use it this way:
$gtsOrlgts 360 @util/unmod

Regards,
Fabien.

On Friday, February 14, 2020 at 9:19:26 AM UTC+1, henri laurent wrote:
>
> Hi,
> I am looking for a method to measure the variability of a set of angles.
> For non circular data, we have bucketizer.mad.
> Could we have a bucketizer.mad.circular function the same way we have 
> buckerizer.mean 
> and buckerizer.mean.circular?
>
> Thanks,
>
> Henri
>
>

-- 
You received this message because you are subscribed to the Google Groups "Warp 
10 users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/warp10-users/b2295591-6a8c-472a-92c4-918901c33170%40googlegroups.com.

Reply via email to