Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
81bad82
First draft of the skycleaver implementation
vivekvenkris Aug 22, 2024
efeffb7
Change source name and position from default values in header
vivekvenkris Aug 22, 2024
63c854b
seek to the correct timestamp
vivekvenkris Sep 3, 2024
0201f7e
use uint8 for filterbank output
vivekvenkris Sep 4, 2024
331c1cf
Correct frequency tagging of tdb outputs
vivekvenkris Sep 4, 2024
5dc0bf4
swap beam and dm loops, convert signed to unsigned by rescaling data
vivekvenkris Sep 4, 2024
ccc6ebb
Merge commit '218f424562ce85a08af871551ef01183a00f91e0' into skycleaver
vivekvenkris Sep 4, 2024
a823587
add has key, get_or_default methods to header
vivekvenkris Sep 11, 2024
e14fc64
get-> get_or_default for few keys
vivekvenkris Sep 11, 2024
4f72d08
add basefilename to multifilewriterconfig and change it as needed in …
vivekvenkris Sep 11, 2024
36b1271
reuse bytes_seeking
vivekvenkris Sep 11, 2024
b36cb9f
reflect file writer callback changes in tester
vivekvenkris Sep 11, 2024
4826368
fix paths and filenames
vivekvenkris Sep 19, 2024
4aec59b
check for both OBS_FREQ & OBS_FREQUENCY
vivekvenkris Sep 19, 2024
2462dad
proper naming, more header parameters to read from dada files
vivekvenkris Sep 20, 2024
c55bf3c
get mjd_start from utc_offset
vivekvenkris Sep 20, 2024
819ee96
fix snake naming bug
vivekvenkris Sep 23, 2024
63b85f8
actually fix snake naming bug
vivekvenkris Sep 23, 2024
510fc01
use long double for times, incorporate downstream changes for half ch…
vivekvenkris Sep 25, 2024
4ae82ab
fixed formatting on MultiFileWriter.cuh
Sep 26, 2024
2787d00
formatting
Sep 26, 2024
6a33108
Add .tmp suffix to output filenames, and remove it when they are closed.
coclar Sep 26, 2024
bbd9fd1
Merge pull request #21 from hefehr/temporary_filenames
ewanbarr Sep 27, 2024
456719a
cleave only required samples
vivekvenkris Sep 30, 2024
48adc14
cleave only required dms and beams, code review changes
vivekvenkris Oct 2, 2024
0cfe1f9
seek to start sample after dedisp delay correction
vivekvenkris Oct 3, 2024
ee35ae2
CDD all data including overlap
vivekvenkris Oct 3, 2024
52b1ab3
fix FFT shift, change left over gulps -> fft_size where appropriate
vivekvenkris Oct 7, 2024
4bf4df1
Make skycleaver a CPP application
vivekvenkris Oct 11, 2024
70647a9
correctly set frequencies for described vectors, CDD, IDD
vivekvenkris Oct 11, 2024
0dde728
Added multiple tiling plot code, targets file, mosaic command file, p…
vishnubk Oct 21, 2024
5ca8add
removed unused class
vishnubk Oct 21, 2024
8fbb204
changed python delay creation code to plot, even if no known beams ar…
vishnubk Nov 6, 2024
0595fa9
Remove .bdm.db files and update .gitignore
vishnubk Nov 6, 2024
00fa137
typo fixes in include flags, migration from cuh to hpp
vishnubk Nov 6, 2024
4b06cb3
More compact implementation of tdb output spitting
coclar Nov 12, 2024
e697b31
minor merge changes
vivekvenkris Nov 25, 2024
a1a2c94
get header values from header instead of user
vivekvenkris Nov 26, 2024
cbaf03b
dirty pass on scaling change
Nov 28, 2024
820efb9
compiling now and beamformer tests running
Nov 28, 2024
49c966a
linear pol output and actual beam positions in skycleaver
vivekvenkris Dec 12, 2024
ff71497
fix filename convention
vivekvenkris Dec 12, 2024
45964ca
draft documentation
vivekvenkris Dec 17, 2024
8610cab
Revert "compiling now and beamformer tests running"
vivekvenkris Dec 22, 2024
112a857
Revert "dirty pass on scaling change"
vivekvenkris Dec 22, 2024
13047bb
segregate filterbanks in beam directories
vivekvenkris Jan 2, 2025
7ef868c
Fix to incoherent de-dispersion pipeline header
coclar Jan 27, 2025
a8d9dad
Merge branch 'skycleaver' into tdb_output_splitting2
coclar Jan 27, 2025
29021ad
Add beam index to output dada headers
coclar Jan 27, 2025
4937a65
Fixing incorrect indices when splitting tdb stream into multiple files
coclar Jan 28, 2025
6572ec1
Slightly clearer indexing when splitting tdb files by beam
coclar Jan 28, 2025
4f15b64
Fix for incorrect S-band frequencies being reported in filenames due …
coclar Jan 29, 2025
fbb980b
Merge pull request #24 from hefehr/filename_freq_fix
ewanbarr Jan 29, 2025
cac3883
Use std::copy when splitting output buffers by beam
coclar Feb 5, 2025
f2759e6
Fix bug with beam0_idx being uninitialised for IB
coclar Feb 5, 2025
d57409c
TDB output splitting now works if beams do not divide evenly between …
coclar Feb 5, 2025
61644a4
dashes instead of underscores in nbeams-per-file cmdline argument, fo…
coclar Feb 5, 2025
03b92c5
Fix for integer overflow in SkyCleaver while computing expected bridg…
coclar Feb 13, 2025
4242cf9
Added command-line option for computing/outputing voltage statistics
coclar Feb 20, 2025
6675ae6
Added command-line option to disable writing the incoherent beam
coclar Feb 20, 2025
3b6530b
Fix issue with SkyCleaver where tdb files were not being read in time…
coclar Feb 27, 2025
ab6b13e
Merge pull request #26 from hefehr/optional_outputs
ewanbarr Mar 5, 2025
0d8e6aa
Merge pull request #25 from hefehr/skycleaver_freq_fix
ewanbarr Mar 5, 2025
77d5c6e
Switch order of TDB output streams (loop first over coherent DMs, the…
coclar Mar 5, 2025
da9cea3
Prototype fix for threading of CB handler (UNTESTED)
Apr 10, 2025
20df23e
missed file in initial commit
Apr 10, 2025
cce61f9
added missing capture on thread lambda
Apr 10, 2025
e300fd3
removed ThreadWrapper as order of construction destruction for unique…
Apr 10, 2025
c1bcd19
removed ThreadWrapper as order of construction destruction for unique…
Apr 10, 2025
155abee
Merge branch 'skycleaver' into tdb_output_splitting2
coclar May 5, 2025
45b35de
Fix missing comma in PipelineConfig.cpp
coclar May 5, 2025
60c441f
Merge pull request #27 from hefehr/skycleaver_tdb_order_fix
ewanbarr Nov 20, 2025
3183229
Merge pull request #28 from erc-compact/threaded_CB_handler
ewanbarr Nov 20, 2025
ba3c4cd
Added filter feature to tiling generator
Nov 24, 2025
ed85a1f
Merge branch 'skycleaver' of https://github.com/erc-compact/skyweaver…
Nov 24, 2025
7ec10a0
added code to split the delay models adn targets by beam set
Nov 28, 2025
30734b6
Merge pull request #23 from hefehr/tdb_output_splitting2
vivekvenkris Dec 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ eggs/
core*
report*
CMakeCache.txt
.nextflow
*.bdm.db

4 changes: 2 additions & 2 deletions Dockerfile.skyweavercpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ WORKDIR /usr/src/skyweaver
COPY . .
RUN cmake -S . -B build/ -DARCH=native -DPSRDADA_INCLUDE_DIR=/usr/local/include/psrdada \
-DPSRDADACPP_INCLUDE_DIR=/usr/local/include/psrdada_cpp -DSKYWEAVER_NANTENNAS=64 \
-DSKYWEAVER_NBEAMS=128 -DSKYWEAVER_NCHANS=64 -DSKYWEAVER_IB_SUBTRACTION=1 -DBUILD_SUBMODULES=1 \
-DENABLE_TESTING=1 -DENABLE_BENCHMARK=1 &&\
-DSKYWEAVER_NBEAMS=800 -DSKYWEAVER_NCHANS=64 -DSKYWEAVER_IB_SUBTRACTION=1 -DBUILD_SUBMODULES=1 \
-DENABLE_TESTING=1 -DENABLE_BENCHMARK=1 -DSKYWEAVER_CB_TSCRUNCH=4 -DSKYWEAVER_IB_TSCRUNCH=4 -DSKYWEAVER_CB_FSCRUNCH=1 -DSKYWEAVER_IB_FSCRUNCH=1 &&\
make -C build/ -j 16 && make -C build/ install

3 changes: 2 additions & 1 deletion Dockerfile.skyweaverpy
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ RUN apt-get update && apt-get install -y \

# Install Python dependencies
RUN pip install --upgrade pip && \
pip install pytest
pip install pytest && \
pip install pandas


# Copy the rest of your application code into the container
Expand Down
175 changes: 175 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,177 @@
# skyweaver
Implementation of an offline FBFUSE beamformer for the MeerKAT telescope

# Installation

It is easiest to use the software inside a Docker container. Two dockerfiles is included part of this repository: To compile the c++ and python parts respectively.

# Usage

## Step 1: Get delays for the beamformer

### Start with the skyweaver python CLI

```bash
alias sw="python /path/to/python/skyweaver/cli.py"
sw --help
```
This will print:
```console
usage: skyweaver [-h] {metadata,delays} ...

positional arguments:
{metadata,delays} sub-command help
metadata Tools for observation metadata files
delays Tools for delay files

optional arguments:
-h, --help show this help message and exit
```

### Get the metadata for the corresponding observation

This is done outside this repository

### Obtain metadata information

```bash
sw metadata show <metadata_file>
```

This will produce an output like the following:
```console
sw metadata show bvrmetadata_2024-02-16T10\:50\:46_72275.hdf5
---------------Array configuration----------------
Nantennas: 57
Subarray: m000,m002,m003,m004,m005,m007,m008,m009,m010,m011,m012,m014,m015,m016,
m017,m018,m019,m020,m021,m022,m023,m024,m025,m026,m027,m029,m030,m031,
m032,m033,m034,m035,m036,m037,m038,m039,m040,m041,m042,m043,m044,m045,
m046,m048,m049,m050,m051,m053,m054,m056,m057,m058,m059,m060,m061,m062,
m063
Centre frequency: 1284000000.0 Hz
Bandwidth: 856000000.0 Hz
Nchannels: 4096
Sync epoch (UNIX): 1708039531.0
Project ID: -
Schedule block ID: -
CBF version: cbf_dev
--------------------Pointings---------------------
#0 J1644-4559 2024-02-16T11:16:08.957000000 until 2024-02-16T11:21:04.865000000 (UTC)
1708082168.957 until 1708082464.865 (UNIX)
72996182384029 until 73502776880016 (SAMPLE CLOCK)
#1 J1644-4559_Offset1 2024-02-16T11:21:22.092000000 until 2024-02-16T11:26:15.682000000 (UTC)
1708082482.092 until 1708082775.682 (UNIX)
73532269504013 until 74034895583866 (SAMPLE CLOCK)
#2 J1644-4559_Offset2 2024-02-16T11:26:34.536000000 until 2024-02-16T11:31:25.723000000 (UTC)
1708082794.536 until 1708083085.723 (UNIX)
74067173632022 until 74565685776084 (SAMPLE CLOCK)
#3 M28 2024-02-16T11:31:52.503000000 until 2024-02-16T12:01:51.651000000 (UTC)
1708083112.503 until 1708084911.651 (UNIX)
74611533136035 until 77691674512039 (SAMPLE CLOCK)
#4 J0437-4715 2024-02-16T12:03:06.117000000 until 2024-02-16T12:08:04.364000000 (UTC)
1708084986.117 until 1708085284.364 (UNIX)
77819160304176 until 78329759168140 (SAMPLE CLOCK)
```

### Create a config file in .yml format
Here is an example - there are comments to explain each parameter.

```.yml
created_by: Vivek
beamformer_config:
# The total number of beams to be produced (must be a multiple of 32). This needs to be <= the number that SKYWEAVER is compiled for.
total_nbeams: 800
# The number of time samples that will be accumulated after detection, inside the beamformer
tscrunch: 4
# The number of frequency channels that will be accumulated after detection, inside the beamformer
# Will be coerced to 1 if coherent dedispersion is specified.
fscrunch: 1
# The Stokes product to be calculated in the beamformer (I=0, Q=1, U=2, V=3)
stokes_mode: 0
# Enable CB-IB subtraction in the beamformer
subtract_ib: True

# Dispersion measure for coherent / incoherent dedispersion in pc cm^-3
# A dispersion plan definition string "
# "(<coherent_dm>:<start_incoherent_dm>:<end_incoherent_dm>:<dm_step>:<tscrunch>) or "
# "(<coherent_dm>:<tscrunch>) "
# "or (<coherent_dm>)")
# Each DD plan is a "Stream" with zero indexed stream-ids

ddplan:
- "478.6:478.6:478.6:1:1" #stream-id=0
- "0.00:478.6:478.6:1:1" #stream-id=1

# every beamset can contain arbitrary set of antennas, corresponding targeted beams, and tiled beams
# total number of beams across all beamsets should be <= the number of beams that SKYWEAVER is compiled for.
beam_sets:

- antenna_set: ['m000','m002','m003','m004','m005','m007','m008','m009','m010','m011',
'm012','m014','m015','m016','m017','m018','m019','m020','m021','m022',
'm023','m024','m025','m026','m027','m029','m030','m031','m032','m033',
'm034','m035','m036','m037','m038','m039','m040','m041','m042','m043',
'm044','m045','m046','m048','m049','m050','m051','m053','m054','m056',
'm057','m058','m059','m060','m061','m062','m063']
beams: []
tilings:
- nbeams: 32
reference_frequency: null
target: "J1644-4559,radec,16:44:49.273,-45:59:09.71"
overlap: 0.9
```



### Create delay file for the corresponding pointing

```bash
sw delays create --pointing-idx 0 --outfile J1644-4559_pointing_0.delays --step 4 bvrmetadata_2024-02-16T10\:50\:46_72275.hdf5 J1644-4559_boresight.yaml
```

This produces a `.delays` file used for beamforming, and a `.targets` file that contains beam metadata. There are also other files produced here for reproducibility and for visualisation.

## Step 2: Initialise input and compile skyweaver

### Create a list of dada files that correspond to the pointing

```console
ls /b/u/vivek/00_DADA_FILES/J1644-4559/2024-02-16-11\:16\:08/L/48/*dada -1 > /bscratch/vivek/skyweaver_tests/J1644-4559_boresight_dadafiles.list
```

### Compile skyweaver

This is done inside the dockerfile too. Either edit that to produce a docker image that has the software precompiled, or compile separately.

```bash
cmake -S . -B $cmake_tmp_dir -DENABLE_TESTING=0 -DCMAKE_INSTALL_PREFIX=$install_dir -DARCH=native -DPSRDADA_INCLUDE_DIR=/usr/local/include/psrdada -DPSRDADACPP_INCLUDE_DIR=/usr/local/include/psrdada_cpp -DSKYWEAVER_NANTENNAS=64 -DSKYWEAVER_NBEAMS=${nbeams} -DSKYWEAVER_NCHANS=64 -DSKYWEAVER_IB_SUBTRACTION=1 -DCMAKE_BUILD_TYPE=RELEASE -DSKYWEAVER_CB_TSCRUNCH=${tscrunch} -DSKYWEAVER_IB_TSCRUNCH=${tscrunch};
cd $cmake_tmp_dir
make -j 16
```
This compilation produces two binaries: `skyweavercpp` and `skycleaver`
## Step 3: Run the beamformer

```bash

/path/to/skyweavercpp --input-file J1644-4559_boresight_dadafiles.list --delay-file J1644-4559_pointing_0.delays --output-dir=/bscratch/vivek/skyweaver_out --gulp-size=32768 --log-level=warning --output-level=12 --stokes-mode I
```

Change the output level to 7 for bright pulsars like J1644-4559.

This will produce `.tdb` files for the corresponding bridge. Run Step 3 for ALL 64 bridges with their corresponding dada file lists. These are DADA format files with the dimensions of TIME, INCOHERENT DM and BEAM as the order. For stokes I mode, The datatype is `int8_t`. For IQUV it is `char4`.

## Steo 4: Cleave all bridges to form Filterbanks

Here we cleave the 64 TDB[I/Q/U/V/IV/QU/IQUV] files to produce `NDM*NBEAMS*NSTOKES` number of T(F=64) files.

to run this, do

```bash

/path/to/skycleaver -r /bscratch/vivek/skyweaver_out --output-dir /bscratch/vivek/skycleaver_out --nsamples-per-block 65536 --nthreads 32 --stream-id 0 --targets_file/bscratch/vivek/skyweaver_out/swdlays_J1644-4559.targets --out-stokes I --required_beams 0

```

This will produce a standard sigproc format `.fil` file that can be used for traditional processing.



2 changes: 2 additions & 0 deletions cmake/compiler_settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RELEASE")
endif ()

#set(CMAKE_VERBOSE_MAKEFILE 1)
set (CMAKE_CXX_STANDARD 20)
# Set compiler flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fopenmp")

Expand Down
4 changes: 3 additions & 1 deletion cpp/skyweaver/BeamformerPipeline.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "skyweaver/WeightsManager.cuh"

#include <functional>
#include <thread>

namespace skyweaver
{
Expand Down Expand Up @@ -79,6 +80,7 @@ class BeamformerPipeline

// Handlers
CBHandler& _cb_handler;
std::unique_ptr<std::thread> _cb_handler_thread;
IBHandler& _ib_handler;
StatsHandler& _stats_handler;

Expand All @@ -101,7 +103,7 @@ class BeamformerPipeline
TAFTPVoltagesD<char2> _taftp_from_host;
FTPAVoltagesD<char2> _ftpa_post_transpose;
FTPAVoltagesD<char2> _ftpa_dedispersed;
TFBPowersD<typename BeamformerTraits::QuantisedPowerType> _btf_cbs;
DoubleDescribedVector<TFBPowersD<typename BeamformerTraits::QuantisedPowerType>> _btf_cbs;
BTFPowersD<typename BeamformerTraits::RawPowerType> _tf_ib_raw;
BTFPowersD<typename BeamformerTraits::QuantisedPowerType> _tf_ib;

Expand Down
15 changes: 14 additions & 1 deletion cpp/skyweaver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ set(skyweaver_src
src/Timer.cpp
src/Transposer.cu
src/WeightsManager.cu
src/SigprocHeader.cpp

)

set(skyweaver_inc
Expand All @@ -38,6 +40,10 @@ set(skyweaver_inc
Timer.hpp
Transposer.cuh
WeightsManager.cuh
MultiFileWriter.cuh
SigprocHeader.hpp
SkyCleaver.hpp
SkyCleaverConfig.hpp
)

set(SKYWEAVER_LIBRARIES ${CMAKE_PROJECT_NAME} ${DEPENDENCY_LIBRARIES})
Expand Down Expand Up @@ -106,6 +112,13 @@ target_link_libraries(skyweavercpp
OpenMP::OpenMP_CXX)
install(TARGETS skyweavercpp DESTINATION bin)

add_executable(skycleaver src/skycleaver_cli.cpp)
target_link_libraries(skycleaver
${SKYWEAVER_LIBRARIES}
${DEPENDENCY_LIBRARIES}
OpenMP::OpenMP_CXX)
install(TARGETS skycleaver DESTINATION bin)

#install (TARGETS ... DESTINATION bin)
#install (TARGETS ${CMAKE_PROJECT_NAME}
# RUNTIME DESTINATION bin
Expand All @@ -126,4 +139,4 @@ if(ENABLE_BENCHMARK)
COMMAND beamformer_bench --benchmark_counters_tabular=true
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(benchmark)
endif()
endif()
Loading