e2lambda, lambda2e

 
class e2lambda(Macro):
    """ returns the wavelength [Angstr.]: 12398.424/energy"""
    param_def = [ 
        ['energy',  Type.Float,  None, 'Energy[eV]'],
        ]

    def run(self,  energy):
        wavelength = 12398.424/energy
        self.output( "Lambda: %g" % wavelength)

class lambda2e(Macro):
    """ returns the energy [eV]: 12398.424/wavelength"""
    param_def = [ 
        ['wavelength',  Type.Float,  None, 'Wavelength[Angstr.]'],
        ]

    def run(self,  wavelength):
        energy = 12398.424/wavelength
        self.output( "Energy: %g" % energy)



2019-11-13