def __init__(self, ds, dataset_type='boxlib_native'):
        self.dataset_type = dataset_type
        self.header_filename = os.path.join(ds.output_dir, 'Header')
        self.directory = ds.output_dir

        GridIndex.__init__(self, ds, dataset_type)
        self._cache_endianness(self.grids[-1])
예제 #2
0
    def __init__(self, ds, dataset_type='boxlib_native'):
        self.dataset_type = dataset_type
        self.header_filename = os.path.join(ds.output_dir, 'Header')
        self.directory = ds.output_dir

        GridIndex.__init__(self, ds, dataset_type)
        self._cache_endianness(self.grids[-1])
예제 #3
0
 def __init__(self, ds, dataset_type=None):
     self.dataset_type = dataset_type
     self.float_type = 'float64'
     self.dataset = weakref.proxy(ds)  # for _obtain_enzo
     self.float_type = self.enzo.hierarchy_information["GridLeftEdge"].dtype
     self.directory = os.getcwd()
     GridIndex.__init__(self, ds, dataset_type)
 def __init__(self, ds, dataset_type = None):
     self.dataset_type = dataset_type
     self.float_type = 'float64'
     self.dataset = weakref.proxy(ds) # for _obtain_enzo
     self.float_type = self.enzo.hierarchy_information["GridLeftEdge"].dtype
     self.directory = os.getcwd()
     GridIndex.__init__(self, ds, dataset_type)
예제 #5
0
 def __init__(self, ds, dataset_type='openPMD'):
     self.dataset_type = dataset_type
     # for now, the index file is the dataset!
     self.dataset = ds
     self.index_filename = ds.parameter_filename
     self.directory = os.path.dirname(self.index_filename)
     GridIndex.__init__(self, ds, dataset_type)
    def __init__(self, ds, dataset_type='openPMD'):
        self.dataset_type = dataset_type
        # for now, the index file is the dataset!
	self.dataset = ds
        self.index_filename = ds.parameter_filename
        self.directory = os.path.dirname(self.index_filename)
        GridIndex.__init__(self, ds, dataset_type)
예제 #7
0
    def __init__(self, ds, dataset_type='chombo_hdf5'):
        self.domain_left_edge = ds.domain_left_edge
        self.domain_right_edge = ds.domain_right_edge
        self.dataset_type = dataset_type

        if ds.dimensionality == 1:
            self.dataset_type = "chombo1d_hdf5"
        if ds.dimensionality == 2:
            self.dataset_type = "chombo2d_hdf5"

        self.field_indexes = {}
        self.dataset = weakref.proxy(ds)
        # for now, the index file is the dataset!
        self.index_filename = os.path.abspath(self.dataset.parameter_filename)
        self.directory = ds.fullpath
        self._handle = ds._handle

        self.float_type = self._handle['Chombo_global'].attrs[
            'testReal'].dtype.name
        self._levels = [
            key for key in self._handle.keys() if key.startswith('level')
        ]
        GridIndex.__init__(self, ds, dataset_type)

        self._read_particles()
예제 #8
0
 def __init__(self, ds, dataset_type=None):
     self.dataset_type = dataset_type
     self.float_type = "float64"
     self.dataset = weakref.proxy(ds)  # for _obtain_enzo
     self.stream_handler = ds.stream_handler
     self.float_type = "float64"
     self.directory = os.getcwd()
     GridIndex.__init__(self, ds, dataset_type)
예제 #9
0
 def __init__(self, ds, dataset_type="athena_pp"):
     self.dataset = weakref.proxy(ds)
     self.directory = os.path.dirname(self.dataset.filename)
     self.dataset_type = dataset_type
     # for now, the index file is the dataset!
     self.index_filename = self.dataset.filename
     self._handle = ds._handle
     GridIndex.__init__(self, ds, dataset_type)
예제 #10
0
 def __init__(self, ds, dataset_type='grid_data_format'):
     self.dataset = weakref.proxy(ds)
     self.index_filename = self.dataset.parameter_filename
     h5f = h5py.File(self.index_filename, mode='r')
     self.dataset_type = dataset_type
     GridIndex.__init__(self, ds, dataset_type)
     self.directory = os.path.dirname(self.index_filename)
     h5f.close()
