copy_data

sherpa.astro.ui.copy_data(fromid: IdType, toid: IdType) None

Copy a data set, creating a new identifier.

After copying the data set, any changes made to the original data set (that is, the fromid identifier) will not be reflected in the new (the toid identifier) data set.

Parameters:
fromidint or str

The input data set.

toidint or str

The output data set.

Raises:
sherpa.utils.err.IdentifierErr

If there is no data set with a fromid identifier.

Examples

>>> copy_data(1, 2)

Rename the data set with identifier 2 to “orig”, and then delete the old data set:

>>> copy_data(2, "orig")
>>> delete_data(2)