Skip to content

Need for append_n (const TColumns &... columns) const in BintableColumns #63

@dagnic

Description

@dagnic

In order to add columns to an existing BintableColumns, it would be good to define the following method:

 void append_n (const TColumns &... columns) const

to be able to append column like (after the name does not already exists) that:

    const BintableHdu& hdu = m_Mef->access<BintableHdu>(extname);
    const BintableColumns& cols = hdu.columns();
    const auto col_names = cols.read_all_names();
    
    // if colname exist, writeinside it
    if (std::find(col_names.begin(), col_names.end(), colnames[index]) != vec.end())
    {
        cols.write_n(std::forward_as_tuple(makeColumn(maps)...));
    }
    else // else, append it
    {
        cols.append_n(std::forward_as_tuple(makeColumn(maps)...));
    }

(in this example, makeColumn is used to copy values into a vector from a healpix map)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions