SpecDG

class pydirtygrid.SpecDG.SpecDG[source]

Read in the mapping file for all spectra

Returns:

(self.)plan: Table

table containing the identification of each spectrum, as well as its parameters

(self.)seds: list

empty list to save the spectra if you want to

Methods Summary

findFile(file_id) Returns the full filename for a given GID from the spectrum mapping.
findGidFromParam(grain, geom, sf_type, ...) Returns the GID given a set of parameters
findParamsFromGid(thisgid) Returns the parameter values for a given GID
spec2Phot(trans_curve, trans_waves, wave0[, ...]) Compute the new photometry
specGet(filename) Save a spectrum from the filename
specPlot([ind]) Plot SEDs, either giving a specific index of which if more that

Methods Documentation

findFile(file_id)[source]

Returns the full filename for a given GID from the spectrum mapping.

Returns:

filepath+filename: string

the absolute path and name of the .fits file

findGidFromParam(grain, geom, sf_type, metal, age, sfr, tau)[source]

Returns the GID given a set of parameters (If you want to plot or something)

Parameters:

grain: string

type of grain

geom: string

geometry

sf_type: string

star formation type

metal: float

metallicity

age: float

age of the stellar population

sfr: float

star formation rate

tau: float

optical depth

Returns:

file_gid: string

identification number of the spectrum with the given set

of parameters

findParamsFromGid(thisgid)[source]

Returns the parameter values for a given GID (Used later to update the cube)

Parameters:

thisgid: string

identification number of the spectrum

Returns:

thisgt, thisgm, thissf, thismt, thissa, thissr, thista: integers

indices of the parameter values for the given spectrum,

in the multidimensional photometry cube

spec2Phot(trans_curve, trans_waves, wave0, energy=1)[source]

Compute the new photometry

Parameters:

trans_curve: array

transmission curve of the new filter /!Alread read, as an array

trans_waves: array

wavelengths of the new filter

wave0: float

center/effective wavelength of the new filter

energy: integer (Optional)

specification for integration with energy(=1, default) or photons

Returns:

newcube: array(3, 6, 2, 5, 50, 29, 25) (float)

new photometry cube

specGet(filename)[source]

Save a spectrum from the filename

Parameters:

filename: string

absolute path to the spectrum you want to read

Returns:

(self.)seds: list

update the list to add the SED

(self.)waves: array

the wavelengths to the SED

specPlot(ind=-1)[source]

Plot SEDs, either giving a specific index of which if more that one saved, or all of them

Parameters:

ind: integer(s) (Optional)

indices of the SED you wish to plot