JWH June 2014

Notes on tricking the raytracing to perform a long path or cell forward model
calculation

SFIT is designed to take a model atmosphere (default filename: reference.prf)
that is a set of mixing ratios, pressures and temperatures at a specified set of
altitudes

It takes another 2 files an internal altitude grid (default filename:
station.layers) and a spectrum (default filename: t15asc.4) as input, and
performs the following operations

1. from the t15 file it gets the lat, lon, datetime, solar zenith angle and
radius of the earth, from this it calculated a refracted ray to the astronomical
solar position

2. along this path it calculates the airmass of each layer specified in the grid
from the station. layers file

3. it also calculates a weighted temperature, pressure, and mixing ratio in each
of those layers

4. it calculates the airmass in a vertical path through the same model
atmosphere, the temperature, and pressure are the same

A. sfit uses the slant path to calculate the optical depth in each layer to
approximate the observed spectrum

B. it uses the vertical path to calculate the total vertical column of the
retrieved species

We can trick the raytracing into looking at a long path, finite path or cell
type of observation by doing the following:

1. in the t15 change the solar zenith angle to 0.0, the datetime, radius of the
earth do not matter

2. in the station.layers file give only 2 layers, that looks like:

Mean model surface :     2.0588
02
i     level     thick    growth    midpnt
1    1.6130    0.5732    0.0000    1.6125
2    1.6120    0.0000    0.0000    0.0000

this will calculate a synthetic spectrum for a 1 meter path.  Note the thick /
growth columns do not matter.

I use the values of 1.612 / 3 because they are encompassed by the reference.prf
file I am using (this is the one for Boulder).  See more below.

The levels in the reference.prf file need to encompass the path you are
modeling.  If we use the testcase here we are modeling a 1 meter horizontal path
at local pressure for 1.6km altitude, and the standard atmosphere that we have
from te NDACC.  Note that

1. the altitudes in the reference.prf file match the altitudes in the
stations.layers file - this gives better control on the path

2. the pressure is different by .0001 mb - the raytrace seems to want declining
pressures with altitude.  so Note that thee raytrace still looks at these as
layers in an ascending altitude grid.  I may look into this more.

3. Same for the temperature and mixing ratios, they are on the altitude grid you
now specify so the second value is for the temperature and vmr's at 1.6130

This can be generalized *I believe* to two or more horizontal layers if you
want.

see plot pltfits.ps

I used a synthetic spectrum slightly different from the modeled one to fit.
Use pltfits.pro to plot just the fit





