| AHELP for CIAO 4.4 | is_pha |
Context: crates |
Synopsis
Determine if the crate dataset contains a PHA file and its type.
Syntax
is_pha(cratedataset) is_pha_type1(cratedataset) is_pha_type2(cratedataset)
Description
The is_pha command returns True if the crate dataset contains a PHA file (type I or II) and False otherwise. The _type1 and _type2 variants return True if the dataset is a type 1 or type 2 PHA data set respectively.
Example
>>> cds = read_pha("src.pi")
>>> cr = read_file("src.pi")
>>> is_pha(cds)
True
>>> is_pha(cr)
FalseThe routine requires a CrateDataset object - as returned by read_pha - and not a Crate.
Changes in CIAO 4.4
Input argument
PHA files are now stored as CrateDataset objects rather than Crates. So a PHA file read in by read_file will not return True when passed to is_pha.
Return value
The return value is now True or False rather than 1 or 0.
New routines
The is_pha_type1 and is_pha_type2 routines are new to CIAO 4.4.
Bugs
See the bug pages on the CIAO website for an up-to-date listing of known bugs.
Refer to the CIAO bug pages for an up-to-date listing of known issues.
See Also
- crates
- col_exists, is_rmf, is_virtual, key_exists, read_pha, write_pha

![[CIAO Logo]](../imgs/ciao_logo_navbar.gif)