WarpX
|
Functions | |
def | read_data (plt_file) |
def | _get_field_names (raw_file) |
def | _string_to_numpy_array (s) |
def | _line_to_numpy_arrays (line) |
def | _read_local_Header (header_file, dim) |
def | _read_global_Header (header_file) |
def | _read_header (header_file) |
def | _combine_boxes (boxes) |
def | _read_field (raw_file, field_name) |
def | _read_buffer (snapshot, header_fn, _component_names) |
def | read_reduced_diags (filename, delimiter=' ') |
def | read_reduced_diags_histogram (filename, delimiter=' ') |
Variables | |
HeaderInfo = namedtuple('HeaderInfo', ['version', 'how', 'ncomp', 'nghost']) | |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
USE THIS INSTEAD OF THE PREVIOUS FUNCTION IF Header contains
def _read_local_Header(header_file): with open(header_file, "r") as f: t_snapshot = float(f.readline()) axes_lo = [float(x) for x in f.readline().split()] axes_hi = [float(x) for x in f.readline().split()] local_info = { 't_snapshot' : t_snapshot, 'axes_lo' : axes_lo, 'axes_hi' : axes_hi } return local_info
|
private |
|
private |
|
private |
def read_raw_data.read_data | ( | plt_file | ) |
This function reads the raw (i.e. not averaged to cell centers) data from a WarpX plt file. The plt file must have been written with the plot_raw_fields option turned on, so that it contains a raw_data sub-directory. This is only really useful for single-level data. Arguments: plt_file : An AMReX plt_file file. Must contain a raw_data directory. Returns: A list of dictionaries where the keys are field name strings and the values are numpy arrays. Each entry in the list corresponds to a different level. Example: >>> data = read_data("plt00016") >>> print(data.keys()) >>> print(data['Ex'].shape)
def read_raw_data.read_reduced_diags | ( | filename, | |
delimiter = ' ' |
|||
) |
Read data written by WarpX Reduced Diagnostics, and return them into Python objects input: - filename name of file to open - delimiter (optional, default ',') delimiter between fields in header. output: - metadata_dict dictionary where first key is the type of metadata, second is the field - data dictionary with data
def read_raw_data.read_reduced_diags_histogram | ( | filename, | |
delimiter = ' ' |
|||
) |
Modified based on read_reduced_diags Two extra return objects: - bin_value: the values of bins - bin_data: the histogram data values of bins
read_raw_data.HeaderInfo = namedtuple('HeaderInfo', ['version', 'how', 'ncomp', 'nghost']) |