sherpa.astro.ui.copy_data(fromid, toid)

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.

  • fromid (int or str) – The input data set.

  • toid (int or str) – The output data set.


sherpa.utils.err.IdentifierErr – If there is no data set with a fromid identifier.


>>> 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)