/*
	-Header: 

	File   : [[/home1/jaccard/data1/codas3/gfi/devel/include/extract.h]]
	Content: Extract Utility Function
	Author : Pierre Jaccard (jaccard@gfi.uib.no)
	Version: 0.1
	Date   : [[Last updated on 98/04/07 at 08:24:06 by jaccard@pc34.gfi.uib.no]]

	-Introduction:

	Control file for [[extract]], the utility for extracting data from
	a CODAS database.
	
	------------------------------------------------------------------

	year_base: <YYYY>
	dbname:    <database name with path>
	step_size: <number of profile to move at each step>


	OPTIONS:

		variable:      {columnar output of one or several variables}
		   no_bad      {output only if all variables are defined   }
			combined    {output only minimium amount of values      }
			file:    <file name>
		   var:			
			   name: <name of variable>
				min=  <minimum value for output>
				max=  <maximum value for output>
			end
			var:
			   ...
			end
			...
		end
							
		contour:       {output for contour}
			file: <file name>
		   X: 			   
				name: <name of variable>
				min=  <minimum value for output>
				max=  <maximum value for output>
			end
			Y: 
				name: <name of variable>
				min=  <minimum value for output>
				max=  <maximum value for output>
		   end
			Z:
				name: <name of variable>
				min=  <minimum value for output>
				max=  <maximum value for output>
			end
			Z:
			   ...
			end
			...
		end
		
		profile:       {output for profile}
			file: <file name>
		   X: 			   
				name: <name of variable>
				min=  <minimum value for output>
				max=  <maximum value for output>
			end
			Y: 
				name: <name of variable>
				min=  <minimum value for output>
				max=  <maximum value for output>
		   end
		   Y:
			   ...
			end
			...
		end
	end
	
	DESCRIPTION:

	All data are rescaled and output in FLOAT format.
	
	The variable name above is specified as the name of the variable,
	as it is defined in the database. In case of a structure element,
	the name of the element follows the name of the variable. Both are
	separated by a '.':

			name: DEPTH

	will retrieve all depth values from the database, while

		   name: ANCILLARY_1.tr_temp
	
	will retrieve the transducer temeprature. You can specifiy places
	for which you want to retrieve the values of a variable. These
	places can be specified by a cell number or the value of the
	variable itself. For example:

	      name: DEPTH:{2, 10, 50}

	will retrieve depth values from cell '2', '10', and '50', while

		   name: DEPTH:{2.0, 10.0, 50.0}

	will retrieve depth values at '2m', '10m' and '50m' (assuming that
	DEPTH is given in meters). Since values are not always known and
	may not have the same value as specified, a tolerance can be
	specified as in

		   name: DEPTH:{(1.0), 2.0, 10.0, (5.0), 50.0}
			
	which will retrieve depth values within [1m,3m], [9m,11m] and
	[45m,55m]. When using these specified location, the rest of the
	data is not deleted, but just filtered out by setting it to bad
	values. Use the [[no_bad]] option to avoid output of these. For
	example, specifiying variable 'U' and 'no_bad' option together with
	the previous example will output only velocities at the specified
	depths (if falling within the psecified ranges).

	The [[combined]] option will output the amount of data
	corresponding to the minimum data number. For example, specifying
	variables 'DEPTH' and 'ANCILLARY_1.tr_temp' together with this
	option will output only the value of the first depth cell, since
	there is only one transducer temperature value for each profile.
	Unexistant data of this kind can be output as '-1.0E38' instead by
	specifying the [[undefined]] option.

	Further filtering may be done by specifying minimal and maximal
	values with the 'min=' and 'max=' options. These may be set to a
	value or to another variable name form the database. For example,
	
			name: DEPTH
			min=  ACCESS_VARIABLES.first_good_bin
			max=  ACCESS_VARIABLES.last_good_bin

	will retrieve depth values within the 'first_good' and 'last_good'
	bins. These must of course be existant and defined. As before,
	values outside this range are not deleted but flagged as bad. The
	[[no_bad]] option can be used to avoid their output.

	The following additionnal variable names can be used:

			LONGITUDE
			LATITUDE

	The option [[separate]] writes a '%' between each profile.

	The option [[file:]] must specify a file name for output. If
	absent, output is redirected to screen.
	
	PRODUCTS:
	
		* VARIABLE: 
		  This generates a columnar output with the values of each
		  variable in each column. Lines containing only bad, unexistant
		  or data outside range are not output.

		* PROFILE:
		  This generate a columnar output with an 'X' variable in column
		  #1 and one or several 'Y' variables in the next columns. The
		  use of [[combined]] and [[no_bad]] affects only 'Y' variables.
		  Lines with bad 'X' values are not output.

		* CONTOUR:
		  This generates a columnar output with 'X' and 'Y' data in
		  column #1 and #2, and one or several 'Z' variables in the next
		  columns. The use of [[combined]] and [[no_bad]] affects only
		  'Z' variables. Lines with bad 'X' and/or 'Y' values are not
		  output. Unlike the two previous products, if there are more
		  data than 'X' and/or 'Y' values, the index to these are reset.

	------------------------------------------------------------------
	*/

 year_base: 1998
 dbname:    ../ctddb/svin
 step_size: 1


 OPTIONS:

    variable:
       file: ts.tll
       longitude_180
       var:
          name: TIME
       end
       var:
          name: LONGITUDE
       end
       var: 
          name: LATITUDE
       end
    end
    
    profile:
       file: ts.prf
       no_bad
       X:
          name: P
	  min= 0.0
	  max= 500.0
       end			   
       Y:
          name: TEMPERATURE
       end
       Y:
          name: SALINITY
       end
    end
 end
	

 1998/04/19 06:45:00 to 1998/04/19 06:55:00
	







