ZOS-API Syntax to define wavelength shift in Python

  • 14 July 2020
  • 1 reply
  • 92 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.


1 reply

Userlevel 6
Badge +2

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