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.

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_regionsConstant

List of Continents

  • Africa
  • Asia
  • Australia
  • Europe
  • North America
  • South America

List of SREX regions

Short NameLong Name
ALAAlaska/N.W. Canada
AMZAmazon
CAMCentral America/Mexico
CARsmall islands regions Caribbean
CASCentral Asia
CEUCentral Europe
CGICanada/Greenland/Iceland
CNACentral North America
EAFEast Africa
EASEast Asia
ENAEast North America
MEDSouth Europe/Mediterranean
NASNorth Asia
NAUNorth Australia
NEBNorth-East Brazil
NEUNorth Europe
SAFSouthern Africa
SAHSahara
SASSouth Asia
SAUSouth Australia/New Zealand
SEASoutheast Asia
SSASoutheastern South America
TIBTibetan Plateau
WAFWest Africa
WASWest Asia
WNAWest North America
WSAWest Coast South America
ANTAntarctica
ARCArctic
NTPPacific Islands region
STPSouthern Topical Pacific
ETPPacific Islands region
WIOWest Indian Ocean

List of countries

Short NameLong Name
ABWAruba
AFGAfghanistan
AGOAngola
AIAAnguilla
ALBAlbania
ALAAland
ANDAndorra
AREUnited Arab Emirates
ARGArgentina
ARMArmenia
ASMAmerican Samoa
ATAAntarctica
AshmAshmore and Cartier Is.
ATFFr. S. and Antarctic Lands
ATGAntigua and Barb.
AUSAustralia
AUTAustria
AZEAzerbaijan
BDIBurundi
BELBelgium
BENBenin
BFABurkina Faso
BGDBangladesh
BGRBulgaria
BHRBahrain
BHSBahamas
BIHBosnia and Herz.
BLMSt. Barthelemy
BLRBelarus
BLZBelize
BMUBermuda
BOLBolivia
BRABrazil
BRBBarbados
BRNBrunei
BTNBhutan
BWABotswana
CAFCentral African Rep.
CANCanada
CHESwitzerland
CHLChile
CHNChina
CIVIvory Coast
CLPClipperton I.
CMRCameroon
CNM
CODCongo (Kinshasa)
COGCongo (Brazzaville)
COKCook Is.
COLColombia
COMComoros
CPVCape Verde
CRICosta Rica
CSICoral Sea Is.
CUBCuba
CUWCuracao
CYMCayman Is.
CYNN. Cyprus
CYPCyprus
CZECzech Rep.
DEUGermany
DJIDjibouti
DMADominica
DNKDenmark
DOMDominican Rep.
DZAAlgeria
ECUEcuador
EGYEgypt
ERIEritrea
ESBDhekelia
ESPSpain
ESTEstonia
ETHEthiopia
FINFinland
FJIFiji
FLKFalkland Is.
FRAFrance
FROFaroe Is.
FSMMicronesia
GABGabon
GazaGaza
GBRUnited Kingdom
GEOGeorgia
GGYGuernsey
GHAGhana
GIBGibraltar
GINGuinea
GMBGambia
GNBGuinea Bissau
GNQEq. Guinea
GRCGreece
GRDGrenada
GRLGreenland
GTMGuatemala
GUMGuam
GUYGuyana
HKGHong Kong
HMDHeard I. and McDonald Is.
HNDHonduras
HRVCroatia
HTIHaiti
HUNHungary
IDNIndonesia
IMNIsle of Man
INDIndia
IOAIndian Ocean Ter.
IOTBr. Indian Ocean Ter.
IRLIreland
IRNIran
IRQIraq
ISLIceland
ISRIsrael
ITAItaly
JAMJamaica
JEYJersey
JORJordan
JPNJapan
KABBaykonur
KAS
KAZKazakhstan
KENKenya
KGZKyrgyzstan
KHMCambodia
KIRKiribati
KNASt. Kitts and Nevis
KNM
KORS. Korea
KOSKosovo
KWTKuwait
LAOLaos
LBNLebanon
LBRLiberia
LBYLibya
LCASaint Lucia
LIELiechtenstein
LKASri Lanka
LSOLesotho
LTULithuania
LUXLuxembourg
LVALatvia
MACMacau
MAFSt. Martin
MARMorocco
MCOMonaco
MDAMoldova
MDGMadagascar
MDVMaldives
MEXMexico
MHLMarshall Is.
MKDMacedonia
MLIMali
MLTMalta
MMRMyanmar
MNEMontenegro
MNGMongolia
MNPN. Mariana Is.
MOZMozambique
MRTMauritania
MSRMontserrat
MUSMauritius
MWIMalawi
MYSMalaysia
NAMNamibia
NCLNew Caledonia
NERNiger
NFKNorfolk Island
NGANigeria
NICNicaragua
NIUNiue
NLDNetherlands
NORNorway
NPLNepal
NRUNauru
NZLNew Zealand
OMNOman
PAKPakistan
PANPanama
PCNPitcairn Is.
PERPeru
PHLPhilippines
PLWPalau
PNGPapua New Guinea
POLPoland
PRIPuerto Rico
PRKN. Korea
PRTPortugal
PRYParaguay
PYFFr. Polynesia
QATQatar
ROURomania
RUSRussia
RWARwanda
SAHW. Sahara
SAUSaudi Arabia
SDNSudan
SDSS. Sudan
SENSenegal
SGPSingapore
SGSS. Geo. and S. Sandw. Is.
SHNSaint Helena
SLBSolomon Is.
SLESierra Leone
SLVEl Salvador
SMRSan Marino
SOLSomaliland
SOMSomalia
SPMSt. Pierre and Miquelon
SRBSerbia
STPSao Tome and Principe
SURSuriname
SVKSlovakia
SVNSlovenia
SWESweden
SWZSwaziland
SXMSint Maarten
SYCSeychelles
SYRSyria
TCATurks and Caicos Is.
TCDChad
TGOTogo
THAThailand
TJKTajikistan
TKMTurkmenistan
TLSEast Timor
TONTonga
TTOTrinidad and Tobago
TUNTunisia
TURTurkey
TUVTuvalu
TWNTaiwan
TZATanzania
UGAUganda
UKRUkraine
UMIU.S. Minor Outlying Is.
URYUruguay
USAUnited States
USGGuantanamo Bay USNB
UZBUzbekistan
VATVatican
VCTSt. Vin. and Gren.
VENVenezuela
VGBBritish Virgin Is.
VIRU.S. Virgin Is.
VNMVietnam
VUTVanuatu
PSEWest Bank
WLFWallis and Futuna
WSBAkrotiri
WSMSamoa
YEMYemen
ZAFSouth Africa
ZMBZambia
ZWEZimbabwe
source