JuliaArrays / JuliaArrays/AxisArrays.jl

Weighted mean

Open
#134 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
207
Forks
41
PR merge metrics
No merged PRs in 30d

Description

When indexing into an AxisArray, how can I get the value of the axis at the indexed value?

This becomes relevant for instance in the last example (btw, I PR:ed a version that works after following what you concluded in #127), it would make extra sense (to me at least) when the intensity-weighted mean is performed on the actual axis values, not on the integer indices. So in this specific example the axis are just integers, but if B was say AxisArray(randn(100,100,100), Axis{:x}(1:100), Axis{:y}(1:100), Axis{:z}(linspace(1mm, 3mm, 100))), how would you perform the weighted mean then?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the last example in the issue and review the discussion in #127 to understand the existing weighted-mean approach. Determine how an AxisArray can expose the axis value at an indexed position, then verify that the weighted mean can use non-integer axis values such as the example's z axis.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.