cgeniepy.model ============== .. py:module:: cgeniepy.model Classes ------- .. autoapisummary:: cgeniepy.model.GenieModel Module Contents --------------- .. py:class:: GenieModel(model_path: Union[str, List, Tuple], gemflag=None) Bases: :py:obj:`object` GenieModel is the interface to cGENIE output .. py:attribute:: model_path .. py:attribute:: ncvar_dict .. py:attribute:: tsvar_list .. py:method:: __repr__() .. py:method:: get_var(var: Union[str, List, Tuple], attrs=None) Get the data of target variable. A list of variables is supported as well. :param var: the name of target variable :param unit: the unit of target variable, usually provided in the model output Example ---------- >>> from cgeniepy.model import GenieModel >>> model = GenieModel("path_to_GENIE_output") >>> po4 = model.get_var("ocn_PO4") .. py:method:: get_config(config_name='BIOGEM') .. py:method:: get_ts(var: str, to_ScatterData=False) read in time series output of GENIE :param var: the name of the target variable :return: a pandas DataFrame .. py:method:: get_diag_avg(target_year, is_index=False, pattern_year='\\d+', pattern_year_digit='\\d{3}') read the diagnostic file of cGENIE :param target_year: the target year of the diagnostic file :param is_index: if True, target_year is the index of the sorted years :param pattern: the pattern of the diagnostic file name :return: a pandas DataFrame Example ---------- >>> from cgeniepy.model import GenieModel >>> model = GenieModel("path_to_GENIE_output") >>> model.get_diag_avg(9999) .. py:method:: grid_mask() cGENIE continent mask array (by setting zero values), either calculated from existing data or using biogem.grid_mask .. py:method:: grid_category() an alogirthm to define surface grid catogories depending on the land-sea mask 0: coastal sea 1: land 2: open ocean .. py:method:: grid_area() return the grid area array in used in this model experiment, unit: m2 .. py:method:: grid_mask_3d() return the 3d mask of the grid used in this model experiment .. py:method:: grid_topo() return the topography of the grid used in this model experiment .. py:method:: grid_zt_edges() return the depth edges of the grid used in this model experiment .. py:method:: grid_lat_edges() return the latitude edges of the grid used in this model experiment .. py:method:: grid_lon_edges() return the longitude edges of the grid used in this model experiment .. py:method:: grid_zt_depths() return the depth of the grid used in this model experiment .. py:method:: grid_volume() return the grid volume array (3d) in m3