cgeniepy.table ============== .. py:module:: cgeniepy.table Classes ------- .. autoapisummary:: cgeniepy.table.ScatterData Module Contents --------------- .. py:class:: ScatterData(data: Union[pandas.DataFrame, int, str], **kwargs) .. py:attribute:: modify_in_place :value: True ScatterData is a class to store non-gridded data with columns of coordinates. .. py:attribute:: data .. py:method:: __repr__() .. py:method:: __getitem__(item) .. py:method:: set_index(index) Tell the object which columns are the coordinates. .. py:method:: reset_index() .. py:method:: detect_basin() use point-in-polygon strategy to detect modern ocean basin according to lon/lat column Example ---------- >>> data = ScatterData(data) >>> data.set_index(['lon', 'lat']) >>> data.detect_basin() .. py:method:: to_xarray() convert to xarray dataset .. py:method:: to_GriddedData(var) convert to gridded data .. py:method:: interpolate(var) .. py:method:: to_geniebin(var, agg_method='mean') Regrid a dataframe within certain format to cGENIE grids. This method does not consider the land-sea mask. So if convert from a higher resolution data to GENIE grids, the land-sea mask could be different (Not a problem in comparison though). :param var: The variable to regrid. :param agg_method: The aggregation method to use when regridding. :return: An indexed data frame .. py:method:: drop_na(*args, **kwargs) drop rows with NA values .. py:method:: to_ScatterDataVis() convert to ScatterDataVis .. py:method:: plot(var, kind='scatter', *args, **kwargs) plot the data .. py:method:: compare(var1, var2, model_name=None, obs_name=None) compare two ScatterData objects .. py:method:: rolling(window, *args, **kwargs) apply rolling to the data