From 01191ace1a5af44a7dd7d04d05880c08daa87dce Mon Sep 17 00:00:00 2001 From: atharva-2001 Date: Fri, 20 Aug 2021 19:10:22 +0530 Subject: [PATCH] Specify units in docstrings --- tardis/visualization/tools/sdec_plot.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tardis/visualization/tools/sdec_plot.py b/tardis/visualization/tools/sdec_plot.py index 9697ff424d2..966f60e3823 100644 --- a/tardis/visualization/tools/sdec_plot.py +++ b/tardis/visualization/tools/sdec_plot.py @@ -1109,7 +1109,8 @@ def generate_plot_mpl( observed_spectrum : tuple or list of astropy.Quantity, optional Option to plot an observed spectrum in the SDEC plot. If given, the first element should be the wavelength and the second element should be flux, - i.e. (wavelength, flux) + i.e. (wavelength, flux). The assumed units for wavelength and flux are + angstroms and erg/(angstroms * s * /cm^2), respectively. Default value is None. show_modeled_spectrum : bool, optional Whether to show modeled spectrum in SDEC Plot. Default value is True @@ -1187,7 +1188,10 @@ def generate_plot_mpl( if observed_spectrum: if distance is None: raise ValueError( - "Distance must be specified if an observed_spectrum is given" + """ + Distance must be specified if an observed_spectrum is given + so that the model spectrum can be converted into flux space correctly. + """ ) observed_spectrum_wavelength = None @@ -1501,7 +1505,8 @@ def generate_plot_ply( observed_spectrum : tuple or list of astropy.Quantity, optional Option to plot an observed spectrum in the SDEC plot. If given, the first element should be the wavelength and the second element should be flux, - i.e. (wavelength, flux) + i.e. (wavelength, flux). The assumed units for wavelength and flux are + angstroms and erg/(angstroms * s * /cm^2), respectively. Default value is None. show_modeled_spectrum : bool, optional Whether to show modeled spectrum in SDEC Plot. Default value is True @@ -1582,7 +1587,10 @@ def generate_plot_ply( if observed_spectrum: if distance is None: raise ValueError( - "Distance must be specified if an observed_spectrum is given" + """ + Distance must be specified if an observed_spectrum is given + so that the model spectrum can be converted into flux space correctly. + """ ) observed_spectrum_wavelength = None