예제 #11
0
 def __init__(self, ds, dataset_type='skeleton'):
     self.dataset_type = dataset_type
     self.dataset = weakref.proxy(ds)
     # for now, the index file is the dataset!
     self.index_filename = self.dataset.parameter_filename
     self.directory = os.path.dirname(self.index_filename)
     # float type for the simulation edges and must be float64 now
     self.float_type = np.float64
     GridIndex.__init__(self, ds, dataset_type)
 def __init__(self, ds, dataset_type='grid_data_format'):
     self.dataset = weakref.proxy(ds)
     self.index_filename = self.dataset.parameter_filename
     h5f = h5py.File(self.index_filename, 'r')
     self.dataset_type = dataset_type
     GridIndex.__init__(self, ds, dataset_type)
     self.max_level = 10  # FIXME
     self.directory = os.path.dirname(self.index_filename)
     h5f.close()
예제 #13
0
 def __init__(self, ds, dataset_type='gamer'):
     self.dataset_type = dataset_type
     self.dataset = weakref.proxy(ds)
     self.index_filename = self.dataset.parameter_filename
     self.directory = os.path.dirname(self.index_filename)
     self._handle = ds._handle
     self.float_type = 'float64'  # fixed even when FLOAT8 is off
     self._particle_handle = ds._particle_handle
     GridIndex.__init__(self, ds, dataset_type)
예제 #14
0
    def __init__(self, ds, dataset_type):

        self.dataset_type = dataset_type
        self.directory = os.path.dirname(ds.parameter_filename)
        self.index_filename = ds.parameter_filename
        if os.path.getsize(self.index_filename) == 0:
            raise IOError(-1,"File empty", self.index_filename)

        GridIndex.__init__(self, ds, dataset_type)
        self.dataset.dataset_type = self.dataset_type
 def __init__(self,ds,dataset_type='fits'):
     self.dataset_type = dataset_type
     self.field_indexes = {}
     self.dataset = weakref.proxy(ds)
     # for now, the index file is the dataset!
     self.index_filename = self.dataset.parameter_filename
     self.directory = os.path.dirname(self.index_filename)
     self._handle = ds._handle
     self.float_type = np.float64
     GridIndex.__init__(self,ds,dataset_type)
예제 #16
0
 def __init__(self, ds, dataset_type="fits"):
     self.dataset_type = dataset_type
     self.field_indexes = {}
     self.dataset = weakref.proxy(ds)
     # for now, the index file is the dataset
     self.index_filename = self.dataset.parameter_filename
     self.directory = os.path.dirname(self.index_filename)
     self._handle = ds._handle
     self.float_type = np.float64
     GridIndex.__init__(self, ds, dataset_type)
예제 #17
0
    def __init__(self, ds, dataset_type="athena"):
        self.dataset = weakref.proxy(ds)
        self.directory = os.path.dirname(self.dataset.filename)
        self.dataset_type = dataset_type
        # for now, the index file is the dataset!
        self.index_filename = os.path.join(os.getcwd(), self.dataset.filename)
        self._fhandle = open(self.index_filename, "rb")
        GridIndex.__init__(self, ds, dataset_type)

        self._fhandle.close()
예제 #18
0
 def __init__(self, ds, dataset_type='gamer'):
     self.dataset_type = dataset_type
     self.dataset = weakref.proxy(ds)
     self.index_filename = self.dataset.parameter_filename
     self.directory = os.path.dirname(self.index_filename)
     self._handle = ds._handle
     self._group_grid = ds._group_grid
     self._group_particle = ds._group_particle
     self.float_type = 'float64'  # fixed even when FLOAT8 is off
     self._particle_handle = ds._particle_handle
     self.refine_by = ds.refine_by
     self.pgroup = self.refine_by**3  # number of patches in a patch group
     GridIndex.__init__(self, ds, dataset_type)
    def __init__(self, ds, dataset_type="athena"):
        self.dataset = weakref.proxy(ds)
        self.directory = os.path.dirname(self.dataset.filename)
        self.dataset_type = dataset_type
        # for now, the index file is the dataset!
        self.index_filename = os.path.join(os.getcwd(), self.dataset.filename)
        if PY2:
            self._fhandle = file(self.index_filename, "rb")
        else:
            self._fhandle = open(self.index_filename, "rb")
        GridIndex.__init__(self, ds, dataset_type)

        self._fhandle.close()
예제 #20
0
    def __init__(self,ds,dataset_type='pluto_hdf5'):
        self.domain_left_edge = ds.domain_left_edge
        self.domain_right_edge = ds.domain_right_edge
        self.dataset_type = dataset_type
        self.field_indexes = {}
        self.dataset = weakref.proxy(ds)
        self.index_filename = os.path.abspath(
            self.dataset.parameter_filename)
        self.directory = ds.fullpath
        self._handle = ds._handle

        self.float_type = self._handle['/level_0']['data:datatype=0'].dtype.name
        self._levels = self._handle.keys()[2:]
        GridIndex.__init__(self,ds,dataset_type)
