Products
========

There are two ways that a product can be related to a system: *directly* or *indirectly*.

A **directly** connected product (or **primary** product) is linked to a 
system. When a measurement is processed, a file will be created containing the 
retrieved quantities of this product.

A **indirectly** connected product (or **secondary** product) is used in the 
definition of a composite, more complex, product. For example, an "extinction" product
can be used to define a "lidar ratio and extinction" product. In this case the
"lidar ratio and extinction" product is the *primary* product (directly linked 
to a system), and the "extinction" product is the *secondary* product (only liked to 
the "lidar ratio and extinction" product). The output of a secondary product is not stored in a 
file. 

.. warning::
    You should avoid linking a product both *directly* and *indirectly* to the 
    same system. If you link a *secondary* product directly to a system, 
    the output of the SCC could be wrong, as two products could attempt to write 
    their output on the same file.
    
In the product list view, these information are summarized in two columns, labeled 
"Directly connected" and "Parent products".

Directly connected
   Will be green for **primary** products, i.e. if the product is directly 
   linked to a system.
   
Parent products
   If the product is a **secondary** product (i.e. it is part of a composite product) 
   this column will have a links to the related *primary* products.

.. note::
   **For administrators**: These two columns can be used to quickly spot "orphan"
   products, i.e. products that are neither linked to a system nor to a composite
   product. These products will not be available to any user to use, and should 
   be either connected to a system, or deleted. Orphan products will have *red*
   in the *Directly connected* column and "-" in the *Parent products* column. 

Adding a product
----------------

Depending on the product you need to produce, some of the following tables need to be filled. 


.. note::

   This section is not up-to-date to the latest interface version.

.. note::

   Each product should be connected to a system, either directly or indirectly, 
   before being saved.
   

Backscatter products
~~~~~~~~~~~~~~~~~~~~
The following tables need to be filed for the various backscatter products.

Backscatter calibrations 
~~~~~~~~~~~~~~~~~~~~~~~~
For backscatter (product types: Raman backscatter, Combined Raman backscatter and extinction, Elastic backscatter retrieval

LowestHeight   
   in meters, lowest height for reference height search

TopHeight
   in meters, maximum height for reference height search

WindowWidth
   in meters, width of the reference height interval

calValue
   backscatter ratio, e.g. 1 or 1.01
   
calRangeSearchMethod ID: 
   always 0
   
   
If done, you have to remember the ID for your backscatter calibration options an go the the specific tables below,

for product type 0 and 2: Raman_backscatter_options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Raman calculation method
   at the moment, only 1
   
bsc cal options
   insert ID from previous step
   
error method ID: 
   at the moment, only 1
   
for product type 3: elast_backscatter_options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 elast bsc method ID
   at the moment, only 1 (iterative approach)
   
bsc cal options
   insert ID from previous step
   
error method ID: 
   at the moment, only 1
      
lr input id:
   at the moment, only 1 (fixed LR)
   
fixed_lr
   ... in sr, value of the used lidar ratio
   
iter_bsc_options
   if, iterative approach is used, go to table iter_bsc_options and remember ID and insert here

iter_bsc_options
~~~~~~~~~~~~~~~~

iter conv crit
   ...e.g. 0.1 (=10%) The iteration is stopped when the RELATIVE difference between the actual and the previous column integrated backscatter coefficients is below this value

ram bsc method id
   at the moment, only 1
   
max iteration count: 
   maximum number of iteration steps   

for product type 1: Extinction options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Extinction method:
   Standard: 1, (0 weighted linear fit, 1 non-weighted linear fit, 2 difference quotient, 3 polynomial sec order fit, 4 quadratic function, 5 Savitzky-Golay filter, 6 Russo)

error method ID: 
   at the moment, only 1
   
overlap file ID:
   if overlap file is available, enter ID here
   
angstroem: 
   used angström value for the extinction calculation, e.g. 0,1, or 1.5
   
for product type 2: Ext bsc options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

product ID
   ID of product type 2
   
extinction option product ID
   ID of the extinction product (see table products)
   
raman backscatter options product ID
    ID of the Raman backscatter product (see table products)
    
error method ID: 
   at the moment, only 1
   
