Spi_acs

class gdt.missions.integral.spi.spi_acs.Spi_acs[source]

Bases: FitsFileContextManager

Class for Spi-ACS lightcurve.

Attributes Summary

filename

The filename

hdulist

The list of Header Data Units

headers

The headers

mjdref

The start of the lightcurve Time bins

num_hdus

The number of HDUs

obsdate

The observation date

obsdateend

The observation date end

rates

The Rates

rates_error

The Rate Error

time

The start of the lightcurve Time bins

timezero

The reference 'zero' in time bin in terms of the MET

tstart

The observation date

tstop

The observation date

Methods Summary

close()

Close the file

column(hdu_num, col_name)

Return a column from an HDU as an array.

columns_as_array(hdu_num, col_names[, dtype])

Return a list of columns from an HDU as an array.

get_column_names(hdu_num)

Get the column names in a HDU.

open(file_path, **kwargs)

Open and read a spi_acs file

to_lightcurve()

Create the TimeBins object to plot the lightcurve

write(directory[, filename])

Write the file to disk.

Attributes Documentation

filename

The filename

Type:

(str)

hdulist

The list of Header Data Units

Type:

(astropy.io.fits.hdu.HDUList)

headers

The headers

Type:

(FileHeaders)

mjdref

The start of the lightcurve Time bins

Type:

(float)

num_hdus

The number of HDUs

Type:

(int)

obsdate

The observation date

Type:

(float)

obsdateend

The observation date end

Type:

(float)

rates

The Rates

Type:

(float)

rates_error

The Rate Error

Type:

(float)

time

The start of the lightcurve Time bins

Type:

(float)

timezero

The reference ‘zero’ in time bin in terms of the MET

Type:

(float)

tstart

The observation date

Type:

(float)

tstop

The observation date

Type:

(float)

Methods Documentation

close()

Close the file

column(hdu_num: int, col_name: str) array

Return a column from an HDU as an array.

Parameters:
  • hdu_num (int) – The HDU number

  • col_name (str) – The name of the column

Returns:

(np.array)

columns_as_array(hdu_num: int, col_names: List[str], dtype: dtype = None) array

Return a list of columns from an HDU as an array.

Parameters:
  • hdu_num (int) – The HDU number

  • col_names (list of str) – The names of the columns

  • dtype (np.dtype, optional) – The custom dtype of the output array

Returns:

(np.array)

get_column_names(hdu_num: int)

Get the column names in a HDU. Returns empty if there is no data extension in the HDU.

Parameters:

hdu_num (int) – The HDU number

Returns:

(tuple)

classmethod open(file_path, **kwargs)[source]

Open and read a spi_acs file

Parameters:

file_path (str) – The file path of the spi_acs lightcurve file

Returns:

(spi_acs)

to_lightcurve()[source]

Create the TimeBins object to plot the lightcurve

Returns:

(TimeBins)

write(directory: str | Path, filename: str = None, **kwargs)

Write the file to disk.

Parameters:
  • directory (str) – The directory to write the file.

  • filename (str, optional) – The filename. If omitted, attempts to use the filename if set.