Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
cigale
CIGALE
Commits
f287a598
Commit
f287a598
authored
Mar 28, 2014
by
Médéric Boquien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Not space before a colon in English.
parent
2aa6aeea
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
239 additions
and
239 deletions
+239
-239
pcigale/__init__.py
pcigale/__init__.py
+1
-1
pcigale/analysis_modules/__init__.py
pcigale/analysis_modules/__init__.py
+30
-30
pcigale/analysis_modules/pdf_analysis/utils.py
pcigale/analysis_modules/pdf_analysis/utils.py
+3
-3
pcigale/creation_modules/__init__.py
pcigale/creation_modules/__init__.py
+8
-8
pcigale/creation_modules/bc03.py
pcigale/creation_modules/bc03.py
+1
-1
pcigale/creation_modules/casey2012.py
pcigale/creation_modules/casey2012.py
+1
-1
pcigale/creation_modules/dale2014.py
pcigale/creation_modules/dale2014.py
+2
-2
pcigale/creation_modules/dh2002.py
pcigale/creation_modules/dh2002.py
+1
-1
pcigale/creation_modules/dl2007.py
pcigale/creation_modules/dl2007.py
+2
-2
pcigale/creation_modules/dustatt_calzleit.py
pcigale/creation_modules/dustatt_calzleit.py
+15
-15
pcigale/creation_modules/dustatt_powerlaw.py
pcigale/creation_modules/dustatt_powerlaw.py
+13
-13
pcigale/creation_modules/fritz2006.py
pcigale/creation_modules/fritz2006.py
+2
-2
pcigale/creation_modules/igm_attenuation.py
pcigale/creation_modules/igm_attenuation.py
+4
-4
pcigale/creation_modules/loadfile.py
pcigale/creation_modules/loadfile.py
+1
-1
pcigale/creation_modules/m2005.py
pcigale/creation_modules/m2005.py
+2
-2
pcigale/creation_modules/nebular.py
pcigale/creation_modules/nebular.py
+2
-2
pcigale/creation_modules/redshifting.py
pcigale/creation_modules/redshifting.py
+1
-1
pcigale/creation_modules/sfh2exp.py
pcigale/creation_modules/sfh2exp.py
+1
-1
pcigale/creation_modules/sfhfromfile.py
pcigale/creation_modules/sfhfromfile.py
+2
-2
pcigale/data/__init__.py
pcigale/data/__init__.py
+37
-37
pcigale/data/bc03.py
pcigale/data/bc03.py
+11
-11
pcigale/data/dh2002.py
pcigale/data/dh2002.py
+5
-5
pcigale/data/filters.py
pcigale/data/filters.py
+5
-5
pcigale/data/fritz2006.py
pcigale/data/fritz2006.py
+6
-6
pcigale/data/m2005.py
pcigale/data/m2005.py
+18
-18
pcigale/sed/__init__.py
pcigale/sed/__init__.py
+17
-17
pcigale/sed/io/vo.py
pcigale/sed/io/vo.py
+3
-3
pcigale/sed/utils.py
pcigale/sed/utils.py
+18
-18
pcigale/session/configuration.py
pcigale/session/configuration.py
+13
-13
pcigale/session/tools.py
pcigale/session/tools.py
+2
-2
pcigale/utils.py
pcigale/utils.py
+1
-1
pcigale/warehouse/__init__.py
pcigale/warehouse/__init__.py
+5
-5
pcigale/warehouse/store/memory.py
pcigale/warehouse/store/memory.py
+3
-3
pcigale/warehouse/store/shelf.py
pcigale/warehouse/store/shelf.py
+3
-3
No files found.
pcigale/__init__.py
View file @
f287a598
...
...
@@ -27,7 +27,7 @@ def genconf(config):
def
check
(
config
):
"Check the configuration."
# TODO
: Check if all the parameters that don't have default values are
# TODO: Check if all the parameters that don't have default values are
# given for each module.
print
(
"With this configuration, pcigale must compute {} "
"SEDs."
.
format
(
len
(
config
.
creation_modules_conf_array
)))
...
...
pcigale/analysis_modules/__init__.py
View file @
f287a598
...
...
@@ -40,18 +40,18 @@ class AnalysisModule(object):
Parameters
----------
data_file
: string
data_file: string
Name of the file containing the observations to be fitted.
column_list
: array of strings
column_list: array of strings
Names of the columns from the data file to use in the analysis.
creation_modules
: array of strings
creation_modules: array of strings
Names (in the right order) of the modules to use to build the SED.
creation_modules_params
: array of array of dictionaries
creation_modules_params: array of array of dictionaries
Array containing all the possible combinations of configurations
for the creation_modules. Each 'inner' array has the same length as
the creation_modules array and contains the configuration
dictionary for the corresponding module.
parameters
: dictionary
parameters: dictionary
Configuration for the module.
Returns
...
...
@@ -72,18 +72,18 @@ class AnalysisModule(object):
Parameters
----------
data_file
: string
data_file: string
Name of the file containing the observations to be fitted.
column_list
: array of strings
column_list: array of strings
Names of the columns from the data file to use in the analysis.
creation_modules
: array of strings
creation_modules: array of strings
Names (in the right order) of the modules to use to build the SED.
creation_modules_params
: array of array of dictionaries
creation_modules_params: array of array of dictionaries
Array containing all the possible combinations of configurations
for the creation_modules. Each 'inner' array has the same length as
the creation_modules array and contains the configuration
dictionary for the corresponding module.
parameters
: dictionary
parameters: dictionary
Configuration for the module.
Returns
...
...
@@ -92,7 +92,7 @@ class AnalysisModule(object):
Raises
------
KeyError
: when not all the needed parameters are given.
KeyError: when not all the needed parameters are given.
"""
# For parameters that are present on the parameter_list with a default
...
...
@@ -133,12 +133,12 @@ def get_module(module_name):
Parameters
----------
module_name
: string
module_name: string
The name of the module we want to get the class.
Returns
-------
module_class
: class
module_class: class
"""
try
:
...
...
@@ -159,21 +159,21 @@ def adjust_errors(flux, error, tolerance, default_error=0.1,
Parameters
----------
flux
: array of floats
flux: array of floats
Fluxes.
error
: array of floats
error: array of floats
Observational error in the same unit as the fluxes.
tolerance
: float
tolerance: float
Tolerance threshold under flux error is considered as 0.
default_error
: float
default_error: float
Default error factor used when the provided error in under the
tolerance threshold.
systematic_deviation
: float
systematic_deviation: float
Systematic deviation added to the error.
Returns
-------
error
: array of floats
error: array of floats
The corrected errors.
"""
...
...
@@ -207,18 +207,18 @@ def complete_obs_table(obs_table, used_columns, filter_list, tolerance,
Parameters
----------
obs_table
: astropy.table.Table
obs_table: astropy.table.Table
The observation table.
used_columns
: list of strings
used_columns: list of strings
The list of columns to use in the observation table.
filter_list
: list of strings
filter_list: list of strings
The list of filters used in the analysis.
tolerance
: float
tolerance: float
Tolerance threshold under flux error is considered as 0.
default_error
: float
default_error: float
Default error factor used when the provided error in under the
tolerance threshold.
systematic_deviation
: float
systematic_deviation: float
Systematic deviation added to the error.
Returns
...
...
@@ -228,7 +228,7 @@ def complete_obs_table(obs_table, used_columns, filter_list, tolerance,
Raises
------
StandardError
: When a filter is not present in the observation table.
StandardError: When a filter is not present in the observation table.
"""
# TODO Print or log a warning when an error column is in the used column
...
...
@@ -266,17 +266,17 @@ def bin_evenly(values, max_bins):
Parameters
----------
values
: list of floats
values: list of floats
List of values to be binned.
max_bins
: integer
max_bins: integer
Maximum number of bins. If there are less distinct value, every value
is in it's own bin.
Returns
-------
boundaries
: array of floats
boundaries: array of floats
The value of the boundaries of the bins.
bins_digits
: numpy array of integers
bins_digits: numpy array of integers
Array of the same length as the value list giving for each value the
bin number (between 1 and nb_of_bins) it belongs to.
...
...
pcigale/analysis_modules/pdf_analysis/utils.py
View file @
f287a598
...
...
@@ -37,11 +37,11 @@ def gen_pdf(values, probabilities, grid):
Parameters
----------
values
: array like of floats
values: array like of floats
The values of the variable.
probabilities
: array like of floats
probabilities: array like of floats
The probability associated with each value
grid
: array like of float
grid: array like of float
The list of values to which the probability will be evaluated.
Returns
...
...
pcigale/creation_modules/__init__.py
View file @
f287a598
...
...
@@ -22,14 +22,14 @@ def complete_parameters(given_parameters, parameter_list):
Parameters
----------
given_parameters
: dictionary
given_parameters: dictionary
Parameter dictionary used to configure the module.
parameter_list
: OrderedDict
parameter_list: OrderedDict
Parameter list from the module.
Returns
-------
parameters
: OrderedDict
parameters: OrderedDict
Ordered dictionary combining the given parameters with the default
values for the missing ones.
...
...
@@ -107,9 +107,9 @@ class CreationModule(object):
Parameters
----------
name
: string
name: string
Name of the module.
blank
: boolean
blank: boolean
If true, return a non-parametrised module that will be used only
to query the module parameter list.
...
...
@@ -117,7 +117,7 @@ class CreationModule(object):
Raises
------
KeyError
: when not all the needed parameters are given or when an
KeyError: when not all the needed parameters are given or when an
unexpected parameter is given.
"""
...
...
@@ -153,7 +153,7 @@ class CreationModule(object):
Parameters
----------
sed
: pcigale.sed.SED object
sed: pcigale.sed.SED object
"""
raise
NotImplementedError
()
...
...
@@ -164,7 +164,7 @@ def get_module(name, **kwargs):
Parameters
----------
module_name
: string
module_name: string
The name of the module we want to get the class. This name can be
prefixed by anything using a dot, then the part before the dot is
used to determine the module to load (e.g. 'dh2002.1' will return
...
...
pcigale/creation_modules/bc03.py
View file @
f287a598
...
...
@@ -78,7 +78,7 @@ class BC03(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED
sed: pcigale.sed.SED
SED object.
"""
...
...
pcigale/creation_modules/casey2012.py
View file @
f287a598
...
...
@@ -92,7 +92,7 @@ class Casey2012(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
sed: pcigale.sed.SED object
"""
if
'dust.luminosity'
not
in
sed
.
info
.
keys
():
...
...
pcigale/creation_modules/dale2014.py
View file @
f287a598
...
...
@@ -67,8 +67,8 @@ class Dale2014(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
parameters
: dictionary containing the parameters
sed: pcigale.sed.SED object
parameters: dictionary containing the parameters
"""
if
'dust.luminosity'
not
in
sed
.
info
.
keys
():
...
...
pcigale/creation_modules/dh2002.py
View file @
f287a598
...
...
@@ -48,7 +48,7 @@ class DH2002(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
sed: pcigale.sed.SED object
"""
alpha
=
float
(
self
.
parameters
[
"alpha"
])
...
...
pcigale/creation_modules/dl2007.py
View file @
f287a598
...
...
@@ -97,8 +97,8 @@ class DL2007(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
parameters
: dictionary containing the parameters
sed: pcigale.sed.SED object
parameters: dictionary containing the parameters
"""
if
'dust.luminosity'
not
in
sed
.
info
.
keys
():
...
...
pcigale/creation_modules/dustatt_calzleit.py
View file @
f287a598
...
...
@@ -28,7 +28,7 @@ def k_calzetti2000(wavelength):
Parameters
----------
wavelength
: array of floats
wavelength: array of floats
Wavelength grid in nm.
Returns
...
...
@@ -62,7 +62,7 @@ def k_leitherer2002(wavelength):
Parameters
----------
wavelength
: array of floats
wavelength: array of floats
Wavelength grid in nm.
Returns
...
...
@@ -83,13 +83,13 @@ def uv_bump(wavelength, central_wave, gamma, ebump):
Parameters
----------
wavelength
: array of floats
wavelength: array of floats
Wavelength grid in nm.
central_wave
: float
central_wave: float
Central wavelength of the bump in nm.
gamma
: float
gamma: float
Width (FWHM) of the bump in nm.
ebump
: float
ebump: float
Amplitude of the bump.
Returns
...
...
@@ -107,9 +107,9 @@ def power_law(wavelength, delta):
Parameters
----------
wavelength
: array of floats
wavelength: array of floats
The wavelength grid in nm.
delta
: float
delta: float
The slope of the power law.
Returns
...
...
@@ -131,20 +131,20 @@ def a_vs_ebv(wavelength, bump_wave, bump_width, bump_ampl, power_slope):
Parameters
----------
wavelength
: array of floats
wavelength: array of floats
The wavelength grid (in nm) to compute the attenuation curve on.
bump_wave
: float
bump_wave: float
Central wavelength (in nm) of the UV bump.
bump_width
: float
bump_width: float
Width (FWHM, in nm) of the UV bump.
bump_ampl
: float
bump_ampl: float
Amplitude of the UV bump.
power_slope
: float
power_slope: float
Slope of the power law.
Returns
-------
attenuation
: array of floats
attenuation: array of floats
The A(λ)/E(B-V)* attenuation at each wavelength of the grid.
"""
...
...
@@ -249,7 +249,7 @@ class CalzLeit(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
sed: pcigale.sed.SED object
"""
ebvs
=
{}
...
...
pcigale/creation_modules/dustatt_powerlaw.py
View file @
f287a598
...
...
@@ -23,9 +23,9 @@ def power_law(wavelength, delta):
Parameters
----------
wavelength
: array of float
wavelength: array of float
Wavelength grid in nm.
delta
: float
delta: float
Power law slope.
Returns
...
...
@@ -42,13 +42,13 @@ def uv_bump(wavelength, central_wave, gamma, ebump):
Parameters
----------
wavelength
: array of floats
wavelength: array of floats
Wavelength grid in nm.
central_wave
: float
central_wave: float
Central wavelength of the bump in nm.
gamma
: float
gamma: float
Width (FWHM) of the bump in nm.
ebump
: float
ebump: float
Amplitude of the bump.
Returns
...
...
@@ -68,20 +68,20 @@ def alambda_av(wavelength, delta, bump_wave, bump_width, bump_ampl):
Parameters
----------
wavelength
: array of floats
wavelength: array of floats
The wavelength grid (in nm) to compute the attenuation curve on.
delta
: float
delta: float
Slope of the power law.
bump_wave
: float
bump_wave: float
Central wavelength (in nm) of the UV bump.
bump_width
: float
bump_width: float
Width (FWHM, in nm) of the UV bump.
bump_ampl
: float
bump_ampl: float
Amplitude of the UV bump.
Returns
-------
attenuation
: array of floats
attenuation: array of floats
The A(λ)/Av attenuation at each wavelength of the grid.
"""
...
...
@@ -174,7 +174,7 @@ class PowerLawAtt(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
sed: pcigale.sed.SED object
"""
av
=
{}
...
...
pcigale/creation_modules/fritz2006.py
View file @
f287a598
...
...
@@ -91,8 +91,8 @@ class Fritz2006(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
parameters
: dictionary containing the parameters
sed: pcigale.sed.SED object
parameters: dictionary containing the parameters
"""
...
...
pcigale/creation_modules/igm_attenuation.py
View file @
f287a598
...
...
@@ -39,7 +39,7 @@ class IgmAttenuation(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
sed: pcigale.sed.SED object
"""
redshift
=
sed
.
info
[
'redshift'
]
...
...
@@ -67,14 +67,14 @@ def igm_transmission_meiksin(wavelength, redshift):
Parameters
----------
wavelength
: array like of floats
wavelength: array like of floats
The wavelength(s) in nm.
redshift
: float
redshift: float
The redshift. Must be strictly positive.
Returns
-------
igm_transmission
: numpy array of floats
igm_transmission: numpy array of floats
The intergalactic transmission at each input wavelength.
"""
...
...
pcigale/creation_modules/loadfile.py
View file @
f287a598
...
...
@@ -46,7 +46,7 @@ class LoadSpecFile(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
sed: pcigale.sed.SED object
"""
filename
=
self
.
parameters
[
'filename'
]
...
...
pcigale/creation_modules/m2005.py
View file @
f287a598
...
...
@@ -27,7 +27,7 @@ class M2005(CreationModule):
Information added to the SED:
- imf, metallicity, galaxy_age
- mass_total, mass_alive, mass_white_dwarf,mass_neutrino,
mass_black_hole, mass_turn_off
: stellar masses in solar mass.
mass_black_hole, mass_turn_off: stellar masses in solar mass.
- age: age of the oldest stars in the galaxy.
- old_young_separation_age: age (in Myr) separating the young and the
old star populations (if 0, there is only one population)
...
...
@@ -115,7 +115,7 @@ class M2005(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED
sed: pcigale.sed.SED
SED object.
"""
...
...
pcigale/creation_modules/nebular.py
View file @
f287a598
...
...
@@ -130,8 +130,8 @@ class NebularEmission(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
parameters
: dictionary containing the parameters
sed: pcigale.sed.SED object
parameters: dictionary containing the parameters
"""
f_esc
=
self
.
parameters
[
'f_esc'
]
...
...
pcigale/creation_modules/redshifting.py
View file @
f287a598
...
...
@@ -57,7 +57,7 @@ class Redshifting(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
sed: pcigale.sed.SED object
"""
# If the SED is already redshifted, raise an error.
...
...
pcigale/creation_modules/sfh2exp.py
View file @
f287a598
...
...
@@ -73,7 +73,7 @@ class Sfh2Exp(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
sed: pcigale.sed.SED object
"""
tau_main
=
float
(
self
.
parameters
[
"tau_main"
])
...
...
pcigale/creation_modules/sfhfromfile.py
View file @
f287a598
...
...
@@ -60,8 +60,8 @@ class SfhFromFile(CreationModule):
Parameters
----------
sed
: pcigale.sed.SED object
parameters
: dictionary containing the parameters
sed: pcigale.sed.SED object
parameters: dictionary containing the parameters
"""
filename
=
self
.
parameters
[
'filename'
]
...
...
pcigale/data/__init__.py
View file @
f287a598
...
...
@@ -245,7 +245,7 @@ class Database(object):
Parameters
----------
writable
: boolean
writable: boolean
If True the user will be able to write new data in the database
(but he/she must have a writable access to the sqlite file). By
default, False.
...
...
@@ -281,7 +281,7 @@ class Database(object):
Parameters
----------
ssp
: pcigale.base.M2005
ssp: pcigale.base.M2005
"""
if
self
.
is_writable
:
...
...
@@ -302,19 +302,19 @@ class Database(object):
Parameters
----------
imf
: string
imf: string
Initial mass function (ss for Salpeter, kr for Kroupa)
metallicity
: float
metallicity: float
[Z/H] = Log10(Z/Zsun) - Log10(H/Hsun)
Returns
-------
ssp
: pcigale.base.M2005
ssp: pcigale.base.M2005
The M2005 object.
Raises
------
DatabaseLookupError
: if the requested SSP is not in the database.
DatabaseLookupError: if the requested SSP is not in the database.
"""
result
=
self
.
session
.
query
(
_M2005
)
\
...
...
@@ -346,7 +346,7 @@ class Database(object):
Parameters
----------
ssp
: pcigale.data.SspBC03
ssp: pcigale.data.SspBC03
"""
if
self
.
is_writable
:
...
...
@@ -367,18 +367,18 @@ class Database(object):
Parameters
----------
imf
: string
imf: string
Initial mass function (salp for Salpeter, chab for Chabrier)
metallicity
: float
metallicity: float
0.02 for Solar metallicity
Returns
-------
ssp
: pcigale.data.BC03
ssp: pcigale.data.BC03
The BC03 object.
Raises
------
DatabaseLookupError
: if the requested SSP is not in the database.
DatabaseLookupError: if the requested SSP is not in the database.
"""
result
=
self
.
session
.
query
(
_BC03
)
\
...
...
@@ -410,7 +410,7 @@ class Database(object):
Parameters
----------
data
: array
data: array
Array containing the templates data.
"""
...
...
@@ -442,12 +442,12 @@ class Database(object):
Returns
-------
template
: pcigale.base.DH2002
template: pcigale.base.DH2002
The Dale and Helou (2002) infrared templates.