From 65f03784a94f5b50592776291a436c99393e118e Mon Sep 17 00:00:00 2001 From: Simon Proud Date: Mon, 30 Oct 2023 16:20:09 +0000 Subject: [PATCH 1/2] Update the solar spectrum code to use the (included) 2000 ASTM Standard Extraterrestrial Spectrum Reference. --- pyspectral/solar.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pyspectral/solar.py b/pyspectral/solar.py index f7734b2f..ed639544 100644 --- a/pyspectral/solar.py +++ b/pyspectral/solar.py @@ -48,15 +48,21 @@ class SolarIrradianceSpectrum(object): in units of W/m^2/micron """ - def __init__(self, filename, **options): + def __init__(self, filename=TOTAL_IRRADIANCE_SPECTRUM_2000ASTM, **options): """Initialize the top of atmosphere solar irradiance spectrum object from file. + By default, this will use the following spectra: + 2000 ASTM Standard Extraterrestrial Spectrum Reference E-490-00 + + To use a different spectra, specify the `filename` when initialising the class. + Input: - filename: Filename of the solar irradiance spectrum + filename: Filename of the solar irradiance spectrum (default: 2000 ASTM) dlambda: Delta wavelength: the step in wavelength defining the resolution on which to integrate/convolute. + """ self.wavelength = None self.wavenumber = None From 14cdb4c77914d03a220b7d2f34aefa8a69ba989f Mon Sep 17 00:00:00 2001 From: "Adam.Dybbroe" Date: Mon, 27 Nov 2023 20:36:41 +0100 Subject: [PATCH 2/2] Improve doc-string explaining the use of possible key word arguments Signed-off-by: Adam.Dybbroe --- pyspectral/solar.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pyspectral/solar.py b/pyspectral/solar.py index ed639544..c4b32903 100644 --- a/pyspectral/solar.py +++ b/pyspectral/solar.py @@ -2,7 +2,7 @@ # # -*- coding: utf-8 -*- # -# Copyright (c) 2013-2022 Pytroll developers +# Copyright (c) 2013-2023 Pytroll developers # # # This program is free software: you can redistribute it and/or modify @@ -58,10 +58,16 @@ def __init__(self, filename=TOTAL_IRRADIANCE_SPECTRUM_2000ASTM, **options): Input: filename: Filename of the solar irradiance spectrum (default: 2000 ASTM) - dlambda: - Delta wavelength: the step in wavelength defining the resolution on - which to integrate/convolute. - + options: + dlambda: + Delta wavelength: the step in wavelength defining the resolution on + which to integrate/convolute. + Default is 0.005 if 'wavespace' is 'wavelength' and 2.0 if 'wavenumber'. + wavespace: + It is possible to specify if the solar irradiance spectrum should + be given in terms of wavelength (default) or in terms of + wavenumber. If the latter is desired 'wavespace' should be set to + 'wavenumber'. """ self.wavelength = None