#Dieses script wandelt "hdf files" der site ...auc.dfd.dlr.de in "tdf files" um. Der
#Wert 255 ist bereits als "Bad" deklariert. Ausserdem sind "scale factor" und "scale
#offset" bereits festgelegt.08052001.

#! /bin/csh -f

cd /home/vaa2/prakti/



foreach file (g??????g.hdf)

	hdftotdf \
        	include_vars= \
	        shortname='yes' \
		$file ${file}.tdf
	
	copyxfm master_file=/home/vaa2/prakti/global_master ${file}.tdf
	
	editdim	\
		dimname='longitude' \
		newname='sample' \
		varname= \
		scale= \
		offset=	\
		coord='2' \
		${file}.tdf

	editdim	\
		dimname='latitude' \
		newname='line' \
		varname= \
		scale= \
		offset= \
		coord='3' \
		${file}.tdf
		
	fastreg2 \
        	master_file=/home/vaa2/prakti/Northpole2.master \
        	master_var= \
        	include_vars='o3_tot' \
        	brute_force='yes' \
        	poly_size='10' \
        	interpolate='nn' \
        	off_protect='no' \
        	whole_input='no' \
        	add_to_output='no' \
		${file}.tdf ${file}_dobson
  	
		
	#emathp \
		#expr_vars='latitude_var longitude_var o3_tot' \
		#num_exprs='3' \
		#y1_expr='x1' \
		#y2_expr='x2' \
		#y3_expr='2.165*x3+50' \
		#save_exprs='1 2 3' \
		#var_names='latitude_var longitude_var o3_tot' \
		#var_units='- - Dobson_units' \
		#var_types='byte byte byte' \
		#scale_offsets='0 0 50' \
		#scale_factors='1 1 0.462' \
		#${file}.fr ${file}_dobson
	#emath \
		#expr_vars='o3_tot' \
		#expression='(x1 <= 300) ? x1 : (2.165*x1+50) && (x1 <= 600)  ? badval : x1' \
		#var_name='o3_tot' \
		#var_units= \
		#var_type= \
		#offset='0' \
		#scale_factor='1' \
		#${file}_dobson ${file}_d300 
		
#rm g??????g.hdf.fr
rm g??????g.hdf.tdf
end
ls
