Assigning values to a 3D wave
Hi all,
I was wondering how I can put and organize data in a 3D wave.
Let me explain it more.
Suppose I have a function of three variables, say T, where T=T(p, q, r). For p, q, r and T, I have four respective waves: pW, qW, rW and TW. Each element of TW wave represents the corresponding functional value of p, q and r. Now I need to make a 3D wave from the given waves and do a linear interpolation from it (i.e. interpolate T for a given (p,q,r)).
I went through the manual and found that the 'Make' operation (Make/O/N=(rowNum, columnNum, layerNum) my3DWName) can make a 3D wave but I am confused about how I can put my data values in that.
I also found the 'Interp3D' function ( Interp3D(my3DWName, 2,3,5)) can be used to do a linear 3D interpolation but for that, first I need to fill the 3D wave with my given data.
I would highly appreciate your suggestions and tips.
Thanks,
A
It is not fully clear to me what your situation is and what you want to do. You write "Each element of TW wave represents the corresponding functional value of p, q and r". This sounds to me like TW is already a 3D wave (how can it represent all functional values of all three variables otherwise?). Or are pW, qW, rW and TW 1D waves? How does this work then? Yes in principle you can reorganize your data into a proper 3D wave using Make or Concatenate or MatrixOp, depending on how your data looks. Also, what you want to do with the interpolation? Do you just want one arbitrary in-between point from you 3D data => interp3D will give you that for a given coordinate x, y, z. Could you maybe post some example data? If we know where to start it is probably very easy to point you in the right direction.
January 29, 2022 at 12:27 am - Permalink
In reply to It is not fully clear to me… by chozo
Sorry, I guess I didn't make it fully clear. So I am trying to make it more understandable.
Let us consider the temperature, T of a room. It is a function of three spatial coordinates, i.e. T=T(x,y,z). I have four 1D waves: xW, yW, zW, and TW. xW is the x-coordinate wave; yW, the y-coordinate wave; zW, the z-coordinate wave and TW is the temperature wave (measured at x, y, z). Now I want to make a 3D wave whose 1st dimension (row) will hold the xW wave; 2nd dimension (column), the yW wave; 3rd dimension (layer), the zW wave and elements of this 3D wave will be the TW data values. After making the wave, my goal is to do an interpolation for T for a given (x,y,z) from it (which I guess I can do with the interp3D function easily).
I hope now you get what I meant. I can make the 3D wave easily but I am confused about the wave assignments to a 3D wave in this type of situation. I went through the manual but didn't get it fully.
Thank you very much,
A
January 29, 2022 at 01:53 am - Permalink
OK, I think we are getting closer. I see your data is a linear representation of the 3D data, i.e., the data is arranged to stepwise increase one variable after the other. But looking at your example file, it seems there is only data in two dimensions, since your yW is zero throughout. Maybe you omitted this part. For now I see that:
You just need to reformat your TW to a multidimensional wave with the right number of rows, columns and layers (the last one does not apply to your example data, but the idea is the same). So I did the following using Redimension, which changes the dimension of waves:
SetScale/I x 0, 0.4, TW
SetScale/I y -0.008, 0.008, TW
The last two commands apply the range from xW and zW to their respective dimension (here zW = x and xW = y) as Igor's wave scaling (you can rotate the data if you rather want to have zW = y and xW = x or any other combination for your 3D wave later). The xW and zW waves are not needed anymore and can be deleted.
Now you could do for example try this in the command line:
print interp2D(TW, 0.105, -0.0055)
which gives you the interpolated point at these coordinates. The same is true if you create a 3D wave for the (full?) range including yW and then use interp3D.
January 29, 2022 at 04:38 am - Permalink
In reply to OK, I think we are getting… by chozo
Hi Chozo,
Thank you very much for your suggestions. Now I understand and got the idea of how to assign the values to rows, columns and layers to a 3D wave.
Appreciate your guidelines and time a lot.
Ann
January 30, 2022 at 02:11 pm - Permalink