smash.io.save_model_ddt#
- smash.io.save_model_ddt(model, path)[source]#
Save some derived data types of the Model object to HDF5.
This method is considerably lighter than
smash.io.save_modelmethod that saves the entire Model object. Note that there is no method to reconstruct the Model object with the saved data file from this method, as some information is left out to ensure a lighter memory backup. To read the saved data, usesmash.io.read_model_ddt, which returns a dictionary reflecting the structure of the Model object.The following data are stored into the HDF5 file:
snow_module,hydrological_module,routing_module,serr_mu_mapping,serr_sigma_mapping,start_time,end_time,dt,descriptor_namefromModel.setupxres,yres,xmin,ymax,dx,dy,active_cell,gauge_pos,code,areafromModel.meshqfromModel.response_datadescriptorfromModel.physio_datamean_prcp,mean_pet,mean_snow,mean_tempfromModel.atmos_data(mean_snowandmean_tempare only stored if a snow module has been selected)keys,valuesfromModel.rr_parameterskeys,valuesfromModel.rr_initial_statesweight_1,bias_1,weight_2,bias_2,weight_3,bias_3fromModel.nn_parameters(depending on the hydrological module)keys,valuesfromModel.serr_mu_parameterskeys,valuesfromModel.serr_sigma_parametersqfromModel.responsekeys,valuesfromModel.rr_final_states
- Parameters:
- model
Model The Model object to save derived data types as a HDF5 file.
- pathstr
The file path.
- model
See also
read_model_ddtRead derived data types of the Model object from HDF5.
smash.ModelPrimary data structure of the hydrological model
smash.
Examples
>>> from smash.factory import load_dataset >>> from smash.io import save_model_ddt >>> setup, mesh = load_dataset("cance") >>> model = smash.Model(setup, mesh)
Save some derived data types of the Model object to HDF5
>>> save_model_ddt(model, "model_ddt.hdf5")