Subversion Repositories lagranto.icon

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 michaesp 1
.TH density
2
.SH NAME 
3
.B density - 
4
gridding of trajectory files: either single trajectories or trajectory densities
5
.SH SYNOPSIS 
6
.B density
7
.I inpfile
8
.I outfile
9
[ 
10
.I optional arguments 
11
] 
12
.SH DESCRIPTION
13
Gridding of a trajectory file "inpfile"; the output is written to a netCDF file "outfile). The trajectories can be interpolated to equal-distance intervals or to a higher time resolution; furthermore, an interpolation is provided to give a continuous line in a longitude/latitude grid. Besides densities of trajectories, possibly at different times, gridding of traced meteorological fields is accepted.
14
.SH PARAMETERS
15
.TP 15
16
.B inpfile
17
input trajectory file (in one of the accepted formats, see 
18
.B reformat 
19
for details)
20
.TP 15
21
.B outfile 
22
output netCDF file with a regular or rotated longitude/latitude grid. The output can be either in IVE or in CF netCDF format (see switches below).
23
.SH OPTIONAL PARAMETERS
24
.TP 5
25
.B - field name
26
Field name (according to the column names of the trajectory file) which should be gridded. If no field is specified, it is assumed that the trajectory density (counts per grid point) should be gridded. 
27
.TP 5
28
.B - create
29
determines the behaviour if the output file already exists: 1) if the file does NOT exist, it will be created; 2) if the file already exists, it will be overwritten, i.e. newly created. If the flag is not set and the file already exists, the output of the new gridding will appended to the existing file. As a typical scenario: density TRAJECTORY DENSITY; density TRAJECTORY DENSITY -field p; density TRAJECORY DENSITY -field PV;... -> all fields (p, PV,...) will be written to the same output file "DENSITY". 
30
.TP 5
31
.B - index filename
32
perform only a gridding of the trajectories in the index list "filename"; an index list is just a list of the indices of the single trajectories - it can easily be created with
33
.B select
34
and also is used in
35
.B extract.
36
.TP 5
37
.B - boolean filename
38
perform only a gridding of the trajectories in the boolean list "filename"; a boolean list has for each trajectory an entry 1 (trajectory selected) or 0 (not selected)  - it can easily be created with
39
.B select
40
and also is used in
41
.B extract.
42
.TP 5
43
.B - interp val unit
44
interpolate the trajectories to new positions before the gridding; different modes are accepted: 
45
.B 1) "-interp 1 h" 
46
interpolates the trajectories to a new time resolution (here 1 h);
47
.B 2) "-interp 20 km"
48
interpolates the trajectories to a new space resolution (here 20 km). Note that nearly stationary trajectories will be reduced in their influence considerably if this mode is applied;
49
.B 3) "-interp 2 deg"
50
interpolates to a new resolution, expressed in deg lon/lat. This mode is particularly helpful if a "line" should be drawn on a lon/lat grid.
51
.TP 5
52
.B -pole lon lat
53
set the pole position to lon/lat; the trajectory's lon/lat will be rotated according to this new pole position. This option is particularly helpful if the gridded trajectories should be available on the same grid as the input netCDF files 
54
.TP 5
55
.B - radius val unit
56
set the filtering radius for the smoothing (default is 100 km); this radius determines over which radius each trajectory point is smeared out during the gridding. It should be adapted to the grid resolution: if it is too small, and no grid point falls into the circle with this radius, an error message is written. A good choice might be 
57
.B -radius <dlat|dlon [in km]>. 
58
Further Examples: 
59
.B "-radius 2 deg" 
60
for smoothing over 2 degrees lat/lon;
61
.B "-radius 20 km"
62
for a 20 km smoothing.
63
.TP 5
64
.B - latlon [ nlon nlat lonmin latmin dlon dlat | dynamic ]
65
specification of the regular output lon/lat grid; the default output grid has parameters: nlon = 360, nlat = 180, lonmin = -180, lonmax = 180, dlon =1, dlat = 1 (global). If the option 
66
.B dynamic 
67
is chosen, the grid is automatically adapted to the trajectory file: the longitude and latitude boundaries are determined and the resulting ranges divided in 400 grid pixel in each direction. In a second step the grid distance is set equal in zonal and meridional direction, and the other grid parameters correspondingly adjusted.
68
.TP 5
69
.B - centered clon clat nlonlat dlonlat
70
specification of the centered output lon/lat grid; the centre of the rotated grid is given with the central longitude (clon) and latitude (clat) - this point corresponds to 0/0 in the new coordinate system. The horizontal resolution (dlonlat) of the new grid is equal in rotated longitude and latitude. The final domain extensions are: -(nlonlat-1)/2*dlonlat, +(nlonlat-1)/2*dlonlat and correspondingle for rotated latitude. 
71
.TP 5
72
.B -time value
73
do only a gridding of the time specified; e.g. -time 18.00 would perform a gridding of the trajectory time 18 h. If the netCDF already exists, and if the "-create" flag is not set, the new time will be added to the already existing file - the grid parameters will automatically be taken from the netCDF file. 
74
.SH OUTPUT FIELDS
75
.TP 5
76
.B - COUNT
77
number of trajectory points attributed to grid points; the integration of this field over the whole domain is equal to the total number of gridded trajectory points, i.e. equal to the product #trajectories x #times.
78
.TP 5
79
.B - RESIDENCE
80
residence time of trajectory points attributed to grid points; the integration of this field over the whole domain is equal to the total time of all trajectories, i.e. equal to the product #trajectories x #time x time interval.
81
.TP 5
82
.B - AREA
83
area (in square kilometers) attributed to each grid point, i.e. dlat x dlon x coslatitude). This field can be used to convert the units of COUNT and RESIDENCE to grid-independent values. For instance, 
84
.B RESIDENCE/AREA 
85
is the residence time per square kilometer. 
86
.TP 5
87
.B - FILED
88
gridded field: e.g gridded pressure, temperature, potential vorticity.
89
.SH EXAMPLES
90
.TP 5
91
.B [1] density TRAJECTORY DENSITY
92
bring the TRAJECTORY file into a netCDF file DENSITY with gloabl coverage (longitude/latitude grid). The netCDF file is in CF format and the all trajectory points are gridded, based on a smoothing radius of 100 km. 
93
.TP 5
94
.B [2] density TRAJECTORY DENSITY -latlon dynamic
95
as in example [1], but now the lon/lat grid is automatically adapted to the range of the trajectory file.
96
.TP 5
97
.B [3] density TRAJECTORY DENSITY -interp 1 h
98
as in exaxmple [1], but the trajectories are interpolated to a 1-h time interval. This gives smoother trajectories. 
99
.TP 5
100
.B [4] density TRAJECTORY DENSITY -interp 20 km
101
as in exaxmple [1], but the trajectories are interpolated to a 20-km distance interval. 
102
.TP 5
103
.B [5] density TRAJECTORY DENSITY -interp 1 deg
104
as in exaxmple [1], but the trajectories are interpolated to a 1 deg distance interval. If the output grid (as specified in option "-latlon" or "-rotated") has the same spacing (1 deg) as given in "-interp 1 deg", a continuous line is drawn.  
105
.TP 5
106
.B [6] density TRAJECTORY DENSITY -radius 100 km
107
the trajectory points are spread out over a circle with radius 100 km; this is equivalent to a smoothing of the resulting density field. Note that in a equidistant cylindrical projection, the circles become distorted towards the pole. If this is not appropriate, the option 
108
.B "-radius 2 deg" 
109
can be given, which is independent of geographical latitude.
110
.TP 5
111
.B [7] density VALID DENS -time 18.00
112
only gridding of the trajectory points corresponding to time 18 h; if no time is specified or if 
113
.B "-time all",
114
then all trajectory times are included. Note that interpolation with "-interp" (see above) is not allowed, if only one time step is selected, i.e. "-interp" works only with "-time all".
115
.TP 5
116
.B [8] density TRAJECTORY DENSITY -centered 30 50 401 0.1 -interp 0.2 deg
117
all trajectory times are gridded, but this time onto a centered lon/lat grid; for instance, an interesting feature was found at (lon=30,lat=50). The new coordinate system, a rotated lon/lat grid, is centered at this point and spreads from 20 W to 20 W and from 20 S to 20 N, comprising 401 grid points in rotated longitude and latitude direction. The new grid resolution is 0.1 degrees, which was taken into account in the interpolation to 0.2 deg intervals between trajectory points.
118
.TP 5
119
.B [9] density TRAJECTORY DENSITY -index filename
120
all trajectories in the trajecrtory file TRAJECTORY are gridded which are listed in the index file "filename".
121
.TP 5
122
.B [10] density TRAJECTORY DENSITY -field p -time 0.00 -latlon dynamic
123
in addition of positional gridding (COUNT, RESIDENCE), do also a gridding of the pressure (p). This gives the pressure at the grid points, averaged over all trajectories passing over the grid point.
124
.TP 5
125
.B [11] density TRAJECTORY DENSITY -time 0.00; density TRAJECTORY DENSITY -time 6.00
126
the trajectory density for "TRAJECTORY" is first written to "OUTPUT" for time 0; then, with the second call, the densities are written for the time 6 h and included into the already existing netCDF file "DENSITY". Similarly, additional fiels can be added to a already existing netCDF file, e.g. with the second call "density TRAJECTOR DENSITY -field p -time 0.00".
127
.SH AUTHOR 
128
Written by Michael Sprenger and Heini Wernli (January 2011)