Home > atmlab > arts > scenegen > amsu > asg_amsu.m

asg_amsu

PURPOSE ^

- asg_amsu performs 1-D radiative transfer simulations,

SYNOPSIS ^

function [K]=asg_amsu(data1,data2,leg,use_lats)

DESCRIPTION ^

- asg_amsu performs 1-D radiative transfer simulations,
  for AMSU setup, on states created from cloudsat files
  Temperature,water vapour, (and ozone) are taken from
  ECMWF, and N2 and 02 from climatologies

  Format [K]=asg_amsu(data1,data2,leg,use_lats)

  OUT    
         K.Y    smilutated radiance (freq,los)
         K.Q    simulated radiance (Q) (freq,los) 
                %is reported only when stokes dimension
                %is set to 2 
         K.freq frequencies of simulated radiance
         K.los  line of sights of simulated radiance
         K.lat  latitude of the G data
         K.G    G structure of atmospheric/cloud state   
         
  IN
    
         data1    path to a Cloudsat 2B-GEOPROF file 
         data2    path to a Cloudsat ECMWF-AUX file
         leg      leg of the data to be used
         use_lats vector with latitudes where the data
                  will be taken from 

  Example usage
          leg=1;use_lats=[-20 -13.15 -12.15];
          leg=2;use_lats=[-20 -13.15 -12.15];
          leg=3;use_lats=[12.15 13.15 20];
          datadir='/home/bengt/CIWSIR/Dataset_gen/CloudSAT_data/';
          data1=fullfile(datadir,...
                '2006293172641_02554_CS_2B-GEOPROF_GRANULE_P_R03_E02.hdf');
          data2=fullfile(datadir,...
                '2006293172641_02554_CS_ECMWF-AUX_GRANULE_P_R03_E02.hdf');
          [K]=asg_amsu(data1,data2,leg,use_lats)


 2008-02-06   Created by Bengt Rydberg.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

asg_amsu.m

SOURCE CODE ^

