I have a 3D wave, waveA, where some of its elements are NaN. How can I replace all of these NaN elements with a numerical value, e.g. 100.0, without using loop?
Thanks for you both, it seems like matrixop is faster but it's also good to have other form of codes which does the same and can be generalized to another wave filtering operation.
Hey,
sorry for leaving this thread for one day without updating. So I what I want is actually to use
interpolate3D
to get the 3D wave and for points lying outside the domain of the source wave this command will return NaN. That's why in the end my 3D wave will contain some NaN elements. However, yesterday I noticed that with my source wave for
triangulate3D
(I need the output from this command to run the subsequent
interpolate3D
) being very large (2050401 rows and 4 cols), the execution time exceeded 24 hours until I aborted it before finish. I see someone mentioning
MultiThread
, looks like some parallel computation related term. Will it help speeding up
tomy77 wrote: Hey,
sorry for leaving this thread for one day without updating. So I what I want is actually to use
interpolate3D
to get the 3D wave and for points lying outside the domain of the source wave this command will return NaN. That's why in the end my 3D wave will contain some NaN elements. However, yesterday I noticed that with my source wave for
triangulate3D
(I need the output from this command to run the subsequent
interpolate3D
) being very large (2050401 rows and 4 cols), the execution time exceeded 24 hours until I aborted it before finish. I see someone mentioning
MultiThread
, looks like some parallel computation related term. Will it help speeding up
triangulate3D
?
It is not practical to use triangulate3D operation for very large data sets.
In your case, I think you should think of other ways to do your work. Say, pay attention to the speciality of your data and find a spcial method just suited to your need!
The triangulation process is O(N^2) so you are really looking at a very long computation. Depending on your application you might consider reducing the amount of data that is being triangulated, grouping parts of the data, triangulating and interpolating in smaller groups and similar approaches where you simply reduce the size of N.
Matrixop destwave=replaceNaNs(your3Dwave,100)
Andy
July 9, 2017 at 06:55 am - Permalink
where is the value you want to change the to (i.e. in this case).
I don't know how the snippet is optimized internally by the igor pro interpreter, so it may be slower than using . But the snippet above allows you to build other logical functions/ filters for wave elements.
best,
_sk
July 10, 2017 at 01:57 am - Permalink
July 10, 2017 at 04:07 am - Permalink
best,
_sk
July 10, 2017 at 04:19 am - Permalink
July 10, 2017 at 07:28 am - Permalink
Great!!
with mutithread key word,that is why Igor so powerfull!
July 11, 2017 at 04:48 am - Permalink
sorry for leaving this thread for one day without updating. So I what I want is actually to use to get the 3D wave and for points lying outside the domain of the source wave this command will return NaN. That's why in the end my 3D wave will contain some NaN elements. However, yesterday I noticed that with my source wave for (I need the output from this command to run the subsequent ) being very large (2050401 rows and 4 cols), the execution time exceeded 24 hours until I aborted it before finish. I see someone mentioning , looks like some parallel computation related term. Will it help speeding up ?
July 11, 2017 at 06:45 pm - Permalink
It is not practical to use triangulate3D operation for very large data sets.
In your case, I think you should think of other ways to do your work. Say, pay attention to the speciality of your data and find a spcial method just suited to your need!
July 11, 2017 at 07:22 pm - Permalink
July 12, 2017 at 11:01 am - Permalink