diff --git a/doc/dataformat.rst b/doc/dataformat.rst index d5039d9f..36ea4ac2 100644 --- a/doc/dataformat.rst +++ b/doc/dataformat.rst @@ -7,7 +7,7 @@ The `Observation` class |Codename| expects the data in the form of list of ``Observations``, preferably returned by :py:meth:`build_obs` (see below). Each Observation instance -corresponds to single dataset, and is basically a namespace that also supports +corresponds to a single dataset, and is basically a namespace that also supports dict-like accessing of important attributes. In addition to holding data and uncertainties thereon, they tell prospector what data to predict, contain dataset-specific information for how to predict that data, and can even store @@ -58,7 +58,8 @@ models, jitter terms, or covariant noise. - ``name`` A string that can be used to identify the dataset. This can be useful for - dataset-specfic parameters. + dataset-specfic parameters. By default the name is constructed from the + `kind` and the memory location of the object. - ``resolution`` For a `Spectrum` this defines the instrumental resolution. Analagously to diff --git a/prospect/models/sedmodel.py b/prospect/models/sedmodel.py index 531e2525..2ec883d6 100644 --- a/prospect/models/sedmodel.py +++ b/prospect/models/sedmodel.py @@ -682,6 +682,9 @@ def add_dla(self, wave_rest, spec): spec *= np.exp(-tau) return spec + def add_damping_wing(self, wave_rest, spec): + pass + def observed_wave(self, wave, do_wavecal=False): """Convert the restframe wavelngth grid to the observed frame wavelength grid, optionally including wavelength calibration adjustments. Requires diff --git a/tests/test_io.py b/tests/test_io.py index a99d307c..97ccbb9e 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -54,8 +54,14 @@ def test_observation_io(build_sps, plot=False): obslist = build_obs(multispec=True) model = build_model(add_neb=True) + fn = "./test.h5" # obs writing - with h5py.File("test.h5", "w") as hf: + with h5py.File(fn, "w") as hf: write_obs_to_h5(hf, obslist) - with h5py.File("test.h5", "r") as hf: + # obs reading + with h5py.File(fn, "r") as hf: obsr = obs_from_h5(hf["observations"]) + + # cleanup? + import os + os.remove(fn) \ No newline at end of file