The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

"Aggregate package vs custom aggregate functions"

pyronaidpyronaid Member Posts: 4 Contributor I
edited June 2019 in Help
Hi,
i want to use the package "aggregate" to group some record in one, group by one attribute.
I have a problem because i've an attribute named "wind direction" with values [0-360]

i need to use a custom aggregate function instead of simply average that not consider periodicity of grades.

the custom function should make this:

aMin = min(anglesList)
aMax = max(anglesList)
if (aMax - aMin) < 180
return media(anglesList)
else
for a in anglesList
if a < 180 : a += 360
M = media(anglesList)
if M >= 360 : M -= 360
return M


id- angle - value 2
1      -  10        - 20
2      -  150        - 25
3      -  36        - 8
1      -  350        - 18
2      -  225        - 29
3      -  27        - 11
1      -  330          - 24
2      -  14        - 20
3      -  20        - 3
1    -  20        - 3


aggregate should produce this:
1 - 357.5 - 65

there's a possibility to make this???
Tagged:
Sign In or Register to comment.