ecpi.common.sky.catalog module

Section author: ECLAIRs GP team

Catalogs of sources

Summary

Classes:

CatalogAstroSourcesBasic

"A catalog in equatorial coordinate

CatalogAstroWithEnergySpecSampling

Represent astro catalog source in equatorial coordinate with its energy spectrum sampling (ph/cm2/s)

CatalogBase

A simple catalog of sources

CatalogFovBasic

a catalog of sources in the FOV

CatalogFovEclairs

catalog of x-ray sources for the ECLAIRs instrument

CatalogIdentifiedSources

catalog of x-ray sources identified by IMAG format from General Program Software Description

Class diagram:

Reference

class CatalogAstroSourcesBasic[source]

Bases: ecpi.common.sky.catalog.CatalogBase

“A catalog in equatorial coordinate

read_cat_swift_light()[source]

set the source table with sources from the swift-BAT catalog

swift-BAT catalog is in common/data/cat/BAT_70m_catalog_20nov2012.fits

name is set from ‘counterpart’

flux if ‘flux’ convert to keV/20

class CatalogAstroWithEnergySpecSampling(p_energy_sampling)[source]

Bases: ecpi.common.sky.catalog.CatalogBase

Represent astro catalog source in equatorial coordinate with its energy spectrum sampling (ph/cm2/s)

plot_first_fluxes(nb)[source]
plot_flux(idx)[source]
plot_flux_name(p_name)[source]
plot_fluxes(l_idx)[source]
sort_by_flux()[source]

bof intensity est un tableau, critère de trie ? le premier élément ?

class CatalogBase[source]

Bases: object

A simple catalog of sources

add_from_catalog(other_catalog)[source]

add to this catalog the sources from the other catalog

if metadata from the catalogs do not match, an error is raised

Parameters

other_catalog (CatalogBase) – catalog from sources are added

add_src(info_src)[source]

add a source to the catalog

‘elev’,’dir’,’intensity’,’name’

Parameters

info_src ([ float, float, float, string ]) – [‘elev’or’ra’,’dir’or’dec’,’intensity’,’name’]

get_catalog()[source]

return the table of the catalog

Retunr

table of the catalog

Return type

astropy.table.Table

get_nb_element()[source]

return the number of sources in the catalog

The number of sources is computed from the ‘name’ column

Returns

number of sources in the catalog

Return type

int

get_row_with_name(name)[source]
plot_on_sphere(p_title=None, show=True, save=None)[source]

plot the sources on a sphere

Warning

self.name_file_cat must be manually set

Parameters
  • p_title (string) – title of the plot. Default=None

  • show (bool) – show the plot. Default=True.

  • save (string) – PATH/name of the file to save in. If None, no saving. Default=None.

read_catalog(name_file)[source]

init the sources table from a fits file

If there already are sources in the catalog, there are deleted.

The file must be a fits file with a table data

Parameters

name_file (string) – PATH/name of the file to read

remove_src(p_name)[source]

remove a source from the catalog

Parameters

p_name (string) – name of source to remove

save_catalog(name_file)[source]

write the catalog table into a fits file

If the file already exists, it is overwrite.

Parameters

name_file (string) – PATH/name of the file to save into

class CatalogFovBasic[source]

Bases: ecpi.common.sky.catalog.CatalogBase

a catalog of sources in the FOV

from_astro_catalog(p_cat_radec: ecpi.common.sky.catalog.CatalogAstroSourcesBasic, p_limit_elevation=0)[source]

add sources from an astro catalog and convert coordinate in elevation, direction

p_catcatalaog in ra , dec coordinate

p_limit_elevation deg

Note

need set_ptg_instru

Parameters
  • p_cat_radec (CatalogAstroSourcesBasic) – catalog in ra, dec coordinates

  • p_limit_elevation (float) – limit in elevation in deg. Default is 0.

from_astro_catalog_with_spectrum(p_cat_radec)[source]

Define catalog with astronomical catalog (in equatorial coordinate) with spectrum

Parameters

p_cat_radec (CatalogAstroWithEnergySpecSampling) – sky catalog with source spectrum

intensity_with_channel(nb_chan)[source]

raz all catalog and change format

plot_on_astro_sphere(p_title=None, show=True, save=None)[source]

plot the sources on the sky, with RA and DEC

Note

different to plot_on_sphere that plot with elev and dir

Parameters
  • p_title (string) – title of the plot. Default=None

  • show (bool) – show the plot. Default=True.

  • save (string) – PATH/name of the file to save in. If None, no saving. Default=None.

