Skip to main content

Facet-based radio astronomy continuum imager

Project description

A facet-based radio imaging package

Copyright (C) 2013-2024 Cyril Tasse, l’Observatoire de Paris, SKA South Africa, South African Radio Astronomy Observatory, Rhodes University

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

(Users / PyPI alternative) Virtual environment and pip:

We prefer that users use DDFacet though Docker. However, if this is not available (e.g. cluster environments) we recommend you use a virtual environment. If you install it directly into your system packages you’re on your own – be warned!!

WARNING: you may encounter issues if you have previously installed numpy in the environment - build isolation will fail if the numpy you have installed is older than the build system pulls during isolation. You may need to use –no-build-isolation when installing or, even better, ensure that you install DDF and KillMS in an empty new virtual environment.

  1. Install each of the debian dependencies. The latest full list of apt dependencies can be be found in the Dockerfile <https://github.com/saopicc/DDFacet/blob/master/docker.2204>

  2. Create a virtual environment somewhere on your system and activate:

    virtualenv ddfacet
    source ddfacet/bin/activate
  3. Then, install directly from the Python Package Index (PyPI) using pip - ensure your venv is activated:

    pip install -U pip
    pip install DDFacet
  1. When you’re done with your imaging business:

    deactivate

(Users/Optional) FitsBeam, Montblanc, Moresane, Killms support

Optional requirements like the FITS beam can be installed by specifying them in brackets. E.g. pip install “/src/DDFacet/[dft-support,moresane-support,testing-requirements,fits-beam-support,kms-support]”

(Users/Troubleshooting) Configure max shared memory

Running DDFacet on large images requires a lot of shared memory. Most systems limit the amount of shared memory to about 10%. To increase this limit add the following line to your /etc/default/tmpfs file:

SHM_SIZE=100%

A restart will be required for this change to reflect. If you would prefer a once off solution execute the following line:

sudo mount -o remount,size=100% /run/shm

It may also be necessary to run the following to remove the kernel security limit on mlock pinning. Without this things may be slower than usual:

echo "*        -   memlock     unlimited" > /etc/security/limits.conf

(Developers/Note): Architecture dependent binary

The default build system configuration DOES NOT produce portable binaries at the cost of a slight improvement in runtime. You have to modify pyproject.toml and set the following line before compiling packages:

` cmake.define = {ENABLE_NATIVE_TUNING = "ON", ENABLE_FAST_MATH = "ON", ENABLE_PYTHON_2 = "OFF", ENABLE_PYTHON_3 = "ON"} `

(Developers/Testing) Docker-based build

  1. Simply pull the latest DDFacet and build the Docker image:

    git clone git@github.com:cyriltasse/DDFacet.git
    cd DDFacet
    docker build -t ddf -f docker.2204 .
  2. You should now be able to run DDFacet in a container. Note that your parsets must have filenames relative to the mounted volume inside the container, for instance:

    docker run --shm-size 6g -v /scratch/TEST_DATA:/mnt ddf /mnt/test-master1.parset

Important: if you ran ``git submodule update –init –recursive`` before you may need to remove the cached SkyModel before building the docker image with ``git rm –cached SkyModel``

(Developers/Debugging) Build a few libraries (by hand with custom flags)

You can build against custom versions of libraries such is libPython and custom numpy versions. To do this modify pyproject.toml. Find and modify the following lines:: ` cmake.build-type = "ReleaseWithDebugSymbols" # can be set to Debug e.g. cmake.define = {ENABLE_NATIVE_TUNING = "OFF", ENABLE_FAST_MATH = "ON", ENABLE_PYTHON_2 = "OFF", ENABLE_PYTHON_3 = "ON"} # can be tuned to enable processor specific marching ` You can also specify path settings for other libraries if you have custom built, e.g. numpy through these `cmake.define`

(Developers/Acceptance tests)

Paths

Add this to your .bashrc:

export DDFACET_TEST_DATA_DIR=[folder where you keep the acceptance test data and images]
export DDFACET_TEST_OUTPUT_DIR=[folder where you want the acceptance test output to be dumped]

To test your branch against the master branch using Jenkins

Most of the core use cases will in the nearby future have reference images and an automated acceptance test.

Please do not commit against cyriltasse/master. The correct strategy is to branch/fork and do a pull request on Github to merge changes into master. Once you opened a pull request add the following comment: “ok to test”. This will let the Jenkins server know to start testing. You should see that the pull request and commit statusses shows “Pending”. If the test succeeds you should see “All checks have passed” above the green merge button. Once the code is reviewed it will be merged into the master branch.

To run the tests on your local machine:

You can run the automated tests by grabbing the latest set of measurements and reference images from the web and extracting them to the directory you set up in your DDFACET_TEST_DATA_DIR environment variable. You can run the automated tests by navigating to your DDFacet directory and running nosetests.

Each of the test cases is labeled by a class name and has reference images and a parset file with the same name, ie. if the test case that has failed is called “TestWidefieldDirty” the reference images will be called the same. You should investigate the reason for any severe discrepancies between the output of the test case and the images produced by your changed codebase. See the docstring at the top of the class ClassCompareFITSImage for help and filename conventions.

Acceptance test data can be found on the Jenkins server in the /var/lib/jenkins/test-data directory.

Adding more tests and creating new reference images.

To resimulate images and add more tests:

In the Jenkins server data directory add a recipe to the makefile simulate and/or set up new reference images. This should only be done with the origin/master branch - not your branch or fork! Use the ddfacet-generate-refims task to do this. You should manually verify that all the reference images are correct when you regenerate them. Each time you add a new option to DDFacet also add an option to the makefile in this directory. Once the option is set up in the makefile you can build the reference images on Jenkins.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ddfacet-0.8.0.0.tar.gz (803.2 kB view details)

Uploaded Source

File details

Details for the file ddfacet-0.8.0.0.tar.gz.

File metadata

  • Download URL: ddfacet-0.8.0.0.tar.gz
  • Upload date:
  • Size: 803.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.13

File hashes

Hashes for ddfacet-0.8.0.0.tar.gz
Algorithm Hash digest
SHA256 795c1b392fa1112917f41dfff291f9b7e001173f995d1091aff2fc6a4083ef22
MD5 a84302b4eeda1145e506382f7532966d
BLAKE2b-256 c7ad68f404daef95ee36ca8439ad4bf1859bc11c077c8d3cd86c42986017dfa7

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page