Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporating skycleaver functionality to skyweaver #20

Open
wants to merge 52 commits into
base: pipeline_dev
Choose a base branch
from

Conversation

vivekvenkris
Copy link
Member

Skycleaver functionality that takes f number of .tdb files and produces d*b number of filterbank files. Currently only works for total intensity.

# Set compiler flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fopenmp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fopenmp -std=gnu++20")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ standard should be set in compiler_settings.cmake with

set (CMAKE_CXX_STANDARD 20)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed this and added set (CMAKE_CXX_STANDARD 20)

@@ -213,6 +230,12 @@ struct DescribedVector {
*/
auto const& operator[](std::size_t idx) const { return _vector[idx]; }


// also the at() method
auto& at(std::size_t idx) { return _vector[idx]; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What purpose does this serve?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is another function in std::vector that I tried to mimic here. Not required but good to have.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussion, we decided to keep this in.

: header_size(header_size), max_file_size(max_file_size),
stokes_mode(stokes_mode), output_dir(output_dir), prefix(prefix),
extension(extension), output_basename("") {};
MultiFileWriterConfig(MultiFileWriterConfig const& other)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for implementing these constructors? The class member variables are all either trivial types or types with RAII behaviour, so you shouldn't need to write custom copy constructors.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was originally not RAII, but now they are, but the constructors were left over. I will delete them.

stokes_mode(other.stokes_mode), output_dir(other.output_dir),
base_output_dir(other.base_output_dir), prefix(other.prefix),
extension(other.extension), output_basename(other.output_basename) {};
MultiFileWriterConfig& operator=(MultiFileWriterConfig const& other)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see previous comment

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

MultiFileWriter(PipelineConfig const& config,
std::string tag,
CreateStreamCallBackType create_stream_callback);
MultiFileWriter(MultiFileWriterConfig config,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this pass by value?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be const& or you will get a double copy

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can't be const as I will edit some values inside, but it can be pass by reference.

double fch1 = 0.0; // Centre frequency of the first channel
double foff = 0.0; // Frequency offset between channels

bool sigproc_params = false; // Whether to include sigproc parameters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used for control somewhere? It seems to only be on the to_string call for the header.

CreateStreamCallBackType create_stream_callback)
: _tag(tag), _create_stream_callback(create_stream_callback)
{
MultiFileWriterConfig writer_config;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do this rather than just writing the parameters on the _config? You already have a stack allocated instance.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Residual code from previous changes, will clean it up.

std::size_t end = 0;
while(end != std::string::npos) {
end = str.find(',', start);
values.push_back(std::stof(str.substr(start, end - start)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use some error handling, as the stof doesn't throw (see comments on hennings PR).

std::vector<std::string> dec_s;
boost::split(ra_s, ra_val, boost::is_any_of(":"));
boost::split(dec_s, dec_val, boost::is_any_of(":"));
ra = stod(boost::join(ra_s, ""));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment on error handling here. as stod doesn't throw

vivekvenkris and others added 24 commits October 11, 2024 17:40
…sf, neighbouring and overlapping beam generator
Optional output of stats and incoherent beam files
Fix integer overflow in SkyCleaver's expected bridge frequencies
@ewanbarr
Copy link
Contributor

ewanbarr commented Mar 5, 2025

@vivekvenkris This request has gone on too long. At this point SkyCleaver is the defacto main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants