Skip to main content

ZOS-API Syntax to define wavelength shift in Python

  • July 14, 2020
  • 1 reply
  • 128 views

Hi,


I have a model where I use dll defined scattering. I need to be able to define the wavelength shift in the wavelength shift box using the ZOS-API syntax, but I haven't found an example or the way this is done in the ZOS-API Help. Could you please help me?


 


Thank you in advance.

Did this topic help you find an answer to your question?

1 reply

Allie
Zemax Staff
Forum|alt.badge.img+2
  • Zemax Staff
  • 337 replies
  • July 14, 2020

Hi Elisavet,


The wavelength shift parameter may be edited by accessing the Volume Physics Data interface. Within that interface, we see that the property WavelengthShift is a string-type which may either be retrieved (get) or applied to the system (set):


 



 


With that, we can write some code which will access object 2, access the Volume Physics data of object 2, and apply a wavelength shift. You can see my example below. It is written in Matlab, but I think it should carry over to Python easily. You will need to remove the semi-colons and (maybe) upate the quotation marks aroung '1, 2, 1.0' so that they match the expected input for a string-type object in Python!


 


    obj2 = NCE.GetObjectAt(2);

    obj2VolPhysics = obj2.VolumePhysicsData;

    obj2VolPhysics.WavelengthShift = '1, 2, 1.0';

 


Note: this will only work if you have another system wavelength (wavelength 2) defined. There is more information on that point in the Help System file 'The Setup Tab > Editors Group (Setup Tab) > Non-sequential Component Editor > Object Properties (non-sequential component editor) > Volume Physics > Wavelength Shift.' 


Let me know if you have any other questions about this!


Best,


Allie


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings