Skip to content

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

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions