Commit 604a16d9 authored by Médéric Boquien's avatar Médéric Boquien
Browse files

Prefix the redshift.

parent 35a2c015
...@@ -182,7 +182,7 @@ def sed(idx): ...@@ -182,7 +182,7 @@ def sed(idx):
model_variables = np.array([sed.info[name] model_variables = np.array([sed.info[name]
for name in gbl_analysed_variables]) for name in gbl_analysed_variables])
gbl_model_redshifts[idx] = sed.info['redshift'] gbl_model_redshifts[idx] = sed.info['universe.redshift']
gbl_model_fluxes[idx, :] = model_fluxes gbl_model_fluxes[idx, :] = model_fluxes
gbl_model_variables[idx, :] = model_variables gbl_model_variables[idx, :] = model_variables
......
...@@ -50,7 +50,7 @@ class Param(CreationModule): ...@@ -50,7 +50,7 @@ class Param(CreationModule):
# this module must be the last one. Note that it does require # this module must be the last one. Note that it does require
# an SFH and an SSP module but nothing else (except redshifting) # an SFH and an SSP module but nothing else (except redshifting)
redshift = sed.info['redshift'] redshift = sed.info['universe.redshift']
# Wavelengths are in nanometers. # Wavelengths are in nanometers.
wavelength = sed.wavelength_grid wavelength = sed.wavelength_grid
# Luminosity is is W/nm. # Luminosity is is W/nm.
......
...@@ -177,9 +177,10 @@ class Redshifting(CreationModule): ...@@ -177,9 +177,10 @@ class Redshifting(CreationModule):
redshift = self.redshift redshift = self.redshift
# If the SED is already redshifted, raise an error. # If the SED is already redshifted, raise an error.
if 'redshift' in sed.info and sed.info['redshift'] > 0.: if ('universe.redshift' in sed.info and
sed.info['universe.redshift'] > 0.):
raise Exception("The SED is already redshifted <z={}>." raise Exception("The SED is already redshifted <z={}>."
.format(sed.info['redshift'])) .format(sed.info['universe.redshift']))
# Raise an error when applying a negative redshift. This module is # Raise an error when applying a negative redshift. This module is
# not for blue-shifting. # not for blue-shifting.
...@@ -195,7 +196,7 @@ class Redshifting(CreationModule): ...@@ -195,7 +196,7 @@ class Redshifting(CreationModule):
sed.luminosities /= 1. + redshift sed.luminosities /= 1. + redshift
sed.luminosity /= 1. + redshift sed.luminosity /= 1. + redshift
sed.add_info("redshift", redshift) sed.add_info("universe.redshift", redshift)
sed.add_info("universe.luminosity_distance", self.luminosity_distance) sed.add_info("universe.luminosity_distance", self.luminosity_distance)
sed.add_info("universe.age", self.universe_age) sed.add_info("universe.age", self.universe_age)
......
...@@ -280,8 +280,9 @@ class SED(object): ...@@ -280,8 +280,9 @@ class SED(object):
# avoid having the resample the filter every time on the optimal grid # avoid having the resample the filter every time on the optimal grid
# (spectrum+filter), we store the resampled filter. That way we only # (spectrum+filter), we store the resampled filter. That way we only
# have to resample to spectrum. # have to resample to spectrum.
if 'redshift' in self.info: if 'universe.redshift' in self.info:
key = (wavelength.size, filter_name, self.info['redshift']) key = (wavelength.size, filter_name,
self.info['universe.redshift'])
dist = self.info['universe.luminosity_distance'] dist = self.info['universe.luminosity_distance']
else: else:
key = (wavelength.size, filter_name, 0.) key = (wavelength.size, filter_name, 0.)
......
...@@ -77,7 +77,8 @@ def save_sed_to_vo(sed, filename, norm=1.): ...@@ -77,7 +77,8 @@ def save_sed_to_vo(sed, filename, norm=1.):
# If there is a stellar population then the norm factor is the stellar # If there is a stellar population then the norm factor is the stellar
# mass. # mass.
votable.infos.append(Info(name="Galaxy mass in Msun", value=norm)) votable.infos.append(Info(name="Galaxy mass in Msun", value=norm))
votable.infos.append(Info(name="Redshift", value=sed.info['redshift'])) votable.infos.append(Info(name="Redshift",
value=sed.info['universe.redshift']))
for name, value in sed.info.items(): for name, value in sed.info.items():
if name in sed.mass_proportional_info: if name in sed.mass_proportional_info:
votable.infos.append(Info(name=name, value=norm * value)) votable.infos.append(Info(name=name, value=norm * value))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment