cgeniepy.table#

Classes#

Module Contents#

class cgeniepy.table.ScatterData(data: pandas.DataFrame | int | str, **kwargs)#
modify_in_place = True#

ScatterData is a class to store non-gridded data with columns of coordinates.

data#
__repr__()#
__getitem__(item)#
set_index(index)#

Tell the object which columns are the coordinates.

reset_index()#
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()
to_xarray()#

convert to xarray dataset

to_GriddedData(var)#

convert to gridded data

interpolate(var)#
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).

Parameters:
  • var – The variable to regrid.

  • agg_method – The aggregation method to use when regridding.

Returns:

An indexed data frame

drop_na(*args, **kwargs)#

drop rows with NA values

to_ScatterDataVis()#

convert to ScatterDataVis

plot(var, kind='scatter', *args, **kwargs)#

plot the data

compare(var1, var2, model_name=None, obs_name=None)#

compare two ScatterData objects

rolling(window, *args, **kwargs)#

apply rolling to the data