| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
# mock conda terminal (base) C://User: cd Path/To/Xarray-DataAccessor (base) C://User/Path/To/Xarray-DataAccessor conda env create -f environment_demo.yml ... (base) C://User/Path/To/Xarray-DataAccessor conda activate data_accessor_full (data_accessor_full) C://User/Path/To/Xarray-DataAccessor
# mock conda terminal with the env activated (data_accessor_full) C://User/Path/To/Xarray-DataAccessor conda develop src # a this point you are ready to open an IDE/Notebook of your choice to run your code! # For example: (data_accessor_full) C://User/Path/To/Xarray-DataAccessor jupyter lab
import xarray_data_accessorAll data one can retrieve with this library is organized in a three tier hierarchy:
To allow this library to be extendable, the "data accessors", the datasets they can access, and the variables that exist in each dataset are not hardcoded anywhere in the repo.
Therefore to explore what is available, one can use the following xarray_data_accessor.DataAccessorFactory class functions:
from xarray_data_accessor import DataAccessorFactory
# to return a list of all data accessor names
DataAccessorFactory.data_accessor_names()
# to return a dictionary with data accessor names as keys and their respective objects and values
DataAccessorFactory.data_accessor_objects()
# to return a dictionary with data accessor names as keys, and their supported dataset names as values
DataAccessorFactory.supported_datasets()
# to return a list of variable names for a specific data accessor - dataset combination
DataAccessorFactory.supported_variables(
data_accessor_name: str,
dataset_name: str,
)We also intend to keep documentation about data accessors and their respective datasets updated here.
To get data one can use the get_xarray_dataset() function after specifying time and space AOI.
The spatial AOI can be specified with a shapefile, raster, a list of lat/long coordinate tuples, or a csv with lat/lon as columns.
The temporal AOI can be specified as a string or a datetime object. Additionally, one can specify a timezone using param:timezone.
In the example below we fetch ERA5 data from AWS for a shapefile defined extent.
import xarray_data_accessor
dataset = xarray_data_accessor.get_xarray_dataset(
data_accessor_name='AWSDataAccessor',
dataset_name='reanalysis-era5-single-levels',
variables=[
'air_temperature_at_2_metres',
'eastward_wind_at_100_metres',
],
start_time='2019-01-30',
end_time='2019-02-02',
shapefile='path/to/shapefile.shp',
)Functionality has not been thoroughly tested...documentation pending.
| Back | FazBrowse Home | New Git URL |