... | ... | @@ -38,15 +38,17 @@ Calculating various values from metadata |
|
|
* getDict - Returns dictionary various grid properties assigned actual values. 'xmin', 'xmax', 'xcen', 'ymin', ...
|
|
|
|
|
|
|
|
|
Reading from file
|
|
|
-----------------
|
|
|
Input / output
|
|
|
--------------
|
|
|
* [readPFMetadata(fn)](https://projects.asu.cas.cz/wunsch/flashscripts/-/blob/master/flashscripts/libgrid.py#L15) - Reads metadata defining the grid using the plotfile object. Argument "fn" denotes the filename. Currently uses flashpf Plotfile class based on the pytables library to interact with the hdf file.
|
|
|
* [readBlocks(blocks, quans)](https://projects.asu.cas.cz/wunsch/flashscripts/-/blob/master/flashscripts/libgrid.py#L15) - Reads selected blocks and selected quantities into memory. Creates/updates array bIdx and dictionary qIdx providing indeces of a given block and quantity into the 'data' array.
|
|
|
* writeBlk(fn, UG) - Writes edges of blocks intersecting with a given uniform grid into ascii file. Works for 1, 2 or 3-dimensionsional uniform grids. Ordering of axes is the same as in the related uniform grid. Args: fn is the ascii output file nmae (string); UG is the related uniform grid (CUniformGrid class object). Ret: nothing.
|
|
|
|
|
|
|
|
|
Block transformation
|
|
|
--------------------
|
|
|
* blkCut(self, b, axord, pos) - Returns a cut (2d slice or 1d line segment) from 3d block at a given position. Does not interpolate, just finds the closest coordinate and copies the data. Args: b is block number, axord is an array (npa(3)) defining ordering of axes of the cut; pos is a 3 element list defining the position of the cutting object in the grid (None means this dimension has only 1 element in the AMR grid, "RANGE" means that it is copied, a number defines the position). Ret: npa(dir1[, dir2]) - cutting object: plane or line segment.
|
|
|
* blkIntegrate(self, b, axord, pos, bbox, quans, weights) - Integrates a block along a given direction(s) and returns a block with smaller dimension. Only certain quantities (given by list quans) are integrated. The integrated quantities are multiplied by number/array weights. Args: b is the block number; axord is an array (npa(3)) defining ordering of axes of the cut; pos is a 3 element list defining the position of the cutting object in the grid (None means this dimension has only 1 element in the AMR grid, "RANGE" means that it is copied, a number defines the position); bbox is the bounding box of the integrated grid (npa(dir,LO/HI)) ; quans is a list of quantities (strings) to be integrated; and weights are integration weights - a number or npa with the same shape (appart form the last dimension - quantities) as the original block b. Ret: a block with shape (dir1[, dir2], len(quans)) where dir1, and dir2 are dimensions of the original block in non-integration dimensions.
|
|
|
* blkCut(b, axord, pos) - Returns a cut (2d slice or 1d line segment) from 3d block at a given position. Does not interpolate, just finds the closest coordinate and copies the data. Args: b is block number, axord is an array (npa(3)) defining ordering of axes of the cut; pos is a 3 element list defining the position of the cutting object in the grid (None means this dimension has only 1 element in the AMR grid, "RANGE" means that it is copied, a number defines the position). Ret: npa(dir1[, dir2]) - cutting object: plane or line segment.
|
|
|
* blkIntegrate(b, axord, pos, bbox, quans, weights) - Integrates a block along a given direction(s) and returns a block with smaller dimension. Only certain quantities (given by list quans) are integrated. The integrated quantities are multiplied by number/array weights. Args: b is the block number; axord is an array (npa(3)) defining ordering of axes of the cut; pos is a 3 element list defining the position of the cutting object in the grid (None means this dimension has only 1 element in the AMR grid, "RANGE" means that it is copied, a number defines the position); bbox is the bounding box of the integrated grid (npa(dir,LO/HI)) ; quans is a list of quantities (strings) to be integrated; and weights are integration weights - a number or npa with the same shape (appart form the last dimension - quantities) as the original block b. Ret: a block with shape (dir1[, dir2], len(quans)) where dir1, and dir2 are dimensions of the original block in non-integration dimensions.
|
|
|
* blkToRefLevel(blk, rlDiff, axes) - Converts block blk to a different resolution by changing its size by a power of 2 (both shrink and grow). The values are simply copied or deleted, no interpolation is made. Args: blk is a block (npa with appropriate dimension + 1), rlDiff is a difference in the refinement level (integer), argument axes defines along which coords the growth/shrinking should be made. Ret: new block (npa with the same dim as blk.
|
|
|
|
|
|
|
... | ... | |