Skip to content

Use LoSoTo as python module

Francesco de Gasperin edited this page Dec 19, 2017 · 6 revisions

This is an example on how to use the operation "clip". Note that the parameters for the clip operation are the same one can select in the parset (note that in python they are case sensitive).

# first open a soltab
from losoto.h5parm import h5parm
H = h5parm('file.h5', readonly=False)
soltab = H.getSolset('solset000').getSoltab('soltab000')

# an even faster way is usign the convenience function "openSoltab"
from losoto.h5parm import openSoltab
soltab = openSoltab('file.h5', 'solset000', 'soltab000')
soltab = openSoltab('file.h5', address='solset000/soltab000') # equivalent

# then run an operation
from losoto.operations import clip
clip.run(soltab, axesToClip='amp')

Clone this wiki locally