Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

LSMTool: the LOFAR Sky Model Tool

LSMTool allows the manipulation of LOFAR sky models (in the makesourcedb format).


  • David Rafferty

Based on contributed scripts by:

  • Björn Adebahr
  • Francesco de Gasperin
  • Reinout van Weeren


  • docs/: documentation
  • tests/: contains test sky models and scripts useful for validation
  • bin/: contains lsmtool executable
  • lsmtool/: contains the main LSMTool scripts
  • lsmtool/operations/: contains the modules for operations
  • parsets/: some example parsets

The following operations are available:

  • SELECT: Select sources by source or patch properties
  • REMOVE: Remove sources by source or patch properties
  • TRANSFER: Transfer a patch scheme from one sky model to another
  • GROUP: Group sources into patches
  • UNGROUP: Remove patches
  • MOVE: Move a source or patch position
  • MERGE: Merge two or more patches into one
  • CONCATENATE: Concatenate two sky models
  • ADD: Add a source
  • SETPATCHPOSITIONS: Calculate and set patch positions
  • PLOT: Plot the sky model
  • COMPARE: Compare source fluxes and positions of two sky models

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.


Downloading and Installing

Get the latest developer version by cloning the git repository:

git clone

Then install with:

cd LSMTool
python install

If you have a C++11-compliant compiler, you can build a faster version of the mean shift grouping algorithm with:

cd LSMTool
python 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 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 lsmtool.parset

The parset follows the usual NDPPP/BBS format. E.g.:

# Select individual sources with Stokes I fluxes above 1 Jy = SELECT = I > 1.0 Jy =

LSMTool can also be used in Python scripts by importing the lsmtool module. E.g.:

>>> import lsmtool
>>> skymod = lsmtool.load('')
>>>'I > 1.0 Jy')
>>> skymod.write('')

For further details, please see the full documentation.

You can’t perform that action at this time.