pemtk.fit._util

Module Contents

Functions

setClassArgs(self, args)

lmmuListStrReformat(lmmuList)

Convert list of tuple labels to short str format

_setDefaultFits(self, dataRange)

_getFitInds(self)

Get fitInds = all numerical fit indexes, and fitInd = fitInds.max()

addColLevel(df[, newCol, names])

Add top-level column to Pandas dataframe (crude)

renameParams(data, mapDict[, mapNames, mapType])

Very basic column name reampper for Pandas DataFrame. Based on routine in SymHarm class.

renormMagnitudes(dfWide)

Basic renormalisation of magnitudes so sum(mags**2) = 1

phaseCorrection(dfWide[, dfRef, refParam, wrapFlag, ...])

Phase correction/shift/wrap function.

pemtk.fit._util.setClassArgs(self, args)[source]
pemtk.fit._util.lmmuListStrReformat(lmmuList)[source]

Convert list of tuple labels to short str format

pemtk.fit._util._setDefaultFits(self, dataRange)[source]
pemtk.fit._util._getFitInds(self)[source]

Get fitInds = all numerical fit indexes, and fitInd = fitInds.max()

pemtk.fit._util.addColLevel(df, newCol='ref', names=['Dataset', 'Type'])[source]

Add top-level column to Pandas dataframe (crude)

pemtk.fit._util.renameParams(data, mapDict, mapNames=['lm'], mapType='col')[source]

Very basic column name reampper for Pandas DataFrame. Based on routine in SymHarm class.

21/04/22 v1 for testing only.

TODO: generalise this & consolidate!

See also value remapping in paramPlot() routine, runs data.replace({‘Param’:self.lmmu[remap]}, inplace=True)

pemtk.fit._util.renormMagnitudes(dfWide)[source]

Basic renormalisation of magnitudes so sum(mags**2) = 1

Prototype from test code:

  • Assumes full Pandas tabulated wide-form dataset as input.

  • Renormed values appended to input dataframe, as Type=n

TODO: implement dim preservation? Currently handled by calling fn., and assumes Type=m is present in index.

pemtk.fit._util.phaseCorrection(dfWide, dfRef=None, refParam=None, wrapFlag=True, phaseLabel='p', absFlag=False)[source]

Phase correction/shift/wrap function.

Prototype from test code:

  • Assumes full Pandas tabulated wide-form dataset as input.

  • Supply dfRef to use reference phase (abs phase values), otherwise will be relative with refParam set to zero.

  • wrapFlag: wrap to -pi:pi range? Default True.

  • absFlag: set abs values (drop signs)? Default False, otherwise sets all values to abs().

TODO: implement dim preservation? Currently handled by calling fn., and returned values will have Type dim dropped here.

Setting “drop_level=False” to xs() would fix this. Stated to implement, but skipped for now.