oasislmf.pytools.cdftocsv

Module Contents

Functions

print_cdftocsv(event_id, damagecdf, Nbins, rec)

Print the cdf produced by getmodel to csv file.

run(run_dir, skip_header[, file_in])

Run cdftocsv command: convert the cdf output from getmodel into csv format.

main()

Attributes

oasislmf.pytools.cdftocsv.parser[source]
oasislmf.pytools.cdftocsv.print_cdftocsv(event_id, damagecdf, Nbins, rec)[source]

Print the cdf produced by getmodel to csv file. Note that the input arrays are lists of cdf entries, namely the shape on axis=0 is the number of entries.

Args:

event_id (int): event_id damagecdf (array-like, damagecdf): damage cdf record Nbins (array-like, int): number of damage bins rec (array-like, rec): cdf record

Returns:

list[str]: list of csv lines

oasislmf.pytools.cdftocsv.run(run_dir, skip_header, file_in=None)[source]

Run cdftocsv command: convert the cdf output from getmodel into csv format. The binary data is read from an input stream, and the csv file is streamed to stdout.

Args:

run_dir ([str]): Path to the run directory.

skip_header ([bool]): If True, does not print the csv header.

Raises:

ValueError: If the stream type is not 1.

oasislmf.pytools.cdftocsv.main()[source]