%===============================================
%
% PLMR processing software suite (flight parameters)
%
% This file provides the flight details, such as time frame,
% correction parameters, etc. 
%
% This is not a program for distribution!!! 
%
% Author          Date           version
% C. R�diger      10-Nov-09      1.0
%
%===============================================

function [high_res_start,high_res_end,low_res_start,low_res_end, ...
    minE,maxE,minN,maxN,UTM,datum,s_bin, ...
    temp_corr, ...
    RTstart,RTend,GPS_offset, ...
    step,range_h,bins_h,range_v,bins_v,range_TIR,range_NDVI] ...
    =c_flight_params

[linux,preproc,ussr,p2sp,rasp,calib,anci,kml,plmr_pro,graphs,experi,geb,pol,res,chk,sve,plt,tpause]=c_input_arg;

%-----------------------------------
% set flight data for Nov'08 SMOS trip
%-----------------------------------

if (strcmp(geb,'Tran')==1)
    datum(1)=05;                    % day of month for start of GPS measurements in UTC
    datum(2)=1;                     % day offset to last GPS/UTC Sunday midnight ie. Mon=1 
    step=3;                         % ** define size of histogram bins
    high_res_start=79257100;        % ** start of high-resolution section in microsecs **ignore this
    high_res_end=82551000;          % ** end of high-resolution section in microsecs   **ignore this
    low_res_start=0;                % (set to 0 to take all data) start of low-resolution section in microsecs since last UTC midnight before GPS start
    low_res_end=172000000;          % (set to 172000000 to take all data) end of low-resolution section in microsecs since last UTC midnight before GPS start

    % set temp_corr(6)=1 and all others to zero for no base station correction
    temp_corr(1)=0.0;         % temperature correction parameters to be 
    temp_corr(2)=0.0;         % calculated via Excel, using the effective temperature
    temp_corr(3)=0.0;         % standardised to the 6am measurements. The equation is:
    temp_corr(4)=0.0;         % Tcorr=temp_corr(1)*Tb^5+temp_corr(2)*Tb^4+ ... + temp_corr(6)
    temp_corr(5)=0.0;        
    temp_corr(6)=1.0;          
    
    % obtain boundary information in UTM from OziExplorer (round to nearest 1000)
    minE=392000;                    % western boundary of the spatial data extent
    maxE=463000;                    % eastern boundary of the spatial data extent 
    minN=6116000;                   % southern boundary of the spatial data extent
    maxN=6222000;                   % northern boundary of the spatial data extent
    UTM='55 H';                     % set the UTM Zone (must be 4 digit)

    % adjust range by trial and error
    range_h=[180 290];              % plotting range for the colour scheme
    bins_h=[175:4:295];             % sampling range for the histograms
    range_v=[200 360];              
    bins_v=[200:8:360];
    range_TIR=[270 330];            % range of TIR for plotting purposes
    range_NDVI=[-1 1];              % range of NDVI for plotting purposes
    s_bin=1000;                     % bin size for spatial plots (it has to be a dimension of 1000 [ie. 10, 20, 50, ... , 1000])
    
    GPS_offset=15;                  % GPS time offset in seconds (since Jan 2009: 15 secs, before 14)
    RTstart=15591.02;               % start of RT data set in seconds since UTC midnight(to be calculated from the RT csv file
    RTend=27360.70;                 % end of RT data set in seconds since UTC midnight (to be calculated from the RT csv file

elseif (strcmp(geb,' R01')==1)

    datum(1)=06;                    % day of month for start of GPS measurements in UTC
    datum(2)=2;                     % day offset to last GPS/UTC Sunday midnight ie. Mon=1 
    step=3;                         % ** define size of histogram bins
    high_res_start=79257100;        % ** start of high-resolution section in microsecs **ignore this
    high_res_end=82551000;          % ** end of high-resolution section in microsecs   **ignore this
    low_res_start=6168509;                % (set to 0 to take all data) start of low-resolution section in microsecs since last UTC midnight before GPS start
    low_res_end=27137010;          % (set to 172000000 to take all data) end of low-resolution section in microsecs since last UTC midnight before GPS start

    % set temp_corr(6)=1 and all others to zero for no base station correction
    temp_corr(1)=0.0;         % temperature correction parameters to be 
    temp_corr(2)=0.0;         % calculated via Excel, using the effective temperature
    temp_corr(3)=0.0;         % standardised to the 6am measurements. The equation is:
    temp_corr(4)=0.0;         % Tcorr=temp_corr(1)*Tb^5+temp_corr(2)*Tb^4+ ... + temp_corr(6)
    temp_corr(5)=0.0;        
    temp_corr(6)=1.0;          
    
    % obtain boundary information in UTM from OziExplorer (round to nearest 1000)
    minE=392000;                    % western boundary of the spatial data extent
    maxE=463000;                    % eastern boundary of the spatial data extent 
    minN=6125000;                   % southern boundary of the spatial data extent
    maxN=6180000;                   % northern boundary of the spatial data extent
    UTM='55 H';                     % set the UTM Zone (must be 4 digit)

    % adjust range by trial and error
    range_h=[180 290];              % plotting range for the colour scheme
    bins_h=[175:4:295];             % sampling range for the histograms
    range_v=[200 360];              
    bins_v=[200:8:360];
    range_TIR=[270 330];            % range of TIR for plotting purposes
    range_NDVI=[-1 1];              % range of NDVI for plotting purposes
    s_bin=1000;                     % bin size for spatial plots (it has to be a dimension of 1000 [ie. 10, 20, 50, ... , 1000])
    
    GPS_offset=15;                  % GPS time offset in seconds (since Jan 2009: 15 secs, before 14)
    RTstart=3288.52;               % start of RT data set in seconds since UTC midnight(to be calculated from the RT csv file
    RTend=28606.20;                 % end of RT data set in seconds since UTC midnight (to be calculated from the RT csv file

elseif (strcmp(geb,' T01')==1)

    datum(1)=07;                    % day of month for start of GPS measurements in UTC
    datum(2)=3;                     % day offset to last GPS/UTC Sunday midnight ie. Mon=1 
    step=3;                         % ** define size of histogram bins
    high_res_start=79257100;        % ** start of high-resolution section in microsecs **ignore this
    high_res_end=82551000;          % ** end of high-resolution section in microsecs   **ignore this
    low_res_start=0;                % (set to 0 to take all data) start of low-resolution section in microsecs since last UTC midnight before GPS start
    low_res_end=172000000;          % (set to 172000000 to take all data) end of low-resolution section in microsecs since last UTC midnight before GPS start

    % set temp_corr(6)=1 and all others to zero for no base station correction
    temp_corr(1)=0.0;         % temperature correction parameters to be 
    temp_corr(2)=0.0;         % calculated via Excel, using the effective temperature
    temp_corr(3)=0.0;         % standardised to the 6am measurements. The equation is:
    temp_corr(4)=0.0;         % Tcorr=temp_corr(1)*Tb^5+temp_corr(2)*Tb^4+ ... + temp_corr(6)
    temp_corr(5)=0.0;        
    temp_corr(6)=1.0;          
    
    % obtain boundary information in UTM from OziExplorer (round to nearest 1000)
    minE=430000;                    % western boundary of the spatial data extent
    maxE=445000;                    % eastern boundary of the spatial data extent 
    minN=6120000;                   % southern boundary of the spatial data extent
    maxN=6140000;                   % northern boundary of the spatial data extent
    UTM='55 H';                     % set the UTM Zone (must be 4 digit)

    % adjust range by trial and error
    range_h=[180 290];              % plotting range for the colour scheme
    bins_h=[175:4:295];             % sampling range for the histograms
    range_v=[200 360];              
    bins_v=[200:8:360];
    range_TIR=[270 330];            % range of TIR for plotting purposes
    range_NDVI=[-1 1];              % range of NDVI for plotting purposes
    s_bin=100;                     % bin size for spatial plots (it has to be a dimension of 1000 [ie. 10, 20, 50, ... , 1000])
    
    GPS_offset=15;                  % GPS time offset in seconds (since Jan 2009: 15 secs, before 14)
    RTstart=1873.02;               % start of RT data set in seconds since UTC midnight(to be calculated from the RT csv file
    RTend=17514.50;                 % end of RT data set in seconds since UTC midnight (to be calculated from the RT csv file

elseif (strcmp(geb,' R02')==1)

    datum(1)=08;                    % day of month for start of GPS measurements in UTC
    datum(2)=4;                     % day offset to last GPS/UTC Sunday midnight ie. Mon=1 
    step=3;                         % ** define size of histogram bins
    high_res_start=79257100;        % ** start of high-resolution section in microsecs **ignore this
    high_res_end=82551000;          % ** end of high-resolution section in microsecs   **ignore this
    low_res_start=0;                % (set to 0 to take all data) start of low-resolution section in microsecs since last UTC midnight before GPS start
    low_res_end=172000000;          % (set to 172000000 to take all data) end of low-resolution section in microsecs since last UTC midnight before GPS start

    % set temp_corr(6)=1 and all others to zero for no base station correction
    temp_corr(1)=0.0;         % temperature correction parameters to be 
    temp_corr(2)=0.0;         % calculated via Excel, using the effective temperature
    temp_corr(3)=0.0;         % standardised to the 6am measurements. The equation is:
    temp_corr(4)=0.0;         % Tcorr=temp_corr(1)*Tb^5+temp_corr(2)*Tb^4+ ... + temp_corr(6)
    temp_corr(5)=0.0;        
    temp_corr(6)=1.0;          
    
    % obtain boundary information in UTM from OziExplorer (round to nearest 1000 - see s_bin variable below)
    minE=392000;                    % western boundary of the spatial data extent
    maxE=463000;                    % eastern boundary of the spatial data extent 
    minN=6125000;                   % southern boundary of the spatial data extent
    maxN=6180000;                   % northern boundary of the spatial data extent
    UTM='55 H';                     % set the UTM Zone (must be 4 digit)

    % adjust range by trial and error
    range_h=[180 290];              % plotting range for the colour scheme
    bins_h=[175:4:295];             % sampling range for the histograms
    range_v=[200 360];              
    bins_v=[200:8:360];
    range_TIR=[270 330];            % range of TIR for plotting purposes
    range_NDVI=[-1 1];              % range of NDVI for plotting purposes
    s_bin=1000;                     % bin size for spatial plots (it has to be a dimension of 1000 [ie. 10, 20, 50, ... , 1000])
    
    GPS_offset=15;                  % GPS time offset in seconds (since Jan 2009: 15 secs, before 14)
    RTstart=4636.52;                % start of RT data set in seconds since UTC midnight(to be calculated from the RT csv file
    RTend=27306.70;                 % end of RT data set in seconds since UTC midnight (to be calculated from the RT csv file

elseif (strcmp(geb,' T02')==1)

    datum(1)=09;                    % day of month for start of GPS measurements in UTC
    datum(2)=5;                     % day offset to last GPS/UTC Sunday midnight ie. Mon=1 
    step=3;                         % ** define size of histogram bins
    high_res_start=79257100;        % ** start of high-resolution section in microsecs **ignore this
    high_res_end=82551000;          % ** end of high-resolution section in microsecs   **ignore this
    low_res_start=0;                % (set to 0 to take all data) start of low-resolution section in microsecs since last UTC midnight before GPS start
    low_res_end=172000000;          % (set to 172000000 to take all data) end of low-resolution section in microsecs since last UTC midnight before GPS start

    % set temp_corr(6)=1 and all others to zero for no base station correction
    temp_corr(1)=0.0;         % temperature correction parameters to be 
    temp_corr(2)=0.0;         % calculated via Excel, using the effective temperature
    temp_corr(3)=0.0;         % standardised to the 6am measurements. The equation is:
    temp_corr(4)=0.0;         % Tcorr=temp_corr(1)*Tb^5+temp_corr(2)*Tb^4+ ... + temp_corr(6)
    temp_corr(5)=0.0;        
    temp_corr(6)=1.0;          
    
    % obtain boundary information in UTM from OziExplorer (round to nearest 1000)
    minE=414000;                    % western boundary of the spatial data extent
    maxE=425000;                    % eastern boundary of the spatial data extent 
    minN=6146000;                   % southern boundary of the spatial data extent
    maxN=6167000;                   % northern boundary of the spatial data extent
    UTM='55 H';                     % set the UTM Zone (must be 4 digit)

    % adjust range by trial and error
    range_h=[180 290];              % plotting range for the colour scheme
    bins_h=[175:4:295];             % sampling range for the histograms
    range_v=[200 360];              
    bins_v=[200:8:360];
    range_TIR=[270 330];            % range of TIR for plotting purposes
    range_NDVI=[-1 1];              % range of NDVI for plotting purposes
    s_bin=100;                     % bin size for spatial plots (it has to be a dimension of 1000 [ie. 10, 20, 50, ... , 1000])
    
    GPS_offset=15;                  % GPS time offset in seconds (since Jan 2009: 15 secs, before 14)
    RTstart=1110.52;               % start of RT data set in seconds since UTC midnight(to be calculated from the RT csv file
    RTend=16228.40;                 % end of RT data set in seconds since UTC midnight (to be calculated from the RT csv file

elseif (strcmp(geb,' R03')==1)

    datum(1)=10;                    % day of month for start of GPS measurements in UTC
    datum(2)=6;                     % day offset to last GPS/UTC Sunday midnight ie. Mon=1 
    step=3;                         % ** define size of histogram bins
    high_res_start=79257100;        % ** start of high-resolution section in microsecs **ignore this
    high_res_end=82551000;          % ** end of high-resolution section in microsecs   **ignore this
    low_res_start=0;                % (set to 0 to take all data) start of low-resolution section in microsecs since last UTC midnight before GPS start
    low_res_end=172000000;          % (set to 172000000 to take all data) end of low-resolution section in microsecs since last UTC midnight before GPS start

    % set temp_corr(6)=1 and all others to zero for no base station correction
    temp_corr(1)=0.0;         % temperature correction parameters to be 
    temp_corr(2)=0.0;         % calculated via Excel, using the effective temperature
    temp_corr(3)=0.0;         % standardised to the 6am measurements. The equation is:
    temp_corr(4)=0.0;         % Tcorr=temp_corr(1)*Tb^5+temp_corr(2)*Tb^4+ ... + temp_corr(6)
    temp_corr(5)=0.0;        
    temp_corr(6)=1.0;          
    
    % obtain boundary information in UTM from OziExplorer (round to nearest 1000 - see s_bin variable below)
    minE=392000;                    % western boundary of the spatial data extent
    maxE=463000;                    % eastern boundary of the spatial data extent 
    minN=6125000;                   % southern boundary of the spatial data extent
    maxN=6180000;                   % northern boundary of the spatial data extent
    UTM='55 H';                     % set the UTM Zone (must be 4 digit)

    % adjust range by trial and error
    range_h=[180 290];              % plotting range for the colour scheme
    bins_h=[175:4:295];             % sampling range for the histograms
    range_v=[200 360];              
    bins_v=[200:8:360];
    range_TIR=[270 330];            % range of TIR for plotting purposes
    range_NDVI=[-1 1];              % range of NDVI for plotting purposes
    s_bin=1000;                     % bin size for spatial plots (it has to be a dimension of 1000 [ie. 10, 20, 50, ... , 1000])
    
    GPS_offset=15;                  % GPS time offset in seconds (since Jan 2009: 15 secs, before 14)
    RTstart=80577.02;                % start of RT data set in seconds since UTC midnight(to be calculated from the RT csv file
    RTend=100915.00;                 % end of RT data set in seconds since UTC midnight (to be calculated from the RT csv file

end
