AxisArrays.jl icon indicating copy to clipboard operation
AxisArrays.jl copied to clipboard

Question: How to change axis?

Open mdhe1248 opened this issue 7 years ago • 0 comments

Hi, I am wondering if there is a way to change axes. For example,

using Unitful
using AxisArrays
const μm = u"μm"
const s = u"s"

tmp = AxisArray(rand(1000,1000,2,2), (:x, :y, :z, :t), (0.577μm, 0.577μm, 5μm, 2s))

I would like to change 0.577μm of :x to some other values. Is there easy with to change it (without generating a new array)? I tried several things. All didn't work.

# All below do not work.
tmp[Axis{:x}] = 1:1000 
tmp = AxisArray(tmp, (:x), (1))
tmp = AxisArray(tmp, (:x, :y, :z, :t), (1, 0.577μm, 5μm, 2s)) # This generates additional axis.

Best,

mdhe1248 avatar Jul 24 '17 20:07 mdhe1248