Closed physicistsam closed 3 months ago
Hmm, indeed it seems that it's ignoring your input frequencies for some reason. I'll try to understand why this is happening.
Regarding the beam_spectrum
option, the documentation is rather misleading, as it turns out that this option is only used by the spectral index module. I think you can work around this limitation by specifying the beam using the beam
option and giving it the beam of the channel you want to use for source detection (so the second channel). This method might also work for the frequency (use the frequency
option to set it that of the second channel).
The issue with frequency_sp
being ignored should now be fixed on the master branch. I've also added a note to the docs about the use of beam_spectrum
. Please reopen this issue if you're still having problems.
Thanks for the help. However when I try to install the mater branch using
pip install git+https://github.com/lofar-astron/PyBDSF.git
I am getting following error:
Building wheel for bdsf (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for bdsf (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [114 lines of output]
--------------------------------------------------------------------------------
-- Trying 'Ninja' generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /tmp/pip-req-build-2y1ehlp1/_cmake_test_compile/build
--
-------
------------
-----------------
----------------------
---------------------------
--------------------------------
-- Trying 'Ninja' generator - success
--------------------------------------------------------------------------------
Configuring Project
Working directory:
/tmp/pip-req-build-2y1ehlp1/_skbuild/linux-x86_64-3.10/cmake-build
Command:
/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/cmake/data/bin/cmake /tmp/pip-req-build-2y1ehlp1 -G Ninja -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/ninja/data/bin/ninja --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-req-build-2y1ehlp1/_skbuild/linux-x86_64-3.10/cmake-install -DPYTHON_VERSION_STRING:STRING=3.10.4 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/myPATH/bin/python -DPYTHON_INCLUDE_DIR:PATH=/software/common/python/3.10.4/include/python3.10 -DPYTHON_LIBRARY:PATH=/software/common/python/3.10.4/lib/libpython3.10.a -DPython_EXECUTABLE:PATH=/myPATH/bin/python -DPython_ROOT_DIR:PATH=/myPATH -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/software/common/python/3.10.4/include/python3.10 -DPython_NumPy_INCLUDE_DIRS:PATH=/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/myPATH/bin/python -DPython3_ROOT_DIR:PATH=/myPATH -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/software/common/python/3.10.4/include/python3.10 -DPython3_NumPy_INCLUDE_DIRS:PATH=/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/numpy/core/include -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/ninja/data/bin/ninja -DCMAKE_BUILD_TYPE:STRING=Release
Not searching for unused variables given on the command line.
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- The Fortran compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/gfortran - skipped
CMake Warning (dev) at /tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/skbuild/resources/cmake/FindPythonExtensions.cmake:245 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
CMakeLists.txt:4 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found PythonInterp: /myPATH/bin/python (found version "3.10.4")
CMake Warning (dev) at /tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/skbuild/resources/cmake/FindPythonExtensions.cmake:252 (find_package):
Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules
are removed. Run "cmake --help-policy CMP0148" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
CMakeLists.txt:4 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found PythonLibs: /software/common/python/3.10.4/lib/libpython3.10.a (found version "3.10.4")
-- Found Python: /myPATH/bin/python (found version "3.10.4") found components: Interpreter Development.Module
-- Found F2PY: /tmp/pip-build-env-vg5tsljv/overlay/bin/f2py3 (found version "1.21.6")
CMake Error at /tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/cmake/data/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost (missing: Boost_INCLUDE_DIR python numpy)
Call Stack (most recent call first):
/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/cmake/data/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/cmake/data/share/cmake-3.28/Modules/FindBoost.cmake:2393 (find_package_handle_standard_args)
CMakeLists.txt:7 (find_package)
-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
File "/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/skbuild/setuptools_wrap.py", line 666, in setup
env = cmkr.configure(
File "/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/skbuild/cmaker.py", line 357, in configure
raise SKBuildError(msg)
An error occurred while configuring with CMake.
Command:
/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/cmake/data/bin/cmake /tmp/pip-req-build-2y1ehlp1 -G Ninja -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/ninja/data/bin/ninja --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=/tmp/pip-req-build-2y1ehlp1/_skbuild/linux-x86_64-3.10/cmake-install -DPYTHON_VERSION_STRING:STRING=3.10.4 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/myPATH/bin/python -DPYTHON_INCLUDE_DIR:PATH=/software/common/python/3.10.4/include/python3.10 -DPYTHON_LIBRARY:PATH=/software/common/python/3.10.4/lib/libpython3.10.a -DPython_EXECUTABLE:PATH=/myPATH/bin/python -DPython_ROOT_DIR:PATH=/myPATH -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/software/common/python/3.10.4/include/python3.10 -DPython_NumPy_INCLUDE_DIRS:PATH=/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/numpy/core/include -DPython3_EXECUTABLE:PATH=/myPATH/bin/python -DPython3_ROOT_DIR:PATH=/myPATH -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/software/common/python/3.10.4/include/python3.10 -DPython3_NumPy_INCLUDE_DIRS:PATH=/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/numpy/core/include -DCMAKE_MAKE_PROGRAM:FILEPATH=/tmp/pip-build-env-vg5tsljv/overlay/lib/python3.10/site-packages/ninja/data/bin/ninja -DCMAKE_BUILD_TYPE:STRING=Release
Source directory:
/tmp/pip-req-build-2y1ehlp1
Working directory:
/tmp/pip-req-build-2y1ehlp1/_skbuild/linux-x86_64-3.10/cmake-build
Please see CMake's output for more information.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for bdsf
Failed to build bdsf
ERROR: Could not build wheels for bdsf, which is required to install pyproject.toml-based projects
Standard relased version of pyBDSF is being installed using pip, without any issue. I think this has to do with the boost libraries. I am working in a cluster and virtual environment. Do you think I need to install them locally ?
Hmm, I'm not sure whether you need them locally. @gmloose do you happen to know?
To build the latest version, you need to build from source, which in this case fails because the package boost-python
is missing. If you download from pip, you probably get pre-built binary wheels so you do not have to compile from source. Could you mention on which operating system you are running (e.g. ubuntu 22.04, cat /etc/os-release
should tell you), and which python environment (which python
should tell you)?
OS: PRETTY_NAME="Ubuntu 22.04.3 LTS" Python environment is the virtual environment I made, ie /myPath/bin/python. Version is Python 3.10.4.
Thank you. Getting boost-python to work in a virtual-env may be challenging. Perhaps you can set up a virtualenv that uses the system python, and install libboost-python-dev
through apt. Alternatively, you could copy the changed python files from https://github.com/lofar-astron/PyBDSF/pull/219 into the pip-installed version of pybdsf in your virtual environment (overwriting the ones from the pip-version).
If you want to use master
, you have to build from source, and you need to install Boost.Python. Something like this is probably enough to get you going.
apt install libboost-python-dev
I think its a bit difficult to use apt
as I don't have root or sudo access.
In that case the 'hack' I suggested: download collapse.py , psf_vary.py , shapefit.py and overwrite the existing files in your virtualenv with their updated version
Let me try this "hack".
I tried the "hack" and it worked. Thanks !
This is a usage quarry rather than an issue. I am trying to perform source extraction using a fits cube, on each channel. The programme is as follows:
I expect it to perform source extration on the second channel (out of three), with frequency and the beam given by the array, or it should read the same from the FITS. However, when I see the .log file, it always quotes / mentions the frequency of the zeroth channel and beam that of the mean quoted in the FITS header (the beams for all the bands are also mentioned in the header). Even the rms files produced have the mean beam and zeroth channel frequency. May be I am doing something wrong her. Please let me know how to resolve this. The log file is as follows.
Please let me know if the question is not clear.