I use ncdf V1.6 on Windows XP Sp2, I hava attached the sample file (tab
delim) which contains 2 columns for coordinates long/lat and 10 columns for
weekly averages of radon. Sp would be the best solution to produce map I
guess, but for time series analysis I think netcdf would perform better. 

Thanks,thoams


 
-----Ursprüngliche Nachricht-----
Von: Michael Sumner [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 9. August 2007 01:49
An: 'Thomas Szegvary'; r-sig-geo@stat.math.ethz.ch
Betreff: RE: [R-sig-Geo] Coordinate/grid for ncdf data

Hi, can you provide an example file?

I'd recommend avoiding NetCDF for various reasons, why don't you simply add
each value column from the separate files to a new column in a
SpatialGridDataFrame?

That would be the recommend sp way to proceed here. If you really need to
create a NetCDF file, please let us know more about your OS and the
package/s and versions you are using (ncdf I presume?) - however such
questions should include the ncdf(?) package author at least.  

Cheers, Mike. 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Thomas Szegvary
Sent: Wednesday, 8 August 2007 11:13 PM
To: r-sig-geo@stat.math.ethz.ch
Subject: [R-sig-Geo] Coordinate/grid for ncdf data

Hi!

I have a table with 3 columns, 2 for long/lat coordinates and 1 for values
(radon concentration). I have data for every week of the year
2006,distributed in 52 tables/files. I want to create a NetCDF file, which
is much easier to handle than extracting the values from 52 tables. I tried
the following for the first dataset (i.e first week):

#extracting coordinates and values from my tables (which have also other
information I don't need)
W01<-read.table("RN_weekly/KW01_RN.dat")
long<-W01$V1
lat<-W01$V2
RN01<-W01$V3

#defining dimensions for coordinates
dim1 <- dim.def.ncdf( "EW","degrees", as.double(long))
dim2 <- dim.def.ncdf( "SN","degrees", as.double(lat))

#defining variable for my values I want to have the time series varz <-
var.def.ncdf("Radon","Bq/m2/h1", list(dim1,dim2), -1, 
          longname="Radon flux rate")

#creating the netcdf file and filling the variable varz with the first
data-week from my time series nc.rn <- create.ncdf("rn_weekly.nc",varz)
put.var.ncdf(nc.rn,varz,RN01)
close.ncdf(nc.rn)


The problem now is that the last step (put.var.ncdf) doesn't work, because
it says I am trying to "error: you asked to write 111788329 values, but the
passed data array only has 10573* entries!". So I think the problem is that
I need an array with two dimensions (coordinates...) for my values. But how
do I get this from my tables??

 *10573 are the pixels for my area

Thanks for any help!
Thomas


__

Thomas Szegvary
Institute of Environmental Geosciences
Department of Geosciences
University of Basel
Bernoullistrasse 30
CH - 4056 Basel

Tel.  41-61-267 04 82
Fax. 41-61-267 04 79
Email: [EMAIL PROTECTED]
www.radon.unibas.ch
www.unibas.ch/environment

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
long    lat     RN01    RN02    RN03    RN04    RN05    RN06    RN07    RN08    
RN09    RN10
1       24.7    35.1    12.30614        12.30614        16.45839        
19.13832        17.22405        17.80288        17.29635        16.99152        
16.77366
2       25      35.1    11.87027        11.87027        15.81184        
18.40052        15.80094        16.32696        15.7876 15.45401        15.21432
3       25.2    35.1    11.4383 11.4383 15.1312 17.61388        15.04919        
15.54684        15.02185        14.69535        14.46254
4       25.5    35.1    7.73014 7.73014 14.43775        16.80685        
14.26332        14.73323        14.2256 13.90821        13.68355
5       25.7    35.1    7.355183        7.355183        13.74618        
15.99838        14.73207        15.14   14.64566        14.33742        14.11801
6       26      35.1    6.994675        6.994675        13.06697        
15.20152        13.98974        14.37129        13.89768        13.60108        
13.39101
7       26.2    35.1    6.653141        6.653141        12.40897        
14.42675        13.26277        13.61974        13.16797        12.88389        
12.68354
8       23.7    35.4    13.13802        13.13802        17.61346        
20.36329        18.39868        19.01017        18.49904        18.19785        
17.97436
9       24      35.4    12.68836        12.68836        17.3954 20.22474        
18.40445        19.00769        18.46024        18.13167        17.89094
10      24.2    35.4    12.22937        12.22937        17.03775        
19.89583        18.20188        18.79024        18.2196 17.87257        17.62099
11      24.5    35.4    11.76407        11.76407        16.45219        
19.25201        17.66143        18.22208        17.6497 17.29886        17.04685
12      24.7    35.4    11.29568        11.29568        15.72855        
18.41771        16.91318        17.4394 16.87897        16.53356        16.28769
13      25      35.4    10.82734        10.82734        14.96017        
17.52213        15.56573        16.04282        15.47316        15.11627        
14.8623
14      14.5    35.9    47.84997        47.84997        47.42772        
46.82557        46.85131        46.92925        47.07415        47.44299        
47.50924
15      27.2    35.9    3.675026        3.675026        5.450414        
6.545252        6.132568        6.268295        5.904164        5.651891        
5.472981
16      -5.81   36.1    66.4536 66.4536 66.27572        66.47284        66.3853 
66.3134 66.04998        65.92492        65.83618
17      -5.56   36.1    65.42499        65.42499        65.24081        
65.44965        65.35535        65.28645        65.06942        64.93916        
64.84808
18      28      36.1    2.132916        2.132916        3.002894        
3.653336        3.150722        3.216579        2.963751        2.769915        
2.636107
19      -6.06   36.4    65.16415        65.16415        65.03178        
65.20417        65.14101        65.07299        64.78702        64.68298        
64.5936
20      -5.81   36.4    64.43015        64.43015        64.28809        
64.47721        64.40466        64.33954        64.10677        63.99482        
63.90062
21      -5.56   36.4    62.98489        62.98489        62.84053        
63.03867        62.965  62.90437        62.71517        62.60046        62.50368
22      -5.31   36.4    60.79401        60.79401        60.65415        
60.85369        60.7878 60.73442        60.58248        60.46984        60.37409
23      23      36.4    11.75768        11.75768        14.83987        
16.52369        15.59793        15.89414        15.49874        15.27847        
15.10236
24      25.5    36.4    5.517866        5.517866        9.346884        
10.83423        10.44927        10.55585        10.06625        9.75769 9.559118
25      28.2    36.4    0.8275254       0.8275254       1.332299        1.74613 
1.211726        1.276012        1.096504        0.9481692       0.8512462
26      -6.06   36.6    63.59521        63.59521        63.49712        
63.66507        63.616  63.5577 63.31053        63.21905        63.12273
27      -5.81   36.6    62.76984        62.76984        62.66376        
62.84723        62.79293        62.73892        62.54244        62.44403        
62.34241
28      -5.56   36.6    61.42554        61.42554        61.31665        
61.50922        61.45501        61.4059 61.2503 61.14863        61.04423
29      -5.31   36.6    59.4147 59.4147 59.30788        59.50312        
59.45682        59.41571        59.29648        59.19514        59.09268
30      -5.06   36.6    56.9467 56.9467 56.84043        57.03619        
57.00163        56.96756        56.87418        56.77477        56.67374
31      -4.81   36.6    54.37823        54.37823        54.27957        
54.46955        54.44482        54.41576        54.34233        54.24815        
54.15085
32      -4.56   36.6    51.5946 51.5946 51.5048 51.68627        51.67249        
51.64787        51.59026        51.50313        51.41116
33      22.5    36.6    12.77849        12.77849        14.72213        
16.01682        15.62001        15.81304        15.47768        15.29667        
15.13601
34      23      36.6    11.44042        11.44042        14.055  15.43386        
14.78966        14.98742        14.62114        14.42232        14.26113
35      -6.31   36.9    62.95958        62.95958        62.90588        
63.05347        63.02679        62.97726        62.71695        62.64708        
62.55046
36      -6.06   36.9    62.76771        62.76771        62.701  62.87038        
62.83679        62.79201        62.58925        62.50895        62.40355
37      -5.81   36.9    62.16549        62.16549        62.08989        
62.27513        62.23847        62.19855        62.0423 61.95437        61.84289
38      -5.56   36.9    61.00443        61.00443        60.92522        
61.11884        61.08281        61.0479 60.92793        60.83588        60.72163
39      -5.31   36.9    59.10659        59.10659        59.02854        
59.22372        59.19598        59.16971        59.0828 58.99004        58.87898
40      -5.06   36.9    56.70427        56.70427        56.62329        
56.81907        56.80331        56.78455        56.71971        56.62728        
56.51792
41      -4.81   36.9    54.28015        54.28015        54.20518        
54.39442        54.38681        54.37256        54.3244 54.23601        54.13056
42      -4.56   36.9    51.62205        51.62205        51.55672        
51.74224        51.74344        51.73282        51.694  51.61005        51.51112
43      -4.31   36.9    48.82072        48.82072        48.76286        48.9369 
48.94813        48.94055        48.91238        48.83643        48.74392
44      -4.06   36.9    45.94688        45.94688        45.89647        
46.05736        46.07913        46.07364        46.05385        45.98771        
45.90302
45      -3.81   36.9    43.72943        43.72943        43.68727        
43.82933        43.86162        43.86073        43.84384        43.79024        
43.70913
46      -3.56   36.9    42.19524        42.19524        42.15623        
42.28532        42.32361        42.32153        42.30844        42.26485        
42.1909
47      -3.31   36.9    42.92885        42.92885        42.88672        
43.00546        43.04216        43.03664        43.02328        42.98624        
42.9135
48      -3.06   36.9    44.27761        44.27761        44.23129        
44.34213        44.37259        44.36045        44.34252        44.31033        
44.24051
49      -2.81   36.9    45.87275        45.87275        45.81996        
45.91982        45.94662        45.92917        45.9076 45.88329        45.81477
50      -2.56   36.9    47.57551        47.57551        47.51497        
47.60349        47.62856        47.60641        47.58039        47.56636        
47.49933
51      -2.31   36.9    49.09198        49.09198        49.02373        
49.10173        49.12366        49.09504        49.06496        49.06062        
48.99867
52      -2.06   36.9    50.54646        50.54646        50.47015        
50.53774        50.55688        50.52158        50.48679        50.4926 50.43672
53      14.5    36.9    72.37559        72.37559        71.82117        
71.07256        71.12283        71.28072        71.47343        71.86436        
71.94958
54      14.7    36.9    71.67749        71.67749        71.09948        
70.32902        70.37104        70.52484        70.72009        71.11941        
71.20583
55      15      36.9    54.55319        54.55319        53.98314        
53.19855        53.20914        53.31071        53.50093        53.94558        
54.03812
56      21.7    36.9    17.36378        17.36378        18.35116        
19.13957        18.88183        19.04318        18.8419 18.78993        18.68035
57      22.5    36.9    12.44991        12.44991        14.01876        
15.01791        14.70665        14.841  14.55858        14.41625        14.28122
58      22.7    36.9    11.68688        11.68688        13.74752        
14.77825        14.21521        14.35083        14.05597        13.90808        
13.77604
59      23      36.9    11.19791        11.19791        13.29632        
14.36263        13.95696        14.0586 13.7267 13.5542 13.41193
60      25.5    36.9    5.803331        5.803331        8.325665        
9.347093        8.867335        8.81034 8.362224        8.091226        7.932323
61      27.2    36.9    2.944965        2.944965        3.889826        
4.429833        3.997566        4.039624        3.803829        3.649744        
3.569298
62      -8.81   37.1    72.42304        72.42304        72.49152        
72.55966        72.65497        72.57725        71.48016        71.46061        
71.42513
63      -8.31   37.1    70.43262        70.43262        70.48452        
70.52604        70.6184 70.53002        69.52575        69.51653        69.4868
64      -8.06   37.1    69.49957        69.49957        69.54058        69.5681 
69.66197        69.57228        68.63026        68.62502        68.59781
65      -7.81   37.1    67.79556        67.79556        67.82962        
67.86356        67.94226        67.85578        67.01823        67.01363        
66.98258
66      -6.56   37.1    62.02057        62.02057        62.00977        62.1377 
62.1292 62.08567        61.84483        61.79827        61.70458
67      -6.31   37.1    62.64548        62.64548        62.61484        
62.77212        62.75615        62.71707        62.54326        62.48241        
62.37594
68      -6.06   37.1    63.30067        63.30067        63.25806        
63.43879        63.42099        63.39245        63.23405        63.16106        
63.04445
69      -5.81   37.1    62.94823        62.94823        62.89574        
63.09122        63.07161        63.04839        62.93195        62.85041        
62.72695
70      -5.56   37.1    61.84146        61.84146        61.7865 61.98619        
61.96725        61.9491 61.86189        61.77611        61.65119
71      -5.31   37.1    59.97714        59.97714        59.92396        60.1214 
60.11082        60.10191        60.04272        59.95587        59.83581
72      -5.06   37.1    58.0307 58.0307 57.98096        58.17301        
58.16708        58.16281        58.1206 58.03473        57.91711
73      -4.81   37.1    55.51851        55.51851        55.46442        
55.65347        55.6605 55.66336        55.63546        55.55039        55.43486
74      -4.56   37.1    53.21563        53.21563        53.16912        
53.35468        53.36749        53.37322        53.3517 53.26929        53.1588
75      -4.31   37.1    50.91662        50.91662        50.87474        
51.04914        51.06884        51.07657        51.06355        50.98723        
50.88099
76      -4.06   37.1    48.81768        48.81768        48.77963        
48.94175        48.968  48.97639        48.96967        48.90093        48.79965
77      -3.81   37.1    47.95221        47.95221        47.91826        
48.06177        48.09304        48.10522        48.09834        48.03971        
47.93698
78      -3.56   37.1    47.15025        47.15025        47.11757        
47.25254        47.28172        47.28776        47.27985        47.2271 47.13358
79      -3.31   37.1    47.53066        47.53066        47.49408        
47.61669        47.64526        47.64684        47.63867        47.59505        
47.50528
80      -3.06   37.1    48.46439        48.46439        48.42204        48.5321 
48.55851        48.55428        48.54388        48.51011        48.42441
81      -2.81   37.1    49.63347        49.63347        49.58426        
49.68138        49.70504        49.69402        49.67982        49.65678        
49.576
82      -2.56   37.1    51.023  51.023  50.96591        51.04792        
51.07084        51.05411        51.03272        51.0227 50.94439
83      -2.31   37.1    52.26428        52.26428        52.19878        
52.26856        52.28853        52.26376        52.23771        52.2395 52.16894
84      -2.06   37.1    53.47266        53.47266        53.39835        
53.45612        53.47331        53.44031        53.40881        53.42253        
53.36039
85      14      37.1    66.99443        66.99443        66.45399        
65.71458        65.74993        65.90858        66.11251        66.50272        
66.60815
86      14.2    37.1    70.49787        70.49787        69.93037        
69.15626        69.20161        69.36525        69.56692        69.96676        
70.07011
87      14.5    37.1    69.86925        69.86925        69.27427        
68.47398        68.51035        68.66943        68.87441        69.2849 69.38989
88      14.7    37.1    72.32402        72.32402        71.72529        
70.92098        70.96072        71.1172 71.32223        71.74082        71.83413
89      15      37.1    71.40617        71.40617        70.78247        
69.95565        69.98635        70.13763        70.34473        70.77216        
70.86647
90      15.2    37.1    56.23   56.23   55.60898        54.76708        
54.76863        54.87291        55.07535        55.54319        55.64263
91      21.7    37.1    18.32611        18.32611        16.6181 17.17706        
17.00542        17.12683        16.9717 16.9435 16.85361
92      22      37.1    12.7036 12.7036 13.69239        14.36643        
14.19853        14.31207        14.12338        14.04382        13.94009
93      22.2    37.1    12.62893        12.62893        13.6905 14.36805        
14.18032        14.27716        14.07367        13.98589        13.88034
94      22.5    37.1    12.23577        12.23577        13.3901 14.08735        
13.86901        13.94554        13.71957        13.61879        13.51077
95      22.7    37.1    11.49043        11.49043        12.92069        
13.64908        13.39171        13.44239        13.18774        13.07086        
12.9599
96      23      37.1    10.88278        10.88278        12.45234        13.2144 
13.00018        13.01147        12.71598        12.57259        12.45233
97      25.2    37.1    6.414629        6.414629        8.582715        
9.419659        8.925712        8.779796        8.332105        8.072648        
7.929139
98      25.5    37.1    6.001904        6.001904        8.088657        
8.890805        8.376182        8.244982        7.815469        7.564053        
7.425938
99      -8.81   37.4    72.57469        72.57469        72.67127        
72.75824        72.85027        72.77404        71.64407        71.63558        
71.60221
100     -8.56   37.4    71.26689        71.26689        71.35687        71.433  
71.5199 71.43746        70.35954        70.35821        70.32794
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to