예제 #21
0
    def __init__(self, ds, dataset_type='chombo_hdf5'):
        self.domain_left_edge = ds.domain_left_edge
        self.domain_right_edge = ds.domain_right_edge
        self.dataset_type = dataset_type
        self.field_indexes = {}
        self.dataset = weakref.proxy(ds)
        # for now, the index file is the dataset!
        self.index_filename = os.path.abspath(self.dataset.parameter_filename)
        self.directory = ds.fullpath
        self._handle = ds._handle

        self._levels = [
            key for key in self._handle.keys() if key.startswith('level')
        ]

        GridIndex.__init__(self, ds, dataset_type)

        self._read_particles()
    def __init__(self, ds, dataset_type='chombo_hdf5'):
        self.domain_left_edge = ds.domain_left_edge
        self.domain_right_edge = ds.domain_right_edge
        self.dataset_type = dataset_type
        self.field_indexes = {}
        self.dataset = weakref.proxy(ds)
        # for now, the index file is the dataset!
        self.index_filename = os.path.abspath(
            self.dataset.parameter_filename)
        self.directory = ds.fullpath
        self._handle = ds._handle

        tr = self._handle['Chombo_global'].attrs.get("testReal", "float32")

        self._levels = [key for key in self._handle.keys() if key.startswith('level')]
        GridIndex.__init__(self, ds, dataset_type)

        self._read_particles()
예제 #23
0
    def __init__(self, ds, dataset_type):

        self.dataset_type = dataset_type
        if ds.file_style is not None:
            self._bn = ds.file_style
        else:
            self._bn = "%s.cpu%%04i"
        self.index_filename = os.path.abspath(f"{ds.parameter_filename}.hierarchy")
        if os.path.getsize(self.index_filename) == 0:
            raise OSError(-1, "File empty", self.index_filename)
        self.directory = os.path.dirname(self.index_filename)

        # For some reason, r8 seems to want Float64
        if "CompilerPrecision" in ds and ds["CompilerPrecision"] == "r4":
            self.float_type = "float32"
        else:
            self.float_type = "float64"

        GridIndex.__init__(self, ds, dataset_type)
        # sync it back
        self.dataset.dataset_type = self.dataset_type
    def __init__(self, ds, dataset_type):

        self.dataset_type = dataset_type
        if ds.file_style != None:
            self._bn = ds.file_style
        else:
            self._bn = "%s.cpu%%04i"
        self.index_filename = os.path.abspath(
            "%s.hierarchy" % (ds.parameter_filename))
        if os.path.getsize(self.index_filename) == 0:
            raise IOError(-1,"File empty", self.index_filename)
        self.directory = os.path.dirname(self.index_filename)

        # For some reason, r8 seems to want Float64
        if "CompilerPrecision" in ds \
            and ds["CompilerPrecision"] == "r4":
            self.float_type = 'float32'
        else:
            self.float_type = 'float64'

        GridIndex.__init__(self, ds, dataset_type)
        # sync it back
        self.dataset.dataset_type = self.dataset_type
예제 #25
0
    def __init__(self, ds, dataset_type):

        self.dataset_type = dataset_type
        if ds.file_style != None:
            self._bn = ds.file_style
        else:
            self._bn = "%s.cpu%%04i"
        self.index_filename = os.path.abspath(
            "%s.hierarchy" % (ds.parameter_filename))
        if os.path.getsize(self.index_filename) == 0:
            raise IOError(-1,"File empty", self.index_filename)
        self.directory = os.path.dirname(self.index_filename)

        # For some reason, r8 seems to want Float64
        if ds.has_key("CompilerPrecision") \
            and ds["CompilerPrecision"] == "r4":
            self.float_type = 'float32'
        else:
            self.float_type = 'float64'

        GridIndex.__init__(self, ds, dataset_type)
        # sync it back
        self.dataset.dataset_type = self.dataset_type
예제 #26
0
 def __init__(self, ds, dataset_type="openPMD"):
     self.dataset_type = dataset_type
     self.dataset = ds
     self.index_filename = ds.parameter_filename
     self.directory = path.dirname(self.index_filename)
     GridIndex.__init__(self, ds, dataset_type)
예제 #27
0
 def _initialize_grid_arrays(self):
     GridIndex._initialize_grid_arrays(self)
     self.grid_procs = np.zeros((self.num_grids, 1), "int32")