Accessing the Data Cube
Open a datacube
Before one can read data from a cube, it has to be opened. To open a data cube which is accesible through the file system, use the Cube
constructor:
using EarthDataLab
c = Cube("/patch/to/cube")
EarthDataLab data cube at /Net/Groups/BGI/scratch/DataCube/v0.2.0/high-res/
Spatial resolution: 4320x2160 at 0.083333 degrees.
Temporal resolution: 2001-01-01T00:00:00 to 2012-01-01T00:00:00 at 8daily time steps
Variables: aerosol_optical_thickness_1610 aerosol_optical_thickness_550 aerosol_optical_thickness_555 aerosol_optical_thickness_659 aerosol_optical_thickness_865 air_temperature_2m bare_soil_evaporation black_sky_albedo burnt_area c_emissions country_mask evaporation evaporative_stress fractional_snow_cover gross_primary_productivity interception_loss land_surface_temperature latent_energy net_ecosystem_exchange open_water_evaporation ozone potential_evaporation precipitation root_moisture sensible_heat snow_sublimation snow_water_equivalent soil_moisture surface_moisture terrestrial_ecosystem_respiration transpiration water_mask water_vapour white_sky_albedo
This returns a Cube
object that contains some basics information about the cube which is printed on the screen.
Getting a data handle
using EarthDataLab
c=Cube()
var=["c_emissions","air_temperature_2m"]
time=(Date("2003-01-01"),Date("2003-12-31"))
cubedata = subsetcube(c,lon=(30,31),lat=(50,51),time=time,variable=var)
This returns a view into the Data Cube, on which further calculations can be applied.
No data is read yet. In case you want to load some data into memory and store it in a Julia array, just use square-bracket indexing. For example, to read the first time step of the first variable as a Lon-Lat array, just do
cubedata[:,:,1,1]
Here you can start to do some calculations on your sub-cube, see either Analysis for a list of methods provided by this framework or Applying custom functions to apply your own functions on the cube.
Extracting a list of lon/lat coordinates from a data cube
There are situations in which only a certain list of longitude/latitude pairs is needed for the analysis. One can extract such a list by first creating a cube view containing all the needed variables and then apply the extractLonLats
function.
Missing docstring for EarthDataLab.Proc.extractLonLats
. Check Documenter's build log for details.
Here is an example how to apply the function:
cubedata = subsetcube(c,lon=(30,31),lat=(50,51),time=time,variable=var)
ll = [30.1 50.2;
30.5 51.1;
30.7 51.1] #Lon/Lats to be extracted
cubenew = extractLonLats(cubedata,ll)
Cube Types
While the subsetcube
command returns an object of type ZarrCube
, which represents a view into the ESDC, other cube operations will return different types of data cubes. The returned type will depend on the size of the returned cube. If it is small enough to fit into memory, it will be a CubeMem
, otherwise a ZArrayCube
. All these types of data cubes share the same interface defined by, which means you can index them, do calculation using mapCube
or plot them.
Cube Dimensions
Dimensions are an essential part of each Cube in EarthDataLab. Every dimension that a cube has is associated with an axis that stores the values of the dimension. For example, a LatAxis
will contain a field values
representing the chosen latitudes. Similarly, a VariableAxis
will contain a list of Variable names. Axes types are divided in categorical axes and axes represented by ranges. All of them are subtypes of the abstract type CubeAxis
.
List of known regions
EarthDataLab.known_regions
— ConstantList of Continents
- Africa
- Asia
- Australia
- Europe
- North America
- South America
List of SREX regions
Short Name | Long Name |
---|---|
ALA | Alaska/N.W. Canada |
AMZ | Amazon |
CAM | Central America/Mexico |
CAR | small islands regions Caribbean |
CAS | Central Asia |
CEU | Central Europe |
CGI | Canada/Greenland/Iceland |
CNA | Central North America |
EAF | East Africa |
EAS | East Asia |
ENA | East North America |
MED | South Europe/Mediterranean |
NAS | North Asia |
NAU | North Australia |
NEB | North-East Brazil |
NEU | North Europe |
SAF | Southern Africa |
SAH | Sahara |
SAS | South Asia |
SAU | South Australia/New Zealand |
SEA | Southeast Asia |
SSA | Southeastern South America |
TIB | Tibetan Plateau |
WAF | West Africa |
WAS | West Asia |
WNA | West North America |
WSA | West Coast South America |
ANT | Antarctica |
ARC | Arctic |
NTP | Pacific Islands region |
STP | Southern Topical Pacific |
ETP | Pacific Islands region |
WIO | West Indian Ocean |
List of countries
Short Name | Long Name |
---|---|
ABW | Aruba |
AFG | Afghanistan |
AGO | Angola |
AIA | Anguilla |
ALB | Albania |
ALA | Aland |
AND | Andorra |
ARE | United Arab Emirates |
ARG | Argentina |
ARM | Armenia |
ASM | American Samoa |
ATA | Antarctica |
Ashm | Ashmore and Cartier Is. |
ATF | Fr. S. and Antarctic Lands |
ATG | Antigua and Barb. |
AUS | Australia |
AUT | Austria |
AZE | Azerbaijan |
BDI | Burundi |
BEL | Belgium |
BEN | Benin |
BFA | Burkina Faso |
BGD | Bangladesh |
BGR | Bulgaria |
BHR | Bahrain |
BHS | Bahamas |
BIH | Bosnia and Herz. |
BLM | St. Barthelemy |
BLR | Belarus |
BLZ | Belize |
BMU | Bermuda |
BOL | Bolivia |
BRA | Brazil |
BRB | Barbados |
BRN | Brunei |
BTN | Bhutan |
BWA | Botswana |
CAF | Central African Rep. |
CAN | Canada |
CHE | Switzerland |
CHL | Chile |
CHN | China |
CIV | Ivory Coast |
CLP | Clipperton I. |
CMR | Cameroon |
CNM | |
COD | Congo (Kinshasa) |
COG | Congo (Brazzaville) |
COK | Cook Is. |
COL | Colombia |
COM | Comoros |
CPV | Cape Verde |
CRI | Costa Rica |
CSI | Coral Sea Is. |
CUB | Cuba |
CUW | Curacao |
CYM | Cayman Is. |
CYN | N. Cyprus |
CYP | Cyprus |
CZE | Czech Rep. |
DEU | Germany |
DJI | Djibouti |
DMA | Dominica |
DNK | Denmark |
DOM | Dominican Rep. |
DZA | Algeria |
ECU | Ecuador |
EGY | Egypt |
ERI | Eritrea |
ESB | Dhekelia |
ESP | Spain |
EST | Estonia |
ETH | Ethiopia |
FIN | Finland |
FJI | Fiji |
FLK | Falkland Is. |
FRA | France |
FRO | Faroe Is. |
FSM | Micronesia |
GAB | Gabon |
Gaza | Gaza |
GBR | United Kingdom |
GEO | Georgia |
GGY | Guernsey |
GHA | Ghana |
GIB | Gibraltar |
GIN | Guinea |
GMB | Gambia |
GNB | Guinea Bissau |
GNQ | Eq. Guinea |
GRC | Greece |
GRD | Grenada |
GRL | Greenland |
GTM | Guatemala |
GUM | Guam |
GUY | Guyana |
HKG | Hong Kong |
HMD | Heard I. and McDonald Is. |
HND | Honduras |
HRV | Croatia |
HTI | Haiti |
HUN | Hungary |
IDN | Indonesia |
IMN | Isle of Man |
IND | India |
IOA | Indian Ocean Ter. |
IOT | Br. Indian Ocean Ter. |
IRL | Ireland |
IRN | Iran |
IRQ | Iraq |
ISL | Iceland |
ISR | Israel |
ITA | Italy |
JAM | Jamaica |
JEY | Jersey |
JOR | Jordan |
JPN | Japan |
KAB | Baykonur |
KAS | |
KAZ | Kazakhstan |
KEN | Kenya |
KGZ | Kyrgyzstan |
KHM | Cambodia |
KIR | Kiribati |
KNA | St. Kitts and Nevis |
KNM | |
KOR | S. Korea |
KOS | Kosovo |
KWT | Kuwait |
LAO | Laos |
LBN | Lebanon |
LBR | Liberia |
LBY | Libya |
LCA | Saint Lucia |
LIE | Liechtenstein |
LKA | Sri Lanka |
LSO | Lesotho |
LTU | Lithuania |
LUX | Luxembourg |
LVA | Latvia |
MAC | Macau |
MAF | St. Martin |
MAR | Morocco |
MCO | Monaco |
MDA | Moldova |
MDG | Madagascar |
MDV | Maldives |
MEX | Mexico |
MHL | Marshall Is. |
MKD | Macedonia |
MLI | Mali |
MLT | Malta |
MMR | Myanmar |
MNE | Montenegro |
MNG | Mongolia |
MNP | N. Mariana Is. |
MOZ | Mozambique |
MRT | Mauritania |
MSR | Montserrat |
MUS | Mauritius |
MWI | Malawi |
MYS | Malaysia |
NAM | Namibia |
NCL | New Caledonia |
NER | Niger |
NFK | Norfolk Island |
NGA | Nigeria |
NIC | Nicaragua |
NIU | Niue |
NLD | Netherlands |
NOR | Norway |
NPL | Nepal |
NRU | Nauru |
NZL | New Zealand |
OMN | Oman |
PAK | Pakistan |
PAN | Panama |
PCN | Pitcairn Is. |
PER | Peru |
PHL | Philippines |
PLW | Palau |
PNG | Papua New Guinea |
POL | Poland |
PRI | Puerto Rico |
PRK | N. Korea |
PRT | Portugal |
PRY | Paraguay |
PYF | Fr. Polynesia |
QAT | Qatar |
ROU | Romania |
RUS | Russia |
RWA | Rwanda |
SAH | W. Sahara |
SAU | Saudi Arabia |
SDN | Sudan |
SDS | S. Sudan |
SEN | Senegal |
SGP | Singapore |
SGS | S. Geo. and S. Sandw. Is. |
SHN | Saint Helena |
SLB | Solomon Is. |
SLE | Sierra Leone |
SLV | El Salvador |
SMR | San Marino |
SOL | Somaliland |
SOM | Somalia |
SPM | St. Pierre and Miquelon |
SRB | Serbia |
STP | Sao Tome and Principe |
SUR | Suriname |
SVK | Slovakia |
SVN | Slovenia |
SWE | Sweden |
SWZ | Swaziland |
SXM | Sint Maarten |
SYC | Seychelles |
SYR | Syria |
TCA | Turks and Caicos Is. |
TCD | Chad |
TGO | Togo |
THA | Thailand |
TJK | Tajikistan |
TKM | Turkmenistan |
TLS | East Timor |
TON | Tonga |
TTO | Trinidad and Tobago |
TUN | Tunisia |
TUR | Turkey |
TUV | Tuvalu |
TWN | Taiwan |
TZA | Tanzania |
UGA | Uganda |
UKR | Ukraine |
UMI | U.S. Minor Outlying Is. |
URY | Uruguay |
USA | United States |
USG | Guantanamo Bay USNB |
UZB | Uzbekistan |
VAT | Vatican |
VCT | St. Vin. and Gren. |
VEN | Venezuela |
VGB | British Virgin Is. |
VIR | U.S. Virgin Is. |
VNM | Vietnam |
VUT | Vanuatu |
PSE | West Bank |
WLF | Wallis and Futuna |
WSB | Akrotiri |
WSM | Samoa |
YEM | Yemen |
ZAF | South Africa |
ZMB | Zambia |
ZWE | Zimbabwe |