Skip to content

Auto knm handling

finesse importer requested to merge auto_knm into master

Given that there is a lot of boilerplate code for the Knm matrix calculations I have started trying to make a new workspace which reduces this. The aim is to have much of the Knm calculations generated automatically depending on the high level connection information.

Essentially this takes all optical-to-optical connections in an element and some additional information and just loops over the required functions as already written. This means any new component we make will automatically have all this handled, which reduces development time as well as the chance for copy-paste errors, which was rife in v2.

ConnectorWorkspaces will be able to inherit from KnmAutoConnectorWorkspace. There is then a method that is called on the Python front end when the workspace is generated which looks like:

                ws.set_knm_info(
                    "P1i_P2o",
                    abcd_x = ws.abcd_x,
                    abcd_y = ws.abcd_y,
                    nr1 = ws.nr1,
                    nr2 = ws.nr2,
                    is_transmission = True
                )
                ws.set_knm_info(
                    "P2i_P1o",
                    abcd_x = ws.abcd_x,
                    abcd_y = ws.abcd_y,
                    nr1 = ws.nr2,
                    nr2 = ws.nr1,
                    is_transmission = True
                )

More complex data can be specified here. Such as geometric scaling factors that need to be passed to Bayer-Helms.

I've not thought about it much, but I would assume we can meta data here about any maps that need to be used too. These extra Knms can then be automatically combined and then used for filling.

Edited by finesse importer

Merge request reports