[Thread Prev][Thread Next][Index]

Re: [ferret_users] how to extract profile data



Hi,
The indices I= and K= don't refer to the coordinates here, but to the length of the list of data stored:

yes? show data
yes? sh dat
     currently SET data sets:
    1> /home/users/ansley/tarfiles/argo.nc  (default)
 name     title                             I         J         K         L         M         N
 TEMP     Temperature                      1:100     ...       1:2       ...       ...       ...
 SALT     Salinity                         1:100     ...       1:2       ...       ...       ...
 LAT      Latitude                         1:100     ...       ...       ...       ...       ...
 LON      Longitude                        1:100     ...       ...       ...       ...       ...
 
To pick out a subset in latitude you can define a mask:
yes? let mask = if lat lt 10 and lat gt 1 then 1

yes? list lat, mask
             DATA SET: /home/users/ansley/tarfiles/argo.nc
             X: 0.5 to 100.5
 Column  1: LAT is Latitude (Degrees North)
 Column  2: MASK is IF LAT LT 10 AND LAT GT 1 THEN 1
               LAT   MASK
1     /   1:  15.22   ....
2     /   2:  15.05   ....
3     /   3:  18.98   ....
4     /   4:  19.31   ....
5     /   5:  19.44   ....
6     /   6:  19.51   ....
7     /   7:  19.58   ....
8     /   8:  19.60   ....
9     /   9:  17.63   ....
10    /  10:  17.57   ....
11    /  11:  17.54   ....
12    /  12:  17.61   ....
13    /  13:  15.59   ....
14    /  14:  15.40   ....
15    /  15:  15.19   ....
16    /  16:  16.07   ....
17    /  17:  16.19   ....
18    /  18:  16.23   ....
19    /  19:  16.17   ....
20    /  20:  16.08   ....
21    /  21:  15.90   ....
22    /  22:  15.65   ....
23    /  23:  15.37   ....
24    /  24:   0.94   ....
25    /  25:   1.25  1.000
26    /  26:   3.03  1.000
27    /  27:   1.48  1.000
28    /  28:   2.55  1.000
29    /  29:   2.80  1.000
30    /  30:   2.22  1.000
31    /  31:   3.20  1.000
32    /  32:   4.11  1.000
33    /  33:   4.89  1.000
34    /  34:   1.10  1.000
35    /  35:   1.25  1.000
36    /  36:   4.13  1.000
37    /  37:   3.96  1.000
38    /  38:   4.07  1.000
39    /  39:   4.32  1.000
40    /  40:   4.66  1.000
41    /  41:   0.85   ....
42    /  42:   1.33  1.000
43    /  43:   2.92  1.000
44    /  44:   3.95  1.000
45    /  45:   3.75  1.000
46    /  46:   4.26  1.000
47    /  47:   0.76   ....
...
Then you could save just the desired data. Wherever lat is in the desired range, write the data, otherwise write a missing-value:
yes? save/file=out.nc temp*mask,salt*mask,lon*mask,lat*mask
(It would be better to define variables using the expressions temp*mask, and so on, giving the variable correct title and units, and save that.)

That file would have missing data wherever the longitude was outside the range defined in your mask.  One could work out ways to write the data without those missing values, if needed.



On 7/22/2014 9:53 PM, Pruthvi Raj Mallela wrote:
i have argo netcdf data with latitude,longitude,temperature and salinity..in that latitude is the -4 to 24 .but i want 1-10 only...when i am using "save/i=1:10/k=1:2 temp,salt,lat,lon" command it's taking first serial number 1-10 only..but i want latitude of 1-10 ...here attaching my netcdf data file...


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement