0% found this document useful (0 votes)
100 views

Scripting Guide - Porting Manual

Uploaded by

Yashanshu Gautam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views

Scripting Guide - Porting Manual

Uploaded by

Yashanshu Gautam
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Porting Scripts

in FIMMWAVE and FIMMPROP


from version 5.3 to 5.4

© 2012 Copyright Photon Design

34 Leopold St
Oxford, OX4 1TW
United Kingdom
Phone + 44 1865 324990
Fax + 44 1865 324991
[email protected] om
www.photond.c om
propagating ideas
© 2012 This manual is copyright of Photon Design.
Unauthorised copying is strictly prohibited.

© 2012 The program FIMMWAVE is


copyright of Photon Design. Unauthorised copying in any
form is strictly prohibited.

Photon Design
34 Leopold St Phone +44 1865 324 990
Oxford, OX4 1TW Fax +44 1865 324 991
United Kingdom Email: [email protected]
CONTENTS

1 PORTING YOUR SCRIPTS FROM FIMMWAVE/FIMMPROP 5.3 TO 5.4.................... 1


1.1 CHANGES TO FIMMWAVE AND FIMMPROP............................................................................ 1
1.2 USING THE SCRIPT CHECKER .......................................................................................................... 1
1.3 HOW TO UPDATE MY SCRIPTS ......................................................................................................... 2
Chapter

1 Porting your scripts from


FIMMWAVE/FIMMPROP 5.3 to 5.4

Significant changes have been made to the structure of FIMMPROP and to its
command line between version 5.3.9 and version 5.4. As a result, many scripts
designed in FIMMWAVE 5.3 will not be compatible with FIMMWAVE 5.4.
This document will explain what changes were made and will help you to port your
scripts to the new version.
If you have any questions, please get in touch with [email protected].

1.1 Changes to FIMMWAVE and FIMMPROP


The following changes to FIMMWAVE and FIMMPROP have lead to this
incompatibility:
● Introduction of default MOLAB Options and FIMMPROP Device Options on
the level of the FIMMPROP Device.
● As with the other FIMMPROP Sections, the WG Section and Bend Section now
have their own mode lists, independent of the mode lists of the waveguide nodes
used to define them.
● Changes to default values of various resolution parameters.
● In the WG Scanner and FIMMPROP Scanner, the default Scanner Mode is now scan
a parameter and not scan between two waveguides or scan between two devices.
● The work directory is now automatically set to the project directory. All dependent
files (external files, material database, etc.) should either be absolute or relative to
the project directory. Please note that you may need to reset some relative paths in
some project files.

1.2 Using the script checker


A Python script called “Script Checker_Porting to 5.4.py” is located in
/PhotonD/fimmwave/Scripts. You can use this script in order to find out whether and where
your scripts need to be updated. The script will check both Python and MATLAB
scripts.
In order to run it, open it with PythonWin or Notepad and set the variables:
- “dir” to choose the folder in which your scripts are located (please note that “\”
needs to be replaced by “\\” e.g. “D:\\Temp\\scripts”).
- “logname” to choose a location and name for the log file (you must be able to
write to this folder)
then run the script, either from PythonWin or by opening it with Python.

1
The script will create a log file telling you what parts of each file need to be
investigated. For each potential issue, it will tell you which case (see below) it is related
to.
Note: if you are a MATLAB user, please see section 11.9.1 of the FIMMWAVE
manual for instructions on how to install Python.

1.3 How to update my scripts


First of all we recommend that you make a back-up copy of your existing scripts, e.g.
“myscript-pre5.4.py” or “myscript-pre5.4.m”. This will allow you to use your scripts
with version 5.3.9 if you need to check that you have modified them correctly.

You will need to change your scripts in the following situations.

Case A: a script modifies the MOLAB Options of a waveguide node which is used to
define a WG Section or a Bend Section in a FIMMPROP Device.

What is the issue?


