PHACountsSpectrumList

class gammapy.spectrum.PHACountsSpectrumList[source]

Bases: list

List of PHACountsSpectrum objects.

All spectra must have the same energy binning. This represent the PHA type II data format. See https://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/spectra/ogip_92_007/node8.html

Methods Summary

append(object)
clear()
copy()
count(value)
extend(iterable)
from_hdulist(hdulist) Create from HDUList.
index(value, [start, [stop]]) Raises ValueError if the value is not present.
insert L.insert(index, object) – insert object before index
pop([index]) Raises IndexError if list is empty or index is out of range.
read(filename) Read from file.
remove(value) Raises ValueError if the value is not present.
reverse L.reverse() – reverse IN PLACE
sort([key, reverse])
to_hdulist() Convert to HDUList
to_table() Convert to Table.
write(outdir, **kwargs) Write to file

Methods Documentation

append(object) → None -- append object to end
clear() → None -- remove all items from L
copy() → list -- a shallow copy of L
count(value) → integer -- return number of occurrences of value
extend(iterable) → None -- extend list by appending elements from the iterable
classmethod from_hdulist(hdulist)[source]

Create from HDUList.

index(value[, start[, stop]]) → integer -- return first index of value.

Raises ValueError if the value is not present.

insert()

L.insert(index, object) – insert object before index

pop([index]) → item -- remove and return item at index (default last).

Raises IndexError if list is empty or index is out of range.

classmethod read(filename)[source]

Read from file.

remove(value) → None -- remove first occurrence of value.

Raises ValueError if the value is not present.

reverse()

L.reverse() – reverse IN PLACE

sort(key=None, reverse=False) → None -- stable sort *IN PLACE*
to_hdulist()[source]

Convert to HDUList

to_table()[source]

Convert to Table.

write(outdir, **kwargs)[source]

Write to file