07-30-2012 02:29 PM
I bet we're facing the classic "You can't do an equality check on a floating point" issue in the final loop. Can you supply an example file? I'm mostly looking for the order of the file read wavelengths. Are they sorted in assending order? If so, then you should be using the Threshold 1D Array with a Round to Nearest to get the index of the power. But I would really like that example file so I can see where things are going wrong.
07-30-2012 02:35 PM
I was able to have the power be extracted (only after I deleted the header, I didnt understand how to skip it)! I changed the index from 1 to 2 and it worked, I think. Here are the text files, test1.txt is the one I was trying to extract, and eqetest1.txt is hte one I was trying to create with the given data (I dont know if this matters)
07-30-2012 03:00 PM
@MAELV wrote:
I was able to have the power be extracted (only after I deleted the header, I didnt understand how to skip it)! I changed the index from 1 to 2 and it worked, I think. Here are the text files, test1.txt is the one I was trying to extract, and eqetest1.txt is hte one I was trying to create with the given data (I dont know if this matters)
Changing the index worked because there are double tabs. With a single tab being the delimiter, it makes perfect sense that the power would be all 0s. I set the delimiter to 2 tabs and it works for me. I also read the first line of the file first (using the instructions I gave earlier). I took the liberty of cleaning up some of the code for you. It should look at a least a little simpler. I also added an input for the file so I didn't have to keep choosing the file (got a little annoying). You can reenable the file dialog if you want.
Let me know if you have any questions on my code. I'm about to get out of here, but I will check first thing in the morning.