Home > atmlab > gridcreation > grid_for_1line.m

grid_for_1line

PURPOSE ^

GRID_FOR_1LINE Grid for observation of a single transition

SYNOPSIS ^

function g = grid_for_1line(f0,fwhm,df1,df2,varargin)

DESCRIPTION ^

 GRID_FOR_1LINE   Grid for observation of a single transition

    The function creates a grid that is suitable for observations of a single
    transition, particularly for ground-based measurements. 

    The grid covers [f0+df1,f0+df2]. The part [f0-1.5*FWHM,f0+1.5*FWHM] is
    covered by a grid with equidistant spacing of df_fine. The ranges between
    the centre part and grid edges are covered by a logarithmically spaced
    grid. This grid is equidistant in log-space, where df_log gives the
    spacing. For example, the default value of 0.1 signifies that the range
    between 10 and 100 MHz is covered by 10 points.

 FORMAT   g = grid_for_1line(f0,fwhm,df1,df2[,df_fine,df_log])
        
 OUT   g
 IN    f0        Line centre.
       fwhm      FWHM for Doppler broadening (pr correspondingly)
       df1       Starting point for grid, in distance from f0. E.g. -500e6
                 for a grid starting 0.5 GHz below f0.
       df2       End point for grid, in distance from f0. E.g. 500e6
                 for a grid ending 0.5 GHz above f0.
 OPT   df_fine   Grid spacing for fine part around line centre. Default 
                 is FWHM/5.
       df_log    Spacing in logarithmic part. See above. Default is 0.1.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

grid_for_1line.m

SOURCE CODE ^

0001 % GRID_FOR_1LINE   Grid for observation of a single transition
0002 %
0003 %    The function creates a grid that is suitable for observations of a single
0004 %    transition, particularly for ground-based measurements.
0005 %
0006 %    The grid covers [f0+df1,f0+df2]. The part [f0-1.5*FWHM,f0+1.5*FWHM] is
0007 %    covered by a grid with equidistant spacing of df_fine. The ranges between
0008 %    the centre part and grid edges are covered by a logarithmically spaced
0009 %    grid. This grid is equidistant in log-space, where df_log gives the
0010 %    spacing. For example, the default value of 0.1 signifies that the range
0011 %    between 10 and 100 MHz is covered by 10 points.
0012 %
0013 % FORMAT   g = grid_for_1line(f0,fwhm,df1,df2[,df_fine,df_log])
0014 %
0015 % OUT   g
0016 % IN    f0        Line centre.
0017 %       fwhm      FWHM for Doppler broadening (pr correspondingly)
0018 %       df1       Starting point for grid, in distance from f0. E.g. -500e6
0019 %                 for a grid starting 0.5 GHz below f0.
0020 %       df2       End point for grid, in distance from f0. E.g. 500e6
0021 %                 for a grid ending 0.5 GHz above f0.
0022 % OPT   df_fine   Grid spacing for fine part around line centre. Default
0023 %                 is FWHM/5.
0024 %       df_log    Spacing in logarithmic part. See above. Default is 0.1.
0025 
0026 % 2009-11-09   Created by Patrick Eriksson.
0027 
0028 function g = grid_for_1line(f0,fwhm,df1,df2,varargin)
0029 %
0030 [df_fine,df_log] = optargs( varargin, { fwhm/5, 0.1 } );
0031 
0032 g1 = [ 0 : df_fine : 1.5*fwhm-df_fine/2 ];
0033 
0034 l1 = log10( g1(end)+df_fine );
0035 l2 = log10( max( abs( [ df1, df2 ] ) ) );
0036 
0037 g2 = logspace( l1, l2, ceil((l2-l1)/df_log) );
0038 
0039 g = f0 +symgrid( [ g1 g2 ] );
0040 
0041 ind = find( g>=f0+df1 & g<=f0+df2 );
0042 
0043 if ~isempty(ind)
0044   g = g(ind);
0045 end

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