In version 5.3.9, the MOLAB Options for the WG Section or Bend Section were
taken from the ones of the waveguide node. In version 5.4.0, these sections have their
own settings which need to be changed independently.
How can I identify it?
You can look for the strings
.evlist.svp.
.evlist.mlp.
in your script in order to identify the situations where changes might be needed.
Beware that no changes are needed for these strings:
.cdev.evlist.svp.
.cdev.evlist.mlp.
What to do?
Every time the MOLAB Options of a waveguide that are used by FIMMPROP are
modified by your script, look for the WG Sections and Bend Sections that use that
waveguide and alter your script to modify the MOLAB Options for the Section
instead.

Case B: a script modifies the MOLAB Options of a WG Section or a Bend Section


(corresponds to right-click on section then “\Local modes\MOLAB Options”).

What is the issue?


In version 5.3.9, this used to modify the MOLAB Options of the associated waveguide
node, and of any other WG Section or Bend Section associated with that waveguide.
In version 5.4.0, all of these have independent MOLAB Options. The syntax used to
modify the MOLAB Options of a WG Section or Bend Section has also changed.
How can I identify it?
Easy. You simply need to look for the following strings in your script:
.wg.evlist.
What to do?
Every time you find this string in your script, it means that the MOLAB Options of a
WG Section or Bend Section are modified. In that case, please check whether you
need to modify the MOLAB Options for the waveguide node and apply the changes if
that is the case.

2
Also check whether other WG Sections or Bend Sections use that waveguide node,
and modify their MOLAB Options as well.
In addition, instances of the string
.wg.evlist
need to be deleted, e.g.
fpdevice.cdev.eltlist[1].wg.evlist.svp.lambda=1.103
fpdevice.cdev.eltlist[1].wg.evlist.mlp.autorun=1
should be replaced with
fpdevice.cdev.eltlist[1].svp.lambda=1.103
fpdevice.cdev.eltlist[1].mlp.autorun=1

Case C: a script creates a WG Section or a Bend Section, or selects or pastes a


different waveguide node for a WG Section or a Bend Section.

What is the issue?


In version 5.3.9, the MOLAB Options of a WG Section or Bend Section were
associated with the waveguide node and were modified if a different waveguide node
was selected. In version 5.4.0, the section has its own MOLAB Options, which do not
get changed when a new waveguide node is selected or pasted.
How can I identify it?
Look for the following strings in your script:
.newwgsect(
.newbend(
.setwg(
.pastewg(
What to do?
Every time you see one of these two commands being used, modify the MOLAB
Options for the corresponding WG Section or Bend Section to set them to the ones
of the waveguide node that you are selecting or pasting.

Case D: a script creates structures from scratch.

What is the issue?


Different default settings are used in versions 5.3.9 and 5.4.0 when a waveguide node
or a section/joint is created in a FIMMPROP Device.

Parameter Default value Default value Applies to…


in v. 5.3.9 in v. 5.4.0
nx 60 120 RWGs, MWGs
ny 60 90
Overlap complete special complete Simple Joints,
method Taper Sections,
Planar Sections
Scanner scan between two… scan a parameter WG Scanners,
Mode FIMMPROP Scanners

How can I identify it?

3
A problem will arise if you are defining the structure from scratch with your script and
not fully characterising its properties.
Look for the following strings in your script:
.addsubnode(rwguideNode
.addsubnode(mwguideNode
.addsubnode(WGScanNode
.addsubnode(FPdeviceNode
.newtaper(
.newwglens(
.newsjoint(
.newstraightridge(
.newtaperridge(
.newsinridge(
.newtwinridge(
What to do?
Every time you see one of these commands being used, check that all the parameters
mentioned above are being specified in the script.

Case E: a script selects an external file using a relative path that is set with respect
to the work directory; the work directory is now automatically set to the project
directory.

What is the issue?


In version 5.3.9, the user had the possibility of setting the work directory (in the
command line) to a different folder from the project directory. This could lead to
issues when the folders were moved on a computer, so now all the external files need
to be set either with an absolute path or with a path relative to the project directory.
How can I identify it?
You can look for the string
app.setwdir(
in your script in order to identify the situations where changes might be needed.
Otherwise if an external file cannot be found, FIMMWAVE will return an error.
What to do?
If you are setting a path relative to the work directory, change it so that it is set with
respect to the directory of the project. Otherwise, use an absolute path.

You might also like