{ "cells": [ { "cell_type": "markdown", "id": "29f2e62e-3a3a-4a35-b30d-2cfcc34c0d96", "metadata": {}, "source": [ "Finding Operations\n", "==================\n", "\n", "This notebook serves to show how operations can be detected and how information about these operations can be shown." ] }, { "cell_type": "code", "execution_count": 1, "id": "ef096264-a5eb-4c1e-8c3a-57eb0a6ca483", "metadata": { "tags": [] }, "outputs": [], "source": [ "from IPython.display import JSON\n", "\n", "from esa_climate_toolbox.core import get_op_meta_info\n", "from esa_climate_toolbox.core import list_operations" ] }, { "cell_type": "markdown", "id": "61f5e449-a509-418e-9b3f-6fd324fa11a4", "metadata": {}, "source": [ "Operations of the ESA Climate Toolbox can be listed by calling the ``list_operations`` command." ] }, { "cell_type": "code", "execution_count": 2, "id": "6a3c94e2-40fd-46ef-a48f-6b8a378619e7", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/plain": [ "['add_dataset_values_to_geodataframe',\n", " 'adjust_spatial_attrs',\n", " 'adjust_temporal_attrs',\n", " 'aggregate_statistics',\n", " 'animate_map',\n", " 'anomaly_external',\n", " 'anomaly_internal',\n", " 'arithmetics',\n", " 'as_geodataframe',\n", " 'climatology',\n", " 'coregister',\n", " 'data_frame_max',\n", " 'data_frame_min',\n", " 'data_frame_subset',\n", " 'detect_outliers',\n", " 'diff',\n", " 'find_closest',\n", " 'fourier_analysis',\n", " 'gapfill',\n", " 'merge',\n", " 'normalise_vars',\n", " 'normalize',\n", " 'pairwise_var_correlation',\n", " 'pixelwise_group_correlation',\n", " 'plot',\n", " 'plot_contour',\n", " 'plot_hist',\n", " 'plot_line',\n", " 'plot_map',\n", " 'plot_scatter',\n", " 'query',\n", " 'reduce',\n", " 'resample',\n", " 'select_features',\n", " 'select_var',\n", " 'standardise_vars',\n", " 'statistics',\n", " 'subset_spatial',\n", " 'subset_temporal',\n", " 'subset_temporal_index',\n", " 'temporal_aggregation',\n", " 'to_dataframe',\n", " 'to_dataset',\n", " 'tseries_mean',\n", " 'tseries_point']" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list_operations()" ] }, { "cell_type": "markdown", "id": "f5bd5e8f-d6ea-45d6-b66d-9273d568646c", "metadata": {}, "source": [ "To get information about the required input parameters, you can ask for an operation's meta info and see its inputs. Under outputs, you will find what you will get from applying the operation." ] }, { "cell_type": "code", "execution_count": 3, "id": "4bb82939-0de7-424a-8705-b1397dfe9c85", "metadata": { "tags": [] }, "outputs": [ { "data": { "application/json": { "has_monitor": true, "header": { "description": "Perform coregistration of two datasets by resampling the replica dataset\nonto the grid of the primary. If upsampling has to be performed, this is\nachieved using interpolation, if downsampling has to be performed, the\npixels of the replica dataset are aggregated to form a coarser grid.\n\nThe returned dataset will contain the lat/lon intersection of provided\nprimary and replica datasets, resampled unto the primary grid frequency.\n\nThis operation works on datasets whose spatial dimensions are defined on\npixel-registered grids that are equidistant in lat/lon coordinates, i.e.,\ndata points define the middle of a pixel and pixels have the same size\nacross the dataset.\n\nThis operation will resample all variables in a dataset, as the lat/lon\ngrid is defined per dataset. It works only if all variables in the dataset\nhave lat and lon as dimensions.\n\nFor an overview of downsampling/upsampling methods used in this operation,\nplease see https://github.com/CAB-LAB/gridtools\n\nWhether upsampling or downsampling has to be performed is determined\nautomatically based on the relationship of the grids of the provided\ndatasets.", "tags": [ "geometric", "coregistration" ], "version": "1.1" }, "inputs": { "ds_primary": { "data_type": "xarray.core.dataset.Dataset", "description": "The dataset whose grid is used for resampling", "position": 0 }, "ds_replica": { "data_type": "xarray.core.dataset.Dataset", "description": "The dataset that will be resampled", "position": 1 }, "method_ds": { "data_type": "str", "default_value": "mean", "description": "Interpolation method to use for downsampling.", "position": 3, "value_set": [ "first", "last", "mean", "mode", "var", "std" ] }, "method_us": { "data_type": "str", "default_value": "linear", "description": "Interpolation method to use for upsampling.", "position": 2, "value_set": [ "nearest", "linear" ] } }, "outputs": { "return": { "add_history": true, "data_type": "xarray.core.dataset.Dataset", "description": "The replica dataset resampled on the grid of the primary" } }, "qualified_name": "esa_climate_toolbox.ops.coregistration.coregister" }, "text/plain": [ "" ] }, "execution_count": 3, "metadata": { "application/json": { "expanded": false, "root": "root" } }, "output_type": "execute_result" } ], "source": [ "JSON(get_op_meta_info('coregister'))" ] }, { "cell_type": "code", "execution_count": null, "id": "a35188b5-4d4b-4d68-8378-0a160ab631cc", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.1" } }, "nbformat": 4, "nbformat_minor": 5 }