0001 %- asg_amsu performs 1-D radiative transfer simulations,
0002 %  for AMSU setup, on states created from cloudsat files
0003 %  Temperature,water vapour, (and ozone) are taken from
0004 %  ECMWF, and N2 and 02 from climatologies
0005 %
0006 %  Format [K]=asg_amsu(data1,data2,leg,use_lats)
0007 %
0008 %  OUT
0009 %         K.Y    smilutated radiance (freq,los)
0010 %         K.Q    simulated radiance (Q) (freq,los)
0011 %                %is reported only when stokes dimension
0012 %                %is set to 2
0013 %         K.freq frequencies of simulated radiance
0014 %         K.los  line of sights of simulated radiance
0015 %         K.lat  latitude of the G data
0016 %         K.G    G structure of atmospheric/cloud state
0017 %
0018 %  IN
0019 %
0020 %         data1    path to a Cloudsat 2B-GEOPROF file
0021 %         data2    path to a Cloudsat ECMWF-AUX file
0022 %         leg      leg of the data to be used
0023 %         use_lats vector with latitudes where the data
0024 %                  will be taken from
0025 %
0026 %  Example usage
0027 %          leg=1;use_lats=[-20 -13.15 -12.15];
0028 %          leg=2;use_lats=[-20 -13.15 -12.15];
0029 %          leg=3;use_lats=[12.15 13.15 20];
0030 %          datadir='/home/bengt/CIWSIR/Dataset_gen/CloudSAT_data/';
0031 %          data1=fullfile(datadir,...
0032 %                '2006293172641_02554_CS_2B-GEOPROF_GRANULE_P_R03_E02.hdf');
0033 %          data2=fullfile(datadir,...
0034 %                '2006293172641_02554_CS_ECMWF-AUX_GRANULE_P_R03_E02.hdf');
0035 %          [K]=asg_amsu(data1,data2,leg,use_lats)
0036 %
0037 %
0038 % 2008-02-06   Created by Bengt Rydberg.
0039 
0040 function [K]=asg_amsu(data1,data2,leg,use_lats)
0041 
0042 
0043 fascod     = fullfile( atmlab('ARTS_XMLDATA_PATH'), 'atmosphere', 'fascod' ); 
0044 artsdirpath='/home/bengt/ARTS/arts/';
0045 workfolder =create_tmpfolder;
0046 
0047 
0048 %- Init ASG structures
0049 %
0050 D = asgD;
0051 %
0052 clear G
0053 
0054 %--- ASG settings -------------------------------------------------------------
0055 
0056 %- A template for specifying random disturbances of atmospheric fields
0057 %
0058 RND.FORMAT    = 'param'; 
0059 RND.SEPERABLE = 1;
0060 RND.CCO       = 0.01;           % Cut-off for correlation values
0061 RND.TYPE      = 'rel';          % Relative disturbances as default
0062 RND.DATALIMS  = [0];            % Do not allow negative values
0063 %
0064 RND.SI        = 0.4;            % 40 % std. dev. as default
0065 %
0066 RND.CFUN1     = 'exp';              % Exp. correlation function for p-dim.
0067 RND.CL1       = [0.15 0.3 0.3]';    % Corr. length varies with altitude
0068 RND.CL1_GRID1 = [1100e2 10e2 1e-3];    
0069 
0070 
0071 %- Temperature field
0072 %
0073 G(1)                 = gfxmlin_GriddedField3( D, asgG, ...
0074                                 fullfile( fascod, 'tropical.t.xml' ), ...
0075                                 'Temperature field', 't' );
0076 G(1).RNDMZ           = RND;
0077 G(1).RNDMZ.TYPE      = 'abs';   % Change to absolute std. dev. of 3K
0078 G(1).RNDMZ.DATALIMS  = [100 310];   % Allowed range of temperatures
0079 G(1).RNDMZ.SI        = 1;
0080 G(1).DIMADD          = 0;
0081 
0082 %- Altitude field
0083 %
0084 G(2)                 = asgG;
0085 G(2).NAME            = 'Altitude field'; 
0086 G(2).SPCFC.P0        = 1013e2;
0087 G(2).SPCFC.Z0        = gf_set( D, asgG, [], 0, [], ...
0088                                'Altitude at P0', 'Altitude', 'm' );
0089 G(2).DIMADD          = 0;
0090 
0091 %- Nitrogen
0092 %
0093 G(3)                 = gf_set( D, asgG, [], 0.7814, [], ...
0094                                'Nitrogen', 'Volume mixing ratio', '-' );
0095 G(3).PROPS           = 'N2-SelfContStandardType';
0096 
0097 %- Water vapour
0098 %
0099 G(4)                 = gfxmlin_GriddedField3( D, asgG, ...
0100                                 fullfile( fascod, 'tropical.H2O.xml' ), ...
0101                                 'Water vapour', 'vmr' );
0102 G(4).PROPS           = {'H2O-PWR98'};
0103                      
0104 G(4).RNDMZ           = RND;
0105 G(4).RNDMZ.SI        =0.1;
0106 G(4).SPCFC.FIXED_RH  = 0;
0107 G(4).DIMADD          = 0;
0108 
0109 %- O2
0110 %
0111 G(5)                 = gfxmlin_GriddedField3( D, asgG, ...
0112                                 fullfile( fascod, 'tropical.O2.xml' ), ...
0113                                 'O2', 'vmr' );
0114 G(5).PROPS           = {'O2-PWR93'};
0115 G(5).DIMADD          = 0;
0116 
0117 %- Ozone
0118 %
0119 G(6)                 = gfxmlin_GriddedField3( D, asgG, ...
0120                                 fullfile( fascod, 'tropical.O3.xml' ), ...
0121                                 'Ozone', 'vmr' );
0122 G(6).PROPS           = 'O3';
0123 G(6).RNDMZ           = RND;
0124 G(6).RNDMZ.SI        = 0.2; 
0125 G(6).DIMADD          = 0;                                                     
0126 
0127 
0128 
0129 %if desired use temperature, humidity, and ozone from ecmwf
0130 ecmwf=1;
0131 
0132 % add data from cloudsat ECMWF data
0133 C.DATA=data1;    
0134 C.LEG=leg;
0135 C.USE_LATS=use_lats;
0136 C.DLAT=0.25; 
0137 %latitude resolution,radar backscatter will be averaged over this length
0138 %C.LAT_RES=0.25;
0139 C.DIMADD=0;
0140 C.P_LIMS=[400e2 80e2]; %pressure limits of cloud data
0141 
0142 if ecmwf
0143    
0144    %read in temperature, humidity, and ozone from ecmwf
0145    grids_cs{2}=C.USE_LATS;
0146    [G1]=asg_cloudsat_ecmwf(data2,C.LEG,grids_cs);
0147 
0148    %merge it with with fascod data
0149 
0150    lims1{1}=[G1(1).GRID1(1) G1(1).GRID1(end)];
0151    lims1{2}=[G1(1).GRID2(1) G1(1).GRID2(end)];
0152    lims2{1}=[G1(1).GRID1(end) G(1).GRID1(end)];
0153    [G1]=gf_merge(D,G1,lims1,D,G,lims2);   
0154 
0155    %write over the old fields
0156    fields={'Temperature field','Water vapour','Ozone'};
0157    for i=1:length(fields)
0158        f1=find(strcmp({G.NAME},fields{i}));
0159        g1=find(strcmp({G1.NAME},fields{i}));
0160        G(f1).DATA=G1(g1).DATA;
0161        G(f1).GRID1=G1(g1).GRID1;
0162        G(f1).GRID2=G1(g1).GRID2;
0163        G(f1).SOURCE=G1(g1).SOURCE;
0164        G(f1).DIMS=[1 2];
0165    end
0166       
0167 end
0168 
0169 
0170 clear RND fascod G1 lims1 lims2 f1 g1 fields grids_cs leg use_lats
0171 
0172 %------------------------------------------------------------------------------
0173 
0174 %--- Qarts settings  ----------------------------------------------------------
0175 
0176 Q = qarts;
0177 
0178 %- Basic atmospheric variables
0179 %
0180 Q.P_GRID         = 100/16e3;      % Unit here is pressure decade
0181 Q.ATMOSPHERE_DIM=1;
0182 
0183 %-Surface
0184 %
0185 Q.Z_SURFACE=0;
0186 
0187 %- Spectroscopic stuff
0188 %
0189 Q.ABS_LINES_FORMAT = nan;
0190 Q.ABSORPTION       = 'LoadTable';
0191 Q.OUTPUT_FILE_FORMAT='binary';
0192 Q.INCLUDES{1}='amsub.arts';
0193 
0194 %upper sideband channels (center frequencies)
0195 F_GRID           = [85e9,89.9e9,150.9e9,184.31e9,186.31e9,190.31e9,200e9];
0196 Q.STOKES_DIM=1;
0197 
0198 
0199 %- DOIT variables
0200 %
0201 CB.METHOD                        = 'DOIT';
0202 % Angular grids
0203 CB.METHOD_PRMTRS.N_ZA_GRID       =  19;
0204 CB.METHOD_PRMTRS.N_AA_GRID       =  10;
0205 CB.METHOD_PRMTRS.ZA_GRID_OPT_FILE = fullfile(atmlab_example_data, ...
0206                                                            'doit_za_grid.xml');
0207 CB.METHOD_PRMTRS.EPSILON         = [0.1 0.01 0.01 0.01];
0208 CB.METHOD_PRMTRS.SCAT_ZA_INTERP  = 'linear';
0209 CB.METHOD_PRMTRS.ALL_F           = 0;
0210 CB.LIMITS                        =[5e3 15e3]; %dummy,later there is a check
0211 Q.CLOUDBOX_DO                    = 1;
0212 Q.CLOUDBOX                       = CB;
0213 
0214 clear CB
0215 
0216 %------------------------------------------------------------------------------
0217  
0218 
0219 %properties for adding pnd fields
0220 alpha=0;Ni=10;xnorm=50e-6;
0221 [x_i,w_i]=gauss_laguerre(alpha,Ni,xnorm);
0222 %x_i will be the diameter of the particles considered
0223 %calculate ssp
0224 for i=1:2
0225  if i==1
0226     f_grid=94e9;
0227  elseif i==2
0228     if length(F_GRID)==1
0229        f_grid=[F_GRID,F_GRID+1e6];
0230     else
0231        f_grid=[F_GRID];
0232     end
0233  end   
0234  F=create_ssp('sphere',f_grid,x_i/2);
0235  P(i).SSP=F;
0236  P(i).PSD='MH97';
0237  P(i).method='gauss-laguerre';
0238  P(i).x=x_i;
0239  P(i).w=w_i;
0240  P(i).x_norm=xnorm;
0241  P(i).shape='sphere';  
0242 end
0243 C.PROPS=P;
0244 
0245 grids_cs{1}=G(5).GRID1; 
0246 
0247 clear F f_grid P Ni alpha w_i x_i xnorm i
0248 
0249 %- fullsky simulations
0250 %
0251 [Y,ydata,DY,G] = asg2y_1d_cloudsat(G,grids_cs,C,Q,workfolder)
0252 
0253 delete_tmpfolder(workfolder)
0254 
0255 
0256 for iv=1:length(C.USE_LATS)
0257     
0258     if Q.STOKES_DIM==2
0259        Y1=Y(1:2:end,iv);
0260        K(iv).Y=reshape(Y1,length(ydata.f),length(ydata.los));
0261        Q1=Y(2:2:end,iv);
0262        K(iv).Q=reshape(Q1,length(ydata.f),length(ydata.los));
0263     else
0264        Y1=Y(:,iv);
0265        K(iv).Y=reshape(Y1,length(ydata.f),length(ydata.los));
0266     end
0267     K(iv).freq=ydata.f;
0268     K(iv).los=ydata.los;
0269     K(iv).lat=C.USE_LATS(iv);
0270 
0271     %find the fields of interest
0272     fields={'Temperature field','Altitude field','Water vapour','IWC field'};
0273     fv=[];
0274     for fi=1:length(fields)
0275         fv=[fv,find(strcmp({G{iv}.NAME},fields{fi}))];
0276     end
0277     K(iv).G=G{iv}(fv);
0278 
0279 end

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005