dataio.preprocessed module

class ExportPreprocessedData(casepath, is_observation=True, _fmudata=None)[source]

Bases: object

Export a preprocessed file and its metadata into a FMU run at case level.

The existing metadata will be validated and three fields will be updated - The ‘fmu’ block will be added with information about the existing FMU/ERT run - The ‘file’ block will be updated with new file paths. - The ‘tracklog’ block will be extended with a new event tagged “merged”.

Note it is important that the preprocessed data have been created upfront with the, ExportData class using the argument fmu_context=’preprocessed’. This ensures that the file and metadata are stored in the ‘share/preprocessed/’ folder.

Parameters:
  • casepath (str | Path) – Required casepath for the active ERT experiment. The case needs to contain valid case metadata i.e. the ERT workflow ‘WF_CREATE_CASE_METADATA’ has been run prior to using this class.

  • is_observation (bool) – Default is True. If True, then disk storage will be on the “casepath/share/observations” folder, otherwise on casepath/share/result.

casepath: str | Path
is_observation: bool = True
generate_metadata(obj)[source]

Generate updated metadata for the preprocessed data.

Return type:

dict

Returns:

A dictionary with all metadata.

export(obj)[source]

Re-export preprocessed file with updated metadata. If existing metadata can’t be found or it is outdated, the file will still be copied but metadata will not be created.

Return type:

str

Returns:

Full path of exported object file.