set_ptg_instru(p_ptg_instru: ecpi.common.mission.attitude.AttitudeVT)[source]

set the pointing object associated to this catalog

Parameters

p_ptg_instru (pointing_instrument.AttitudeVT) – pointing of the instrument for this catalog

to_astro_catalog(verbose=False)[source]

return an astro catalog in ra, dec coordinates based on the source table

Note

need set_ptg_instru

Returns

astro catalog

Return type

CatalogAstroSourcesBasic

class CatalogFovEclairs(instru_eclairs=None)[source]

Bases: ecpi.common.sky.catalog.CatalogFovBasic

catalog of x-ray sources for the ECLAIRs instrument

add_src_pix(info_src_pix)[source]

add a source in sky pixel coordinates to the catalog

‘pix_y’,’pix_z’,’intensity’,’name’

(0,0) is at the center of the sky array

Parameters

info_src_pix ([ float, float, float, string]) – sky pixel info of the source [‘pix_y’,’pix_z’,’intensity’,’name’]

from_astro_catalog(p_cat_radec: ecpi.common.sky.catalog.CatalogAstroSourcesBasic, p_limit_elevation=0)[source]

add sources from an astro catalog

Only sources in the FOV will be added

Note

need set_ptg_instru

Parameters
  • p_cat_radec (CatalogAstroSourcesBasic) – catalog in ra, dec coordinates

  • p_limit_elevation (float) – limit in elevation in deg. Default is 0.

get_catalog_sky_pix()[source]

return the catalog with the position of the sources in pixel of the sky array

(0,0) is at the center of the sky array

Returns

catalog table with sources positions in sky_pix format

Return type

astropy.table.Table

save_catalog_pix(name_file)[source]

save the catalog in pix format to a fits file

Parameters

name_file (string) – PATH/name of the fits file

class CatalogIdentifiedSources[source]

Bases: ecpi.common.sky.catalog.CatalogFovBasic

catalog of x-ray sources identified by IMAG format from General Program Software Description

add_from_catalogFOVECLAIRs(eclairs_catal)[source]

add to the sources catalog a simple ECLAIRs catalog CatalogFovEclairs

the unkown data are left blank

Note

metadata_confilts may cause warnings

Parameters

eclairs_catal (CatalogFovEclairs) – sources catalog the sources are added from (elev, dir, intensity, name)

arf_correction(dpix, energy_range)[source]

apply the arf correction to the sources fluxes

Parameters
cos_theta_correction(instru_eclairs=          InstruECLAIRs object         =====================         Mask aperture: 0.4         Half-cross size (cm): 0.79468085         Detector pixel size (cm): 0.4         Detector pixel pitch size (cm): 0.45         Mask-detector distance (cm): 45.77         Mask pixel size (cm): 1.1393617         Number of mask pixels: 46         Mask total size (cm): 54                  Left-bottom submask         -------------------         y range: [-26.43031915, -1.364361749999997] | z range: [-26.43031915, -1.364361749999997]                  Right-bottom submask         -------------------         y range: [1.3643616838165284, 26.43031908381653] | z range: [-26.43031915, -1.364361749999997]                  Left-up submask         -------------------         y range: [-26.43031915, -1.364361749999997] | z range: [1.3643616838165284, 26.43031908381653]                  Right-up submask         -------------------         y range: [1.3643616838165284, 26.43031908381653] | z range: [1.3643616838165284, 26.43031908381653]         , verbose=None)[source]

apply off axis corrections on the flux of the sources

Parameters
  • instru_eclairs (InstruECLAIRs) – ECLAIRs instrument

  • verbose (bool (default False)) – activate print outputs

irf_correction(dpix, verbose=None)[source]

Apply the irf correction matrix to the sources fluxes.

Parameters
save_catalog(file_path, attitude=['', '', ''], tstart='0', tstop='1', creator='IMAG?', proc_id='01')[source]

write the catalog table into a fits file ECL-SOPcos_theta_correction-IMA

common keywords are included

filename is ‘ECL-SOP-IMA-‘ + proc_id + ‘.fits’

Parameters
  • file_path (string) – PATH to the directory where to write the file

  • attitude ([float, float, float]) – [ra, dec, ori] in degrees. Default is None

  • tstart (float) – start time of the observation in s from mjdref

  • tstop (float) – end time of the observation in s from mjdref

  • creator (string) – program that has generated the file. Default=’IMAG?’

  • proc_id (string) – id of the process. Default=”01”.