kvant
Only the visible changes are documented here, latest changes first.
revision 1.22 date: 1998/02/24 Renamed from fitart to kvant. ASCII output file formats slightly changed: Second line in header: format info replaced by audit trail. Solar angles now BEFORE latitude/longitude (main output file). Version information from *.cl1 file is copied to output files. Actual window is written to output files. revision 1.21 date: 1998/02/12 Performance optimisation revision 1.19 date: 1997/12/31 Max. number of reference spectra increased from 5 to 7. New fit mode "SINGLE": shift/squeeze for current (earthshine) spectrum only. Default fit mode changed to LINEAR. Syntax of keyword TRACE slightly changed: 1. degree of polynomial now optional, default value -1 (no individual polynomial). 2. duplicate file names allowed if file columns differ. Comment lines starting with two asterisks will be copied from the configuration file to the main output file(s). New keyword VERBOSE. Output of covariance matrices and fit results on screen only if VERBOSE is set to .TRUE. revision 1.18 date: 1997/12/05 Linear fit error calculation corrected for smoothing: number of spectral points m has to be divided by effective width of smoothing window. revision 1.17 date: 1997/11/26 Smoothing option added: New keyword SMOOTH. Available filters: box (running average), triangle, 4th order symmetric Savitzky-Golay, lowpass Smoothing can be switched OFF (but not ON!) for each trace gas individually: NOSMOOTH option for TRACE keyword. To be used with presmoothed references.
KVANT is a remote sensing tool designed to retrieve atmospheric trace gas amounts from high-resolution spectra. It can be used for any kind of remote sensing measurements in the UV/visible part of the spectra, ground-based as well as satellite measurements. The main outputs of the program are trace gas slant column densities (SC) which can be converted into vertical column densities (VC) by applying an Air Mass Factor (AMF). The AFM is a wavelength-dependent quantity. It can be calculated for ground-based or satellite geometry by using an adequate Radiative Transfer Model (e.g. SCIATRAN).
KVANT uses the Differential Optical Absorption Spectroscopy (DOAS) method, which applies the Lambert-Beer Law as an approximated description of attenuation of solar radiation within the earth atmosphere. Taking the logarithm of the Lambert-Beer Law yields a linear relation between atmospheric optical depth and trace gas amounts under certain assumptions. Absorption cross-sections of the trace gases under consideration, which can be measured in the laboratory for different conditions, are fitted to the measured optical depth in terms of least-squares. A discrimination between fine-scale und broad-band spectral features is defined using a polynomial, which is simultaneously fitted to the measurement. Subtracting the polynomial from the spectrum gives the Differential spectrum which mainly contains information about the atmospheric trace gas amounts. The main assumptions are: relatively weak trace gas absorption and absorption cross-sections which are weakly dependent on height (temperature).
In other words, the depth of absorption structures in measurements of atmospheric optical properties enables to estimate trace gas amounts using the knowledge about their absorption cross-sections and a polynomial fit to derive differential spectra.
Using GOME or SCIAMACHY satellite measurements a wavelength miss-calibration between ground laboratory measurements, solar irradiance and earth radiance measurements have to be sometimes considered, depending on the quality of the data. These can be corrected by KVANT using a shift and squeeze correction scheme, applying a non-linear least-squares fitting in terms of wavelength.
Pre-requisites are:
Unpack the KVANT archive. AskGet the archive from: here Change into directory ./f90/make.
Typegmake f90to convert the modules ../modules/*.F90 into valid Fortran code (specific for your system) and to generate dependency files. Type
gmake program=kvantto generate an executable of kvant. Type lv1_conv or lv2_conv instead of kvant in order to generate the according executables if needed. After installation you will find the executable under ./bin. You may copy the executable to another directory, e.g. /usr/local/bin. The NetCDF and Pgplot libraries are implemented as dynamic libraries (to be linked during runtime). Make sure that your LD_LIBRARY_PATH system variable contains the location of the needed libraries, e.g. /usr/local/lib. Further installation instructions: see Makefile (./f90/make/Makefile).
lv1_conv
.
Take care to extract at least the fitting window plus some safety margin
(5 nm) on both sides.
kvant.cfg
in your current directory. All settings controlling program execution
are made there.
See section The configuration file.
kvant
from where it is installed, for example:
/user/local/bin/kvantYou may find it convenient to define an alias for this or to add the path to your search path for executables.
kvant
has
been started). However, you can specify another name for the configuration
file on the command line. For a detailed description:
section `Configuration files' in GOME related software: Introduction,
and section The configuration file.
X
(for extended) is appended to the
name to avoid naming conflicts with the main output file.
Details on the naming, the general configuration file syntax, and keywords used by several programs are described in section `Configuration files' in GOME related software: Introduction, which should be consulted first.
All lines defining configuration parameters are copied from the configuration file into the main output file header(s). This allows you to repeat a fit using the same settings even when the original configuration file has been lost (provided its syntax has not changed in the meantime...). Simply extract the relevant lines from the header and remove the leading asterisks.
Normally, comment lines are not copied from the configuration file
into the main output file. If you want a comment line to be copied,
precede it with two asterisks (**
) instead of one.
The following keywords are available:
ID BACKGROUND CURRENT TRACE MAINOUT EXTOUT MODE WINDOW DEGPOLY TOF VERBOSE
With some of these keywords, sub-keywords are used. Sub-keywords are
PATH FILE EXTENSION ALL ORBIT TIME AVERAGE SHSQ_LIMITS GROUNDPIXEL SUBSET SOLAR_ZENITH LATITUDE LONGITUDE DISTANCE
At present, the name of the file containing the background spectrum must be explicitly given. Some time in the future there may be automatic determination of a suitable background spectrum, e.g. the nearest available solar spectrum.
BACKGROUND PATH bkg-path[+][+]
PATH
.
If you use both `BACKGROUND PATH' and `BACKGROUND FILE',
bkg-filename must not contain a path.
BACKGROUND EXTENSION bkg-extension
BACKGROUND FILE bkg-filename
BACKGROUND GROUNDPIXEL ...
BACKGROUND SUBSET ...
BACKGROUND SOLAR_ZENITH ...
BACKGROUND LATITUDE ...
BACKGROUND LONGITUDE ...
BACKGROUND DISTANCE ...
CURRENT PATH cur-path[+][+]
CURRENT EXTENSION cur-extension
CURRENT {FILE | ALL | TIME | ORBIT} ...
FILE
if you want to evaluate a single file.
Use one of the other sub-keywords (see section `Keywords for selecting orbits' in GOME related software: Introduction),
if you want to evaluate several files (orbits).
In this case, their basenames (up to 8 characters) are read from
the table of orbits and filenames (TOF).
cur-path and cur-extension are then added to the basename.
CURRENT FILE cur-filename
CURRENT SHSQ_LIMITS min-sh max-sh [min-sq max-sq]
MODE LINEAR
below).
It is possible to keep shift and/or squeeze for the
current spectrum at a fixed value (exclude them from the nonlinear fit)
the same way as the trace gas references: by setting minimum and maximum
to the same value. This feature, however, will only be needed for
sensitivity studies.
CURRENT AVERAGE avg
CURRENT GROUNDPIXEL ...
CURRENT SUBSET ...
CURRENT SOLAR_ZENITH ...
CURRENT LATITUDE ...
CURRENT LONGITUDE ...
CURRENT DISTANCE ...
TRACE PATH trace-path
TRACE id trace-filename [[column-number] degpoly [min-sh max-sh [min-sq max-sq]]] [NOSMOOTH]
O3
, NO2
, OClO
, Ring
, etc.) as identifier.
In some cases, e.g., when fitting several temperatures or base functions
simultaneously, you may need be more precise, like O3-221K
,
O3-273K
, Ring-A
, Ring-B
, etc.
id is used only for making screen and file output
better readable, because it's shorter than the filename.
trace-filename is the name of the file containing the reference
spectrum in xy-ASCII format. If trace-path has been specified and
trace-filename is a relative path, i.e., it does not start with
a slash, trace-path will be prepended to trace-filename.
column-number is the column in trace-filename, from which
the reference spectrum is to be read. Its default value is 2,
i.e., the reference is read from the second column.
Note that the wavelength is always read from the first column.
degpoly is the degree of the polynomial, which is subtracted from
the reference spectrum to make it "differential". This happens before
the fit. The number of polynomial coefficients is degpoly +1.
By default, degpoly is -1, i.e., no individual polynomials
at all are subtracted. This is recommended, as subtracting polynomials
from each reference is both redundant and time-consuming. Therefore
this feature will be completely removed from kvant soon.
min-sh and max-sh are the shift limits for the reference,
given in nm. They specify the range, within which the nonlinear fit
is allowed to vary the shift parameter for this reference.
If you want to shift this reference by a fixed value and keep there,
set both min-sh and max-sh to this value. In this case
(min-sh = max-sh), the shift value is excluded from the
nonlinear fit.
min-sq and max-sq are the squeeze limits for the reference,
given in nm. They specify the range, within which the nonlinear fit
is allowed to vary the squeeze parameter for this reference.
If you want to squeeze this reference by a fixed value (and keep there),
set both min-sq and max-sq to this value. In this case
(min-sq = max-sq), the squeeze value is excluded from the
nonlinear fit.
Shift and squeeze limits are zero (!) by default (no shift and squeeze).
For the fit modes LINEAR
and SINGLE
(see below),
fixed shifts and squeezes in the middle of the specified ranges are used.
For the fit mode COUPLED
, shifts and squeezes given with the
TRACE
keyword are ignored.
Specifying NOSMOOTH
switches off the smoothing (if any) for
this trace gas reference. This is intended to be used for
references smoothed in advance. Take care that any pre-smoothing
and smoothing within kvant are performed exactly the same way
(with respect to filter type and width).
ID fit-identifier
MAINOUT {ASC | BIN | NONE}
BIN
is currently not available,
because binary output is under reconstruction. Sorry for the inconvenience!
Select ASCII (ASC
) or binary (BIN
) output format
for the main output file, or do not write main output file at all
(NONE
). The default value is ASC
.
MAINOUT PATH mainout-path[+][+]
EXTOUT {ASC | BIN | NONE}
ASC
) or binary (BIN
) output format
for the extended output file, or do not write extended output file at all
(NONE
). The default value is NONE
.
EXTOUT PATH extout-path[+][+]
SMOOTH width [filter]
NOSMOOTH
will be smoothed
over width points in a way determined by filter.
width has to be an odd integer not smaller than 3 for all filters
except the lowpass. For the lowpass filter, width has to be a positive
number (not necessarily integer).
filter is one of BOX | TRI | SAV | LOW
, selecting boxcar
(running average), triangular, Savitzky-Golay and lowpass smoothing,
respectively. The default is TRI
. The first three filters are
applied on the spectra in the wavelength domain. The lowpass filter
is applied in the wavenumber domain: The spectrum is Fourier transformed,
a Welch filter is applied on the wavenumbers, and the wavenumbers
are Fourier transformed back to wavelengths.
MODE {LINEAR | SINGLE | INDIVIDUAL | COUPLED min-sh max-sh [min-sq max-sq]}
LINEAR
(2). The recommended
mode is SINGLE
. Note that execution time increases with the number
of nonlinear parameters.
MODE LINEAR
selects the linear fit mode. Shift and squeeze values
are not fitted. Instead, they are kept fixed at the mean values of their
limits, (min-sh+max-sh)/2, and (min-sq+max-sq)/2,
respectively. This refers both to the current spectrum (limits given
with the CURRENT SHSQ_LIMITS
keyword) and to each reference
(limits given with the TRACE
keyword).
MODE SINGLE
selects a restricted nonlinear fit mode.
The current (earth radiance) spectrum is shifted and squeezed
within the limits given with the CURRENT SHSQ_LIMITS
keyword.
Shifts and squeezes of the reference spectra are kept fixed at the
mean values of their limits, as described for the linear fit mode.
MODE COUPLED
min-sh max-sh [min-sq max-sq] selects a restricted
nonlinear fit mode. A common shift value and a common squeeze value are
fitted for all references, i.e., they are shifted and squeezed together.
The given limits are those for the common shift and squeeze values.
Their default value is zero. Any shift and squeeze limits for the references
given with the TRACE
keyword are ignored.
Note that shift and squeeze for the current spectrum are still
determined separately: they are not coupled to those of the references,
and their limits have to be specified with the CURRENT SHSQ_LIMITS
keyword. This mode is not very useful. It is retained mainly for historical
reasons.
MODE INDIVIDUAL
selects the general nonlinear fit mode.
Shift and squeeze parameters for each reference and for the current spectrum
are fitted independently. Shift and squeeze limits for the references
are given with the TRACE
keyword for each reference separately.
Shift and squeeze limits for the current spectrum are given with the
CURRENT SHSQ_LIMITS
keyword. Use this mode with great care
and only if you know what you are doing. All kinds of artifacts are
waiting for you.
kvant automatically switches from INDIVIDUAL
to SINGLE
mode in case all reference spectra are held fixed (e.g., by omitting
their shift and squeeze limits). If in addition the current spectrum
is held fixed, kvant automatically switches to the LINEAR
mode.
WINDOW start-wavelength end-wavelength
DEGPOLY overall-degpoly
TRACE
keyword. Its default value is 2 (quadratic).
The number of polynomial coefficients is overall-degpoly + 1.
An example of a valid configuration file is given below. Note that it is intended as an illustration rather than containing useful settings!
** Configuration file for kvant.f90, OClO, Antarctica ID oclo-04 * TOF index BACKGROUND PATH /home/eisinger/gome++ BACKGROUND FILE 50915115 BACKGROUND EXTENSION cl1 BACKGROUND SOLAR_ZENITH 69 71 BACKGROUND LATITUDE 0 90 CURRENT PATH /home/eisinger/gome++ CURRENT TIME 50915 CURRENT EXTENSION cl1 CURRENT LATITUDE -90 -60 CURRENT SHSQ_LIMITS -0.15 0.15 -0.15 0.15 TRACE PATH /home/eisinger/spectra TRACE OClO new/iup/oclo_217.vac TRACE NO2 gome_fm/no2_241.vac TRACE O4 ref/o4.vac * TRACE Ring ref/ring_2v.asc 1 -0.1 0.1 -0.1 0.1 NOSMOOTH MAINOUT PATH /home/eisinger/gome/results+ MAINOUT ASC EXTOUT PATH /home/eisinger/tmp EXTOUT NONE SMOOTH 3 LOW MODE SINGLE WINDOW 355 385 DEGPOLY 3 VERBOSE T
In the configuration file, shift and squeeze have to be given in nanometers.
The shifted and squeezed wavelength x'
is calculated from
the original wavelength x
as
x' = x + sh + 2 sq (x - c) / w
where c
is the window center wavelength and w
the window
width.
The interpretation of a shift by sh is straightforward. A squeeze by sq refers to the upper margin of the fitting window. This means, the squeeze introduces an additional "shift" of sq at the upper margin, -sq at the lower margin and zero in the window center. "No squeeze" means sq = 0.
If you need to
fit more than seven references, increase the constant
NTRACESMAX
in Fortran source file `kvant.f90'
and rebuild the executable file.
This follows from the zero default values for shift and squeeze.
This document was generated on 24 Febuary 1998 using the texi2html translator version 1.51.