LSMTool allows the manipulation of LOFAR sky models (in the makesourcedb format).
Author:
Based on contributed scripts by:
Contents:
The following operations are available:
For details, please see the full documentation.
LSMTool is already installed on the LOFAR CEP3 cluster. Users on CEP3 should run the following commands before using LSMTool:
source ~rafferty/init_lsmtool
If you want to install LSMTool yourself, follow the instructions below.
Install the latest release from PyPI:
pip install lsmtool
Or install the latest developer version from the git repository:
pip install git+https://git.astron.nl/RD/LSMTool.git
If you have a C++11-compliant compiler, you can build a faster version of the mean shift grouping algorithm by compiling it yourself:
git clone https://git.astron.nl/RD/LSMTool.git
cd LSMTool
python setup.py install --build_c_extentions
Note that the C++ version will give slightly different results compared to the Python version, but such differences are not expected to be important in practice.
You can test that the installation worked with:
python setup.py test
If no errors occur, LSMTool is installed correctly.
The LSMTool executable can be used from the command line with a parset that defines the steps to be done. E.g.:
$ lsmtool model.sky lsmtool.parset
The parset follows the usual DP3 format. E.g.:
# Select individual sources with Stokes I fluxes above 1 Jy
LSMTool.Steps.select.Operation = SELECT
LSMTool.Steps.select.FilterExpression = I > 1.0 Jy
LSMTool.Steps.select.OutFile = out_model.sky
LSMTool can also be used in Python scripts by importing the lsmtool module. E.g.:
>>> import lsmtool
>>> skymod = lsmtool.load('model.sky')
>>> skymod.select('I > 1.0 Jy')
>>> skymod.write('out_model.sky')
For further details, please see the full documentation.