Adds a keyword to a crate.
- crate - input Crate object
- cratekey - CrateKey object to be added
Adds the keyword represented by the cratekey argument to the crate.
If the keyword already exists it will be replaced otherwise it will
be added to the end of the keyword list.
| crate |
a Crate object |
| cratekey |
CrateKey object |
>>> crate = read_file("table.fits")
>>> print get_key_names(crate)
['TELESCOP' 'INSTRUME' 'DETNAME' 'FILTER' 'CHANTYPE' 'DETCHANS'
'HDUCLASS'
'HDUCLAS1' 'HDUCLAS2' 'HDUCLAS3' 'HDUVERS' 'HDUVERS1' 'HDUVERS2'
'RMFVERSN' 'PHAFILE' 'EB_SCALE' 'EBOFFSET' 'SMOOTHED' 'CVSD0001'
'CVST0001' 'CDES0001']
>>> key = CrateKey()
>>> key.name = "NEWKEY"
>>> add_key(cr, key)
1
>>> print get_key_names(crate)
['TELESCOP' 'INSTRUME' 'DETNAME' 'FILTER' 'CHANTYPE' 'DETCHANS'
'HDUCLASS'
'HDUCLAS1' 'HDUCLAS2' 'HDUCLAS3' 'HDUVERS' 'HDUVERS1' 'HDUVERS2'
'RMFVERSN' 'PHAFILE' 'EB_SCALE' 'EBOFFSET' 'SMOOTHED' 'CVSD0001'
'CVST0001' 'CDES0001' 'NEWKEY']
>>>
Create a new key and add it to the input Crate.
See the
bug pages
on the CIAO website for an up-to-date listing of known bugs.
- py.crates
-
add_col,
add_image,
delete_col,
delete_image,
delete_key,
get_key,
get_key_names,
get_keyval,
key_exists,
print_key_names,
read_arf,
read_file,
read_pha,
read_rmf,
set_keyval,
write_arf,
write_file,
write_pha,
write_rmf
|