demisjohn / pyFIMM

Python Interface to PhotonDesign's FimmWave/FimmProp software.
15 stars 4 forks source link

get/set_N() for WG/Circ #84

Open demisjohn opened 8 years ago

demisjohn commented 8 years ago

Added get/set_N() for Devices - for consistency should add the same for WG/Circ nodes.

Here's the code from Device.py:

def get_N(self,):
    '''Get max number of modes solved for in this Device.

    Returns
    -------
    N : int
        Number of modes, set as 'maxnmodes' in MOLAB parameters.
    '''
    return fimm.Exec( self.nodestring + ".mlp.maxnmodes")

def set_N(self, N):
    '''Set max number of modes to solve for in this Device.

    Parameters
    ----------
    N : int
        Max number of modes to solve for, set by `maxnmodes` in MOLAB parameters.
    '''
    fimm.Exec(   self.nodestring + ".mlp.maxnmodes " + str(int(N))   )