blendernc.python_functions

class blendernc.python_functions.BlenderncEngine

Bases: object

BlenderNC engine, this class makes sure the input file exists and it has the right format.

Returns
Datacube

If datacubes have the expected format (netCDF, cfgrib, and zarr) then the dataset is returned.

Raises
ValueError:

when datacubes are not the expected format

check_datacube()

Check if file(s) are xarray compatible and contain at least one variable.

check_files_datacube(file_path)

Check that file(s) exist and they are xarray datacube compatible.

Parameters
filepath: str

string to data

Returns
dataset: dict

Initial dictionary containing lazy datacube load.

Raises
NameError:

when datafile doesn’t exist.

load_datacube()

Detect format and load datacube using appropriate Xarray Driver - NetCDF is the existing implementation - CFGrib support is being implemented as part of ECMWC - Zarr support will give true scalable cloud-native usage and on the roadmap Engine detection by extension : http://xarray.pydata.org/en/stable/generated/xarray.open_mfdataset.html#xarray.open_mfdataset

blendernc.python_functions.build_enum_prop_list(list, icon='NONE', long_name_list=None, start=1)
blendernc.python_functions.dataarray_random_sampling(dataarray, n)
blendernc.python_functions.datacube_values(dataset, selected_variable, active_resolution, return_dataset=True)
blendernc.python_functions.del_cache(NodeTree, identifier)
blendernc.python_functions.dict_update(node, context)
blendernc.python_functions.dict_update_tutorial_datacube(node, context)
blendernc.python_functions.empty_item()
blendernc.python_functions.is_cached(NodeTree, identifier)
blendernc.python_functions.load_frame(node, frame, grid_node=None)
blendernc.python_functions.normalize_data_w_grid(node, data, grid_node, vmax, vmin)
blendernc.python_functions.plot_using_grid(x, y, data, vmin, vmax, dpi=300, xlim=None, ylim=[-90, 90])
blendernc.python_functions.preference_frame(node, identifier, frame)
blendernc.python_functions.purge_cache(NodeTree, identifier, n=0, scene=None)
blendernc.python_functions.refresh_cache(NodeTree, identifier, frame)
blendernc.python_functions.resolution_steps(size, res)
blendernc.python_functions.rgb2gray(rgb)
blendernc.python_functions.rotate_longitude(node, context)
blendernc.python_functions.select_datacube()
blendernc.python_functions.select_item()
blendernc.python_functions.ui_material()