API Reference
This page introduces to the classes and functions in the irgsctool package. The main class is the irgsc class which has several subclasses like GetData, ReadData, StarGalaxyClassification, ExtinctionCorrection, GenerateIRGSC, ValidateIRGSC.
Figure (1) shows the UML diagram of the irgsctool package.
irgsc(ra, dec, validate=None)
Initialisation of parent irgsc class . This class has several child classes.
This method described using input ra and dec. It checks whther the data from PANSTARRS DR2, UKISS DR11 and Gaia DR3 can be obtained.
RAISES | DESCRIPTION |
---|---|
ValueError
|
if the data is not available in UKIDSS or PANSTARRS 3-pi survey. The code will not proceed further. |
Warning
|
if the data is not available in the Gaia DR3 survey. In the IRGSC, the Gaia values will be replaces with -999. |
GetData(ra, dec)
Examples:
>>> irgsctool.GetData.get_panstarrs_data(0.0,0.0)
'PS1_RA_0_0_DEC_0_0.csv'
>>> irgsctool.GetData.get_gaia_data(0.0,0.0)
'GAIA_RA_0_0_DEC_0_0.csv'
>>> irgsctool.GetData.get_ukidss_data(0.0,0.0)
'UKIDSS_RA_0_0_DEC_0_0.csv'
get_gaia_data()
irgsctool.GetData.get_gaia_data()
get_panstarrs_data()
irgsctool.GetData.get_panstarrs_data()
get_ukidss_data()
irgsctool.GetData.get_ukidss_data()
ReadData(ra, dec)
ReadData class contains methods to read the photometric data from PS1 DR2, GAIA DR3 and UKIDSS DR11.
read_gaia_data()
Reads the input GAIA DR3 data. The number of columns are 12.
read_nir_data()
Reads the input UKIDSS NIR data. The number of columns are 8.
Returns the input optical data with nan values removed (if present) and restricts the data to the sources having SNR >= 5.
Some regions do not have J or H band data especially DXS or GCS surveys. For these regions, only K band data is imported.
read_optical_data()
irgsctool.ReadData.read_optical_data()
RAISES | DESCRIPTION |
---|---|
FileNotFoundError
|
if the optical input data file is not available. |
StarGalaxyClassification(ra, dec)
StarGalaxyClassification class contains star_galaxy_classification() method which is used to seperate the stars and galaxies in the PANSTARRS optical data.
star_galaxy_classification()
irgsctool.StarGalaxyClassification.star_galaxy_classification()
This method is used to seperate stars and galaxies using the condition applied to all the five optical filters:
$$ (psf-kron) < 0.05 $$
This relation filters the input optical data for only probable stellar sources. The (psf-kron) diagram showing stars and galaxies in the data as well as (g-r) vs (r-i) CCD is also plotted by this method.
RETURNS | DESCRIPTION |
---|---|
ndarray
|
PANSTARRS data containing most probable stellar sources |
ExtinctionCorrection(ra, dec)
ExtinctionCorrection class has two methods; one to obtain the reddening and NIR extinction coefficients, while the other to correct the PANSTARRS data for extinction in each optical filter.
extinction_corrected_photometry()
irgsctool.ExtinctionCorrection.extinction_correctdd_photometry()
This method corrects the input optical PANSTARRS data for reddening and extinction along the line of site.
RETURNS | DESCRIPTION |
---|---|
ndarray
|
Extinction corrected PANSTARRS optical photometry. |
get_reddening()
irgsctool.ExtinctionCorrection.get_reddening()
This method obtains the reddening value for a given set of input coordinates from Schelgel et.al. 1998 (sfd) reddening map. irgsctool uses Schlafly & Finkbeiner 2011 (snf) reddening map which is snf = 0.86*sfd.
RAISES | DESCRIPTION |
---|---|
FileNotFoundError
|
if the sfd files are not present. |
RETURNS | DESCRIPTION |
---|---|
ebv
|
Reddening from Schlafly & Finkbeiner 2011 |
err_ebv
|
Uncertinty in reddening |
aj
|
J-band extinction coefficient. |
ah
|
H-band extinction coefficient. |
ak
|
K-band extinction coefficient. |
Models(use_sam=None)
Models class reads and selects the required Kurucz and Phoenix stellar atmospheric models in the generation of IRGSC.
read_sam_file()
irgsctool.Models.read_sam_file(use_sam=None)
RAISES | DESCRIPTION |
---|---|
AttributeError
|
if use_sam is None. |
FileNotFoundError
|
if the model files are not found. |
select_sam_range(teff_range=None, logg_range=None, feh_range=None)
irgsctool.Models.select_sam_range(teff_range=None, logg_range=None,
feh_range=None, use_optimal_method=False)
Model Name | (T_{eff}) (K) | log(g) (dex) | [Fe/H] (dex) |
---|---|---|---|
Phoenix (C1) | 2800 - 5000 | 3.0 - 5.5 | -5.0 - -1.5 |
Phoenix (C2) | 2800 - 4000 | 0.0 - 3.0 | -0.5 - 1.5 |
KuruczCastelli-Kurucz (K0) | 4000 - 10000 | --- | --- |
RETURNS | DESCRIPTION |
---|---|
sam_params
|
type: ndarray: Selected model parameters and model |
magnitudes to generate IRGSC |
RAISES | DESCRIPTION |
---|---|
TypreError
|
if range of parameters is not given. |
GenerateIRGSC(ra, dec)
generate_irgsc(use_optimal_method=True)
irgsctool.GenerateIRGSC.generate_irgsc(use_optimal_method=True)
$$ ES = \frac{\int{F_{\lambda}P_{\lambda}{\lambda} d{\lambda}}}{\int{P_{\lambda}{\lambda}d{\lambda}}} $$
The spectra is obtained from pysynphot (More information here).
RETURNS | DESCRIPTION |
---|---|
irgsc_data
|
The generated IRGSC. |
ValidateIRGSC(ra, dec)
read_irgsc()
irgsctool.validate.read_irgsc()
This function reads the generated IRGSC for a given set of coordinates.
RAISES | DESCRIPTION |
---|---|
FileNotFoundError
|
This error arises if there is no generated IRGSC |
validate(validate=None)
irgsctool.ValidateIRGSC.calidate(validate=True)
This method compares the observed and computed NIR magnitudes for a given field. If this is set to True, the method first obtains the UKIDSS data for the given field. The output is a validated IRGSC and plots showing the comparison of the computed NIR magnitudes with the observed ones.
RAISES | DESCRIPTION |
---|---|
ValueError
|
if validate is False |