pinnicle.modeldata

pinnicle.modeldata.data module

class pinnicle.modeldata.data.Data(parameters=<pinnicle.parameter.DataParameter object>)[source]

Bases: Constants

class of data with all data used

get_ice_coordinates(mask_name='')[source]

get the coordinates of ice covered region from all the data, put them in one array

load_data(domain=None, physics=None)[source]

laod all the data in self.data

prepare_training_data(transient=False, default_time=0.0)[source]

merge all X and sol in self.data to self.X and self.sol with the keys :param transient: if the problem is a time dependent simulation :param default_time: default value of the third column (time) in X, if not provided by the data

class pinnicle.modeldata.data.DataBase(parameters=<pinnicle.parameter.SingleDataParameter object>)[source]

Bases: ABC

Base class of data

classmethod create(data_type, **kwargs)[source]
abstractmethod get_ice_coordinates(mask_name='')[source]

get ice masks if available from the data

abstractmethod load_data(domain, physics)[source]

load data from self.parameters.data_path, within the given domain and physics

abstractmethod prepare_training_data()[source]

prepare training data according to the data_size

subclasses = {'ISSM': <class 'pinnicle.modeldata.issm_data.ISSMmdData'>, 'ISSM Light': <class 'pinnicle.modeldata.issm_light.ISSMLightData'>, 'h5': <class 'pinnicle.modeldata.h5_data.H5Data'>, 'mat': <class 'pinnicle.modeldata.general_mat_data.MatData'>, 'nc': <class 'pinnicle.modeldata.netcdf_data.NetCDFData'>}

pinnicle.modeldata.general_mat_data module

class pinnicle.modeldata.general_mat_data.MatData(parameters=<pinnicle.parameter.SingleDataParameter object>)[source]

Bases: DataBase, Constants

data loaded from a .mat file

get_ice_coordinates(mask_name='')[source]

stack the coordinates x and y, assuming all the data in .mat are in the ice covered region. This function is currently only called by plotting to generate ice covered region.

load_data(domain=None, physics=None)[source]

load scatter data from a .mat file, return a dict with the required data

plot(data_names=[], vranges={}, axs=None, **kwargs)[source]

TODO: scatter plot of the selected data from data_names

prepare_training_data(data_size=None)[source]

prepare data for PINNs according to the settings in data_size

pinnicle.modeldata.h5_data module

class pinnicle.modeldata.h5_data.H5Data(parameters=<pinnicle.parameter.SingleDataParameter object>)[source]

Bases: DataBase, Constants

data loaded from a .h5 file

get_ice_coordinates(mask_name='')[source]

stack the coordinates x and y, assuming all the data in .mat are in the ice covered region. This function is currently only called by plotting to generate ice covered region.

load_data(domain=None, physics=None)[source]

load grid data from a .h5 file, based on the domain, return a dict with the required data

plot(data_names=[], vranges={}, axs=None, **kwargs)[source]

TODO: scatter plot of the selected data from data_names

prepare_training_data(data_size=None)[source]

prepare data for PINNs according to the settings in data_size

pinnicle.modeldata.issm_data module

class pinnicle.modeldata.issm_data.ISSMmdData(parameters=<pinnicle.parameter.SingleDataParameter object>)[source]

Bases: DataBase, Constants

data loaded from model in ISSM

get_ice_coordinates(mask_name='')[source]

Use get_ice_indices defined by each individual class, get the coordinates (x,y) of ice covered region from X_dict. This function is currently only called by plotting to generate ice covered region.

get_ice_indices(mask_name='')[source]

get the indices of ice covered region for X_dict and data_dict

load_data(domain=None, physics=None)[source]

load ISSM model from a .mat file

plot(data_names=[], vranges={}, axs=None, resolution=200, **kwargs)[source]

use utils.plot_dict_data to plot the ISSM data

Parameters:
  • data_names (list) – Names of the variables. if not specified, plot all variables in data_dict

  • vranges (dict) – range of the data

  • axs (array of AxesSubplot) – axes to plot each data, if not given, then generate a subplot according to the size of data_names

  • resolution (int) – number of pixels in horizontal and vertical direction

Returns:

x-coordinates of the 2D plot Y (np.array): y-coordinates of the 2D plot im_data (dict): Dict of data for the 2D plot, each element has the same size as X and Y axs (array of AxesSubplot): axes of the subplots

Return type:

X (np.array)

prepare_training_data(data_size=None)[source]

prepare data for PINNs according to the settings in data_size

pinnicle.modeldata.issm_light module

class pinnicle.modeldata.issm_light.ISSMLightData(parameters=<pinnicle.parameter.SingleDataParameter object>)[source]

Bases: DataBase, Constants

Data loader for the model from ISSM A light version, does not contain mesh and boundary info, so that one can use the bbox of a domain to select the data only inside

get_ice_coordinates(mask_name='')[source]

Use get_ice_indices defined by each individual class, get the coordinates (x,y) of ice covered region from X_dict. This function is currently only called by plotting to generate ice covered region.

get_ice_indices(mask_name='')[source]

get the indices of ice covered region for X_dict and data_dict

load_data(domain=None, physics=None)[source]

load ISSM model from a .mat file

plot(data_names=[], vranges={}, axs=None, resolution=200, **kwargs)[source]

use utils.plot_dict_data to plot the ISSM data

Parameters:
  • data_names (list) – Names of the variables. if not specified, plot all variables in data_dict

  • vranges (dict) – range of the data

  • axs (array of AxesSubplot) – axes to plot each data, if not given, then generate a subplot according to the size of data_names

  • resolution (int) – number of pixels in horizontal and vertical direction

Returns:

x-coordinates of the 2D plot Y (np.array): y-coordinates of the 2D plot im_data (dict): Dict of data for the 2D plot, each element has the same size as X and Y axs (array of AxesSubplot): axes of the subplots

Return type:

X (np.array)

prepare_training_data(data_size=None)[source]

prepare data for PINNs according to the settings in data_size

pinnicle.modeldata.netcdf_data module

class pinnicle.modeldata.netcdf_data.NetCDFData(parameters=<pinnicle.parameter.SingleDataParameter object>)[source]

Bases: DataBase, Constants

data loaded from a .nc file

get_ice_coordinates(mask=None)[source]

stack the coordinates x and y, assuming all the data in .mat are in the ice covered region. This function is currently only called by plotting to generate ice covered region.

load_data(domain=None, physics=None)[source]

load grid data from a .nc file, based on the domain, return a dict with the required data

plot(data_names=[], vranges={}, axs=None, **kwargs)[source]

TODO: scatter plot of the selected data from data_names

prepare_training_data(data_size=None)[source]

prepare data for PINNs according to the settings in data_size