Revision b7b786b1
Added by Adam M. Wilson over 12 years ago
climate/extra/dailydatasize.r | ||
---|---|---|
10 | 10 |
## Land Area |
11 | 11 |
n.land=148940000 #km2, from http://en.wikipedia.org/wiki/Earth |
12 | 12 |
|
13 |
## total values |
|
13 |
## total values (space x time)
|
|
14 | 14 |
n.landtime=n.dates*n.land |
15 | 15 |
n.globetime=n.dates*n.globe |
16 | 16 |
|
... | ... | |
22 | 22 |
|
23 | 23 |
### approximate storage size for various data types |
24 | 24 |
types=as.data.frame(matrix(c( |
25 |
"Short integer",-32768, 32767,2, |
|
26 |
"Long integer", -2147483648,2147483647,4, |
|
27 |
"Single-precision floating-point", -3.4e38,1.2e38,4, |
|
28 |
"Double-precision floating-point", -2.2e308,1.8e308,8 |
|
29 |
),ncol=4,byrow=T,dimnames=list(1:4,c("type","min","max","bytes"))),stringsAsFactors=F)
|
|
25 |
"short int","Short integer",-32768, 32767,2,
|
|
26 |
"long int","Long integer", -2147483648,2147483647,4,
|
|
27 |
"single","Single-precision floating-point", -3.4e38,1.2e38,4,
|
|
28 |
"double","Double-precision floating-point", -2.2e308,1.8e308,8
|
|
29 |
),ncol=5,byrow=T,dimnames=list(1:4,c("type","longtype","min","max","bytes"))),stringsAsFactors=F)
|
|
30 | 30 |
types$min=as.numeric(types$min);types$max=as.numeric(types$max);types$bytes=as.numeric(types$bytes) |
31 | 31 |
types |
32 | 32 |
|
33 |
### now estimate TB storage for total values (not full grid, just the values)
|
|
33 |
### now estimate TB storage for total values |
|
34 | 34 |
|
35 |
types$storage.landtime.TB=n.landtime*types$bytes/2^40
|
|
36 |
types$storage.globetime.TB=n.globetime*types$bytes/2^40; types
|
|
35 |
types$storage.landtime.TB=round(n.landtime*types$bytes/2^40,1)
|
|
36 |
types$storage.globetime.TB=round(n.globetime*types$bytes/2^40,1); types
|
|
37 | 37 |
|
38 |
types[,-c(2:4)] |
Also available in: Unified diff
Minor updates to dataset size calculation