Basic Information
Entering an Equation
Operators
Datasets with Time Series Layers
Map and Data Controls
Examples
Appendices-
Data Calculator allows a user to execute algebraic and logical expressions/equations over any number of the gridded datasets in the system on the fly and display results in a form of map and histogram and/or download these results as an ASCII data (AAIGrid format). The calculations are performed on the grid cell level over the map extends chosen by a user in the main window.
"Equation" input form-
The equation has to be entered in this input form and it can contain basic
and advanced mathematical functions, conditional operators explained below in
the Operators section. A set of special instructions
could be used to control the calculation results and graphical design of the
result visualization by the map and the histogram. This instructions are
accessible via fold-out menus named Map Options, Data Options, and Color
Options.
"Integral" input form-
An equation entered in this input form is integrated over map extent area in per
km2 units. Integration is performed only over pixels/area where
integration equation returns a real number and skips pixels where any involved
in the integration dataset has nodata value (-9999) or the equation return "illegal
operation" result such as division by zero, etc. The integration results
are displayed as a text in the histogram area of the calculation results
graphics.
Equation has to present a valid mathematical and/or logical expression that contain a combination of variables and operators. In the case of this Calculator variables are numerical gridded datasets as the calculations are applied to each of their grid cells/pixels. Dataset notations (symbols) cold be found in the Dataset Table which are usually grouped by theme and accessible radio button switches. For the user convenience, mouse clicking on the symbols in the Dataset Table automatically enters them to the active Equation or Integral input line at the active caret position. This ensures that the symbol is not misspelled as it is also case sensitive. Of course, a user can type in dataset symbols directly. For example, a very simple calculation to convert elevation from meter to kilometer units could be done by this equation Elev/1000 where symbol "Elev" represents the elevation dataset.
Alrthmetic Operators-
Operator | Action | Example |
+ | Addition | Elev + 10 |
- | Subtraction | Elev - Bath |
* | Multiplication | Elev * 100 |
/ | Division | Elev / 1000 |
** | Power | Elev ** 2 |
% | Modulus | Elev % 1000 |
Logical Operators-
Operator | Action | Example |
> | Greater than | Elev > 1000 |
>= | Greater than or Equal to | Elev >= 1000 |
< | Less than | Elev < 1000 |
<= | Less than or Equal to | Elev <= 1000 |
== | Equal to | CNTRYMSK == 236 |
!= | Not equal to | CNTRYMSK != 236 |
&& | Logical "and" | (CNTRYMSK == 236) && (Lon > -140) |
|| | Logical "or" | (CNTRYMSK == 236) || (CNTRYMSK == 40) |
? : | If then else | (Elev < 500) ? Elev : -9999 |
Mathematical Functions-
Function | Action | Example |
log() | Natural logarithm | log(Elev) |
log10() | Base 10 logarithm | log10(Elev/1000) |
exp() | Exponent | exp(Elev) |
sqrt() | Square root | sqrt(Elev) |
abs() | Absolute value | abs(Bath) |
pi | Trigonometric constant pi | (Lon/180)*pi |
Trigonometric functions | All trigonometric functions | sin(Lat/180*pi) |
POSIX functions | Some commonly used numeric functions | floor(Elev/1000) |
Single Layer Referencing-
Datasets with Time Series Layers (TSL) are indicated by a star (*) symbol in
the Data Table. Each layer can be a accessed via TSL identifier in a form {YYYY-MM-DD}. For example, a difference in Sea Surface Temperature between two dates (summer
and winter) could be calculated by this equation-
SST{2007-07-15} - SST{2007-12-15}
a). In the case of this equation a user can enhance resulting map color range by setting Map Options -> Min = -10 and Map Options -> Max = 20. It is also recommended to use global map extend.
If no TSL identifier is provided for a given time series dataset than the latest (last) data layer is used in the equation, e.g. equation
(SST * 1.8) + 32
converts sea surface temperature from Celsius to Fahrenheit for the latest data layer in SST dataset. And if a user want to do the same for some specific date, say November 12, 2007 then it could be done with this formula-
(SST{2007-11-12} * 1.8) + 32
Range of Layers Referencing-
A syntax to call a range of Time Series Layers (TSL) is provided by a double dot
operator in the form of {YYYY-MM-DD..YYYY-MM-DD} where the first data has
to be earlier than the second date after the double dot operator. The double dot
operator returns an array of layers so that array functions could be used on
them (such as min(), max(), average(), sum(), map(), etc.). For example,
a number of days with precipitable atmosphere moisture over 100 mm in the month
of July, 2007 could be calculated with this equation-
sum( map($_>50, PrecipN{2007-07-01..2007-07-31}) )
a). Attention- Symbol $_ used in this equation references each element in the array PrecipN{2007-07-01..2007-07-31} by the map() function.
b). In the case of this equation a user can enhance resulting map color range by setting Map Options -> Min = 1 and Map Options -> Max = 15. It is also recommended to use global map extend.
c). Caution- Avoid to use equations that require too many data layers to be called (31 data layers are called in this example) as it might take a longer time to perform this computation.
Time Series Layer Types-
Different time series types are referenced by their specific form of referencing
indicated in the table below-
Time Series Type | Syntax | Example |
Daily | {YYYY-MM-DD} | DataDD{2007-11-12} - Nov 12, 2007 |
Daily Climatology | {0000-MM-DD} | DataDC{0000-07-04} - Jul 4 climatology |
Monthly | {YYYY-MM-00} | DataMD{2007-01-00} - Jan, 2007 |
Monthly Climatology | {0000-MM-00} | DataMC{0000-10-00} - Oct climatology |
Yearly | {YYYY-00-00} | DataYD{2006-00-00} - 2006 |
Yearly climatology | {0000-00-00}, useless as it is a single layer | DataYC - long term averrage |
The logic of the date syntax is that it is the same format for all (XXXX-XX-XX) where zeroes denote something that is not available as, say, days in the monthly datasets.
Map Options Tab-
It has two controls-
Data Options Tab-
It has three controls-
Color Options Tab-
It has only one control at this time-
Usage example- Population-2000 of China where 46 is country ID code for China-
Pop00 if Country == 46
Map Options -> Use Log Scale = checked.
Use in both Equation and Integral inputs.
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Usage example- Population-2000 of New Hampshire where 33 is state ID code for NH-
Pop00 if State == 33
Map Options -> Use Log Scale = checked.
Use in both Equation and Integral inputs.
FIPS | State | ID | FIPS | State | ID | |
---|---|---|---|---|---|---|
AL | Alabama | 1 | MT | Montana | 30 | |
AK | Alaska | 2 | NE | Nebraska | 31 | |
AZ | Arizona | 4 | NV | Nevada | 32 | |
AR | Arkansas | 5 | NH | New Hampshire | 33 | |
CA | California | 6 | NJ | New Jersey | 34 | |
CO | Colorado | 8 | NM | New Mexico | 35 | |
CT | Connecticut | 9 | NY | New York | 36 | |
DE | Delaware | 10 | NC | North Carolina | 37 | |
DC | District of Columbia | 11 | ND | North Dakota | 38 | |
FL | Florida | 12 | OH | Ohio | 39 | |
GA | Georgia | 13 | OK | Oklahoma | 40 | |
HI | Hawaii | 15 | OR | Oregon | 41 | |
ID | Idaho | 16 | PA | Pennsylvania | 42 | |
IL | Illinois | 17 | RI | Rhode Island | 44 | |
IN | Indiana | 18 | SC | South Carolina | 45 | |
IA | Iowa | 19 | SD | South Dakota | 46 | |
KS | Kansas | 20 | TN | Tennessee | 47 | |
KY | Kentucky | 21 | TX | Texas | 48 | |
LA | Louisiana | 22 | UT | Utah | 49 | |
ME | Maine | 23 | VT | Vermont | 50 | |
MD | Maryland | 24 | VA | Virginia | 51 | |
MA | Massachusetts | 25 | WA | Washington | 53 | |
MI | Michigan | 26 | WV | West Virginia | 54 | |
MN | Minnesota | 27 | WI | Wisconsin | 55 | |
MS | Mississippi | 28 | WY | Wyoming | 56 | |
MO | Missouri | 29 |
River (Watershed) Basins only with area over 100,000 km2 are referenced in the table below (about 150 basins). Total number of basins in RiverB dataset is over 10,000. So other basin IDs could be found by mouse over data reading on the main map above the Calculator.
Usage example- Population-2000 in Indus Basin where 26 is this basin ID code-
Pop00 if RiverB == 26
Map Options -> Use Log Scale = checked.
Use in both Equation and Integral inputs.
ID | Basin Name |
Basin Length, km |
Basin Area, km2 |
Continent | Sea | Ocean |
---|---|---|---|---|---|---|
1 | Amazon | 5,041 | 5,993,746 | South America | Atlantic Ocean | Atlantic Ocean |
2 | Zaire | 4,949 | 3,709,316 | Africa | Atlantic Ocean | Atlantic Ocean |
3 | Mississippi | 4,750 | 3,231,620 | North America | Atlantic Ocean | Atlantic Ocean |
4 | Nile | 6,238 | 3,076,904 | Africa | Mediterranean Sea | Mediterranean |
5 | Parana | 2,922 | 2,717,458 | South America | Atlantic Ocean | Atlantic Ocean |
6 | Ob | 4,092 | 2,525,457 | Asia | Kara Sea | Arctic Ocean |
7 | Yenisei | 5,115 | 2,516,145 | Asia | Kara Sea | Arctic Ocean |
8 | Niger | 3,090 | 2,509,111 | Africa | Atlantic Ocean | Atlantic Ocean |
9 | Lena | 4,634 | 2,457,938 | Asia | Laptev Sea | Arctic Ocean |
10 | Amur | 4,401 | 1,989,248 | Asia | Pacific Ocean | Pacific Ocean |
11 | Chang Jiang | 5,094 | 1,920,851 | Asia | Pacific Ocean | Pacific Ocean |
12 | Mackenzie | 3,858 | 1,757,521 | North America | Beaufort Sea | Arctic Ocean |
13 | Volga | 3,321 | 1,403,367 | Europe | Caspian Sea | Land |
14 | Zambezi | 2,738 | 1,384,443 | Africa | Indian Ocean | Indian Ocean |
15 | Araye | 2,235 | 1,200,583 | Africa | Mediterranean Sea | Mediterranean |
16 | Bode le Depression | 1,922 | 1,107,307 | Africa | Mediterranean Sea | Mediterranean |
17 | Nelson | 2,057 | 1,106,634 | North America | Hudson Bay | Atlantic Ocean |
18 | St. Lawrence | 2,647 | 1,034,644 | North America | Atlantic Ocean | Atlantic Ocean |
19 | Irharhar | 2,203 | 950,763 | Africa | Mediterranean Sea | Mediterranean |
20 | Ganges | 2,064 | 948,029 | Asia | Indian Ocean | Indian Ocean |
22 | Orange | 1,926 | 914,052 | Africa | Atlantic Ocean | Atlantic Ocean |
23 | Shatt el Arab | 2,548 | 878,926 | Asia | Indian Ocean | Indian Ocean |
24 | Orinoco | 2,278 | 837,669 | South America | Atlantic Ocean | Atlantic Ocean |
25 | Yukon | 3,123 | 820,635 | North America | Bering Strait | Pacific Ocean |
26 | Indus | 2,837 | 816,843 | Asia | Indian Ocean | Indian Ocean |
27 | Huang He | 4,603 | 814,942 | Asia | Pacific Ocean | Pacific Ocean |
28 | Danube | 2,535 | 787,517 | Europe | Black Sea | Mediterranean |
29 | Mekong | 4,308 | 770,627 | Asia | Pacific Ocean | Pacific Ocean |
30 | Tocantins | 2,322 | 767,948 | South America | Atlantic Ocean | Atlantic Ocean |
31 | Amu-Darya | 2,249 | 686,621 | Asia | Aral Sea | Land |
32 | Colorado (Arizona) | 2,015 | 678,874 | North America | Pacific Ocean | Pacific Ocean |
33 | Columbia | 1,755 | 666,063 | North America | Pacific Ocean | Pacific Ocean |
34 | Kolyma | 2,313 | 656,201 | Asia | East Siberian Sea | Arctic Ocean |
35 | Okavango | 1,763 | 646,759 | Africa | Indian Ocean | Indian Ocean |
38 | Sao Francisco | 2,487 | 621,193 | South America | Atlantic Ocean | Atlantic Ocean |
40 | Syr-Darya | 1,656 | 546,701 | Asia | Aral Sea | Land |
41 | Jubba | 1,173 | 533,627 | Africa | Indian Ocean | Indian Ocean |
43 | Dnepr | 1,568 | 507,131 | Europe | Black Sea | Mediterranean |
44 | Rio Grande (US) | 2,342 | 500,757 | North America | Atlantic Ocean | Atlantic Ocean |
45 | Senegal | 1,341 | 434,745 | Africa | Atlantic Ocean | Atlantic Ocean |
46 | Don | 1,502 | 430,896 | Europe | Black Sea | Mediterranean |
47 | Volta | 1,665 | 418,951 | Africa | Atlantic Ocean | Atlantic Ocean |
48 | Limpopo | 1,358 | 415,608 | Africa | Indian Ocean | Indian Ocean |
49 | Ruo Dong | 1,076 | 408,120 | Asia | Pacific Ocean | Pacific Ocean |
50 | Zhujiang | 1,855 | 405,470 | Asia | Pacific Ocean | Pacific Ocean |
51 | Irrawaddy | 1,876 | 391,740 | Asia | Indian Ocean | Indian Ocean |
52 | Dvina | 1,497 | 362,840 | Europe | Barents Sea | Arctic Ocean |
54 | Qattara | 1,244 | 344,879 | Africa | Mediterranean Sea | Mediterranean |
55 | Farah | 1,342 | 339,224 | Asia | Indian Ocean | Indian Ocean |
56 | Parnaiba | 1,228 | 331,719 | South America | Atlantic Ocean | Atlantic Ocean |
57 | Indigirka | 1,632 | 326,534 | Asia | East Siberian Sea | Arctic Ocean |
58 | Pechora | 1,289 | 316,364 | Europe | Barents Sea | Arctic Ocean |
59 | Godavari | 1,235 | 311,550 | Asia | Indian Ocean | Indian Ocean |
62 | Churchill (Hudson Bay) | 1,762 | 301,987 | North America | Hudson Bay | Atlantic Ocean |
63 | Khatanga | 1,422 | 301,076 | Asia | Laptev Sea | Arctic Ocean |
64 | Colorado (Argentina) | 1,567 | 292,966 | South America | Atlantic Ocean | Atlantic Ocean |
65 | Tamanrasett | 1,086 | 292,526 | Africa | Atlantic Ocean | Atlantic Ocean |
66 | Neva | 879 | 283,390 | Europe | Baltic Sea | Atlantic Ocean |
68 | Krishna | 1,186 | 278,706 | Asia | Indian Ocean | Indian Ocean |
70 | Urugay | 1,451 | 263,637 | South America | Atlantic Ocean | Atlantic Ocean |
72 | Baker | 1,190 | 259,955 | North America | Arctic Archipelago | Arctic Ocean |
73 | Salado | 1,073 | 259,717 | South America | Atlantic Ocean | Atlantic Ocean |
75 | Taz | 1,069 | 252,531 | Asia | Kara Sea | Arctic Ocean |
77 | Ural | 1,580 | 250,384 | Asia | Caspian Sea | Land |
79 | Yana | 1,078 | 234,000 | Asia | Laptev Sea | Arctic Ocean |
80 | Fraser | 1,130 | 230,327 | North America | Pacific Ocean | Pacific Ocean |
82 | Ogooue | 897 | 219,915 | Africa | Atlantic Ocean | Atlantic Ocean |
84 | Liao | 1,075 | 211,216 | Asia | Pacific Ocean | Pacific Ocean |
86 | Rufiji | 846 | 205,324 | Africa | Indian Ocean | Indian Ocean |
88 | Lake Rudolf | 743 | 201,063 | Africa | Indian Ocean | Indian Ocean |
90 | Wisla | 995 | 193,610 | Europe | Baltic Sea | Atlantic Ocean |
91 | Kura | 980 | 188,678 | Asia | Caspian Sea | Land |
92 | Rhine | 1,120 | 186,089 | Europe | North Sea | Atlantic Ocean |
93 | Great Artesian Basin | 1,018 | 185,289 | Australia | Indian Ocean | Indian Ocean |
94 | Anadyr | 893 | 185,159 | Asia | Bering Strait | Pacific Ocean |
96 | Pyasina | 1,112 | 178,294 | Asia | Kara Sea | Arctic Ocean |
97 | Jaji | 936 | 176,606 | Asia | Caspian Sea | Land |
98 | Shur | 516 | 172,048 | Asia | Indian Ocean | Indian Ocean |
100 | Chao Phraya | 936 | 169,359 | Asia | Pacific Ocean | Pacific Ocean |
102 | Magdalena | 1,082 | 165,961 | South America | Atlantic Ocean | Atlantic Ocean |
107 | Sanaga | 848 | 161,140 | Africa | Atlantic Ocean | Atlantic Ocean |
108 | Roviuna | 887 | 155,507 | Africa | Indian Ocean | Indian Ocean |
109 | Grande de Santiago | 886 | 154,131 | North America | Pacific Ocean | Pacific Ocean |
110 | San Joaquin | 754 | 153,601 | North America | Pacific Ocean | Pacific Ocean |
114 | Tarim | 972 | 150,750 | Asia | Indian Ocean | Indian Ocean |
115 | Hong | 946 | 150,411 | Asia | Pacific Ocean | Pacific Ocean |
116 | Koksoak | 838 | 145,292 | North America | Hudson Strait | Atlantic Ocean |
117 | Elbe | 964 | 141,891 | Europe | North Sea | Atlantic Ocean |
118 | Cuanza | 957 | 141,620 | Africa | Atlantic Ocean | Atlantic Ocean |
120 | Lake Balkhash | 737 | 138,110 | Asia | Aral Sea | Land |
121 | Hai Ho | 659 | 137,524 | Asia | Pacific Ocean | Pacific Ocean |
122 | Albany | 1,052 | 136,777 | North America | Hudson Bay | Atlantic Ocean |
123 | Taymyr | 716 | 134,328 | Australia | Indian Ocean | Indian Ocean |
124 | Mahanadi | 910 | 132,386 | Asia | Indian Ocean | Indian Ocean |
125 | Brazos | 1,291 | 125,502 | North America | Atlantic Ocean | Atlantic Ocean |
126 | Emba | 681 | 125,431 | Asia | Caspian Sea | Land |
129 | Usumacinta | 614 | 123,933 | North America | Atlantic Ocean | Atlantic Ocean |
130 | Odra | 782 | 120,616 | Europe | Baltic Sea | Atlantic Ocean |
132 | Kuskowin | 893 | 118,096 | North America | Pacific Ocean | Pacific Ocean |
134 | Loire | 836 | 117,327 | Europe | Atlantic Ocean | Atlantic Ocean |
135 | Taymyra | 768 | 116,466 | Asia | Kara Sea | Arctic Ocean |
136 | Nottaway | 668 | 115,246 | North America | Hudson Bay | Atlantic Ocean |
139 | Alabama | 707 | 113,612 | North America | Atlantic Ocean | Atlantic Ocean |
140 | La Grande | 808 | 112,771 | North America | Hudson Bay | Atlantic Ocean |
141 | Flinders | 755 | 111,534 | Australia | Indian Ocean | Indian Ocean |
142 | Cunene | 998 | 111,236 | Africa | Atlantic Ocean | Atlantic Ocean |
143 | Colorado | 1,108 | 110,562 | North America | Atlantic Ocean | Atlantic Ocean |
145 | Moose | 545 | 110,339 | North America | Hudson Bay | Atlantic Ocean |
146 | Balsas | 657 | 110,019 | North America | Pacific Ocean | Pacific Ocean |
148 | Save | 740 | 108,204 | Africa | Indian Ocean | Indian Ocean |
149 | Churchill | 811 | 106,419 | North America | Atlantic Ocean | Atlantic Ocean |
151 | Hayes | 566 | 103,742 | North America | Hudson Bay | Atlantic Ocean |
Usage example- Population-2000 in Africa where 1 is its ID code-
Pop00 if Cont == 1
Map Options -> Use Log Scale = checked.
Use in both Equation and Integral inputs.
ID | (Sub) Continent Name |
---|---|
0 | Africa |
1 | Antarctica |
2 | Asia |
3 | Australia |
4 | Europe |
5 | Greenland |
6 | Indonesia |
7 | New Zealand |
8 | North America |
9 | Oceans |
10 | Papua New Guinea |
11 | South America |
12 | Indonesia |