I am trying to calculate peak to valley value showing on 'analysis-interferogram' window by ZPL, and use it in the merit function editor with ZPLM operand.
But I have no idea how to directly get the peak to valley value using any kinds of pre-defind functions or else, so currently what I am doing is to save the text file of interferogram analysis result, then read back in, and extract the peak to valley value, then pass it using OPTRETURN.
This process seems require a lot of time to calculate system by system during the optimization,
so I want to find a quick method to obtain the peak to valley value, instead of what I am doing now.
Thank you in advance.
And I hope there is a clever way to do this.
The peak-to-valley wavefront error is not a metric tied to the interferogram analysis. It is more natural for me to read it directly from the wavefront map analysis.
In this post,
@Hui Chen discusses a method using the ZERN operand, which is probably the fastest method of all because it uses a native operand.
Additionally, I made a user-defined operand where I computed the peak-to-valley from the data of the wavefront map analysis directly (without writting to a text file) in case you want to try its speed. The advantage with this method is that you can then compute any metric you like from the wavefront map data. The UDOC is embedded in the archive attached, and the source code can be found in this repository.
The archive contains the Double Gauss sample file with the wavefront map at field 3. I have placed a ZERN operand, and the UDOC for you to compare the results.
Let me know if this helps, and take care,