getpsf macro error

  • 8 February 2021
  • 5 replies
  • 94 views

I used the ZPL example to calculate psf. why there is an error message.



5 replies

Userlevel 5
Badge +1

Hi Zhenfeng,


It looks like Line 16 might be the issue. Does it work if you place the period within the quotation marks, to be:

 


PRINT 'There are ', np, ' data points, spaced ', vec1(np+1), 'micrometers apart.'




Let us know if there are continued questions here!


~ Angel

thanks.  but if i increase sampling and use loop to increase vector size, it shows vector size too small. how to fix it?


Userlevel 5
Badge +2

Hi Zhenfeng,


Thanks for your follow-up question here!


If you increase the sampling it might be a good a idea to first estimate the number of resulting data points. Usually, this number will be 4*n*n where n is the sampling size (32, 64, etc.). In your case, you set sampling to 2, so the pupil sampling will be 64 x 64, and there will be 128x128=16,384 values in the array. (This will require 8 bytes per number, or a total of 131 kb.) You started from vector size of 4500, and you increased it by 100 in each cycle, so it would require lots of iterations to get there. Please try to start your vector size from a value larger than 16,384, and see if it solves the problem. In the commented section I saw you tried an even higher sampling 3, if you wish to increase to sampling 3, then please make sure to increase the vector size to be larger than 256x256=65,536.


You may find more information about the GETPSF keyword and its outputs in the Help system at:

The Programming Tab > About the ZPL > KEYWORDS (about the zpl) > GETPSF


If you have any further questions, please let us know and we will be happy to help!


Best,


Csilla

if -3, a general error occurred while computing the psf. which type of errors may occur? is it possible to avoid this error?

Userlevel 4
Badge +1

The -3 error appears to be a general purpose error code for the ZPL call to PSFs that returns when it is not an aborted code, a too-small vector, or insufficient RAM. You'll probably have to play around with your system to get it working and then adjust parameters gradually until it shows up again to see what's going on.

Reply