Skip to main content

LSMTool: the LOFAR Sky Model Tool

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

Author:

  • David Rafferty

Based on contributed scripts by:

  • Bjoern Adebahr
  • Francesco de Gasperin
  • Reinout van Weeren

Contents:

  • 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.

Dependencies

LSMTool depends on the following packages:

These packages will normally be installed automatically.

Downloading and Installing

LSMTool uses PyBDSF as default source finder. If you wish, you can use SoFiA-2 instead, which can be installed as extra.

Install the latest release from PyPI

    pip install lsmtool

or with SoFiA-2 as extra:

    pip install lsmtool[sofia]

Install the latest developer version

    pip install git+https://git.astron.nl/RD/LSMTool.git

or with SoFiA-2 as extra:

    pip install lsmtool[sofia] git+https://git.astron.nl/RD/LSMTool.git

Install a faster mean-shift grouping algorithm

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
    sed -Ei 's/^(BUILD_EXTENSIONS = ).*/\1"ON"/' pyproject.toml
    pip install .

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.

Testing

If you've cloned the repository, and installed the software from source, you can test that the installation works as expected:

    pip install pytest
    pytest

If no errors occur, LSMTool is installed correctly.

Usage

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.

Release files for lsmtool 1.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lsmtool 1.9.0
File Size Uploaded
lsmtool-1.9.0.tar.gz 7.9 MB Details

Release files / lsmtool-1.9.0.tar.gz

Download URL lsmtool-1.9.0.tar.gz
Size 7.9 MB
Tags Source
SHA-256 checksum
How to use checksums
281243b0f82263ca7bf5332728c84813da46ce85fa1a6a510d6597f762eb4d10
BLAKE2b-256 checksum
How to use checksums
d6321ea25d83023aaf29a1730fb6a2cd4734b026f9803f5dd7e5f74355f5de3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

This release

1.9.0 This release

1 release file

1.8.0

1 release file

1.7.1

1 release file

1.7.0

1 release file

1.6.2

1 release file

1.6.1

1 release file

1.6

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.11

1 release file

1.4.10

1 release file

1.4.9

1 release file

1.4.8

1 release file

1.4.7

1 release file

1.4.6

1 release file

1.4.5

1 release file

1.4.4

1 release file

1.4.3

1 release file

1.4.2

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page