Photonics

Photonics

Topics related to Lumerical and more.

gdsopen command using ‘userUnit’

    • Balasubramanian Malayappan
      Subscriber
      Hi,
      I have a query regarding the gdsopen command in Lumerical scripting.
      I wish to customize the database units for the gds file being created and exported. I don't understand what "userUnit" is, and am not able to find any relevant resources about initializing it.
      Can you please share an example script of gdsopen command using "userUnit" and "dataBaseUnit" parameters?
      thanks in advance
    • Guilin Sun
      Ansys Employee

      It seems no direct example. But the website mentions:

      The default database units are in 0.1nm and the user units are microns

      https://optics.ansys.com/hc/en-us/articles/360034927093-gdsopen-Script-command

      "userUnit" should be the unit you use, and  "dataBaseUnit" should be the unit when the GDS is created. You can create a rectangle of  1um and see the result.

      • Balasubramanian Malayappan
        Subscriber

        Hi Guilin Sun,

        I tried it. It is throwing up the following error message.

        : in gdsopen: argument 2 must be one of scalar matrix

        How should I resolve this?

    • Guilin Sun
      Ansys Employee

      The error message suggests to assign a number, not quoted. 

      Since the website does not give an example using them, I would suggest to use the online example script to assign the unit to each parameter individually. " gdsopen" is only used to open a gds file handle.

       

       

      • Balasubramanian Malayappan
        Subscriber

        I understand that gdsopen is used to create a gds file and also its handle. Following is the command I gave as the input as I want the user unit to be micron and the gds database unit as 5 nm. The resultant error message is ": in gdsopen: argument 2 must be one of scalar matrix"

        f = gdsopen('test.gds','1e-6','0.005e-6');

        How to assign the unit to each parameter individually?

        I do not see any command (other than gdsopen) in the Lumerical script by which the properties for the entire gds file can be modified.

    • Guilin Sun
      Ansys Employee

      the correct usage is:

      f = gdsopen('test.gds',1e-6,0.005e-6);

      Please check if it can work as expected.

      I would strongly suggest to define a unit such as

      um=1e-6;

      then when you assian size to a variable, such as xspan to be 5um, you can use

      5*um.

       

       

      • Balasubramanian Malayappan
        Subscriber

        Yes, the above command works correctly. Thanks for the help.

        Further, the advise on using variables is duly noted.

        Cheers

Viewing 3 reply threads
  • The topic ‘gdsopen command using ‘userUnit’’ is closed to new replies.