usage: fl conv [-h] [--ihdf IHDF [IHDF ...]]
[--mode {xy,xz,yz,x,y,z,1d,2d,3d}]
[--pos POS] [--bbox BBOX] [--quans QUANS] [--redlev REDLEV]
[--regen] [--ofname OFNAME] [--oftype {asc,fits,blk}]
Converts block structured AMR grid files (HDF or ASCII) to uniform grid files (ASCII or FITS). Can reduce dimensionality by making cuts and integrals aligned with the axes. The input and output grids use both the Cartesian coordinates, however, the ordering of their axes can differ. The input grid axes are called X, Y, Z, while the output grid axes are A0, A1 and A2. The ordering of the output grid axes is determined from the mode argument, e.g. 'mode=yz' means (A0,A1,A2) = (Y,Z,X), 'mode=y' means (A0,A1,A2) = (Y,X,Z) etc.
Arguments 'pos' and 'bbox' can be given as mathematical expressions and can include variables enclosed in curly brackets. Currently supported variables are: {time} - the simulation time, {nstep} - the simulation time step, the input grid properties {xmin}, {xmax}, {xcen}, {ymin} etc., and the output grid properties {a0min}, {a0max}, {a0cen}, {a1min}, etc.
optional arguments:
argument | description |
---|---|
-h, --help | show this help message and exit |
--ihdf IHDF [IHDF ...] | Input HDF file(s). Default: all HDF5 files in the current directory |
--mode {xy,xz,yz,x,y,z,1d,2d,3d} | Mode of conversion defining how is the output grid created from the input grid. If '1d', '2d' or '3d' is given, the grid of the same dimensionality is created. If 'xy', 'xz', or 'yz' is given, it is assumed that the input file is 3D, and a corresponding 2D cut along is produced and integrals in the normal direction are calculated. If 'x', 'y', or 'z' is given, the input grid can be 2D or 3D and the corresponding 1D cut is produced, and integrals along the remaining two directions are calculated. The position of the cutting plane / line segment can be set by the pos argument. Default: xy. |
--pos POS | Position of the cutting plane or the line segment in case the dimensionality of the input grid is being reduced. If mode is 'xy', 'xz', or 'yz' and the input grid is 3-dimensional, or if mode is 'x', 'y', or 'z' and the input grid is 2-dimensional, the argument pos must be a single number. If mode is 'x', 'y', or 'z' and the input grid is 3-dimensional, the argument pos must be two numbers separated by a coma. Expressions are also allowed, and they can include variables in curly brackets as described above. Default is a central point (or points) in the cutting direction(s). |
--bbox BBOX | Bounding box of the output grid allowing to reduce the grid extents. The format is: '<a0min>:<a0max>[,<a1min>:<a1max>[,<a2min>:<a2max>]][;pc]', and it gives limits of the output grid axes (note that the output grid axes ordering is used). The values etc. can be real numbers or expressions using the curly brackets variables described above. If suffix ';pc' is given, the numbers converted from pc to cm, i.e. multiplied by 3.0856776e18. Default is the same bounding box as the input grid. |
--quans QUANS | Defines quantities to be written to the output grid, given as a coma-separated list. Each field consits of generally three parts: <PREF>;<QUAN>:<MODULE>. <PREF> is the prefix indicating whether and how is the quantity modified during the AMR -> UG transformation. If <PREF> omitted, quantities are just copied to the UG grid. If <PREF> is 'i' or 'd', quantities are integrated (i) or weighted with density and integrated (d). Furthermore, <PREF> can define a cumulative sum or product using a form '[s|p][1|2|3][+|-]', where the first character indicates whether the sum or product is calculated, the second character denotes along which axis (of the UG grid) should be the sum/product calculated, and the third + or - tells whether the calculation proceeds in positive or negative deriction. <QUAN> is the name of the quantity, either from the AMR grid (vnames), or defined in the libquans library, or defined in the provided python module (see below). A shortcut {ALL} can be used to refer to all quantities in the AMR grid (those in the vnames list). <MODULE> is an optional external python module where the CAddedQuantity object and a calculating function for a given quantity is defined (see example module qtest.py). Default is {ALL} referring to the all input grid quantities. |
--redlev REDLEV | Reduction in the refinement level. By default, the conv command creates the uniform grid with the cell size corresponding to the smallest grid cell of the input grid. However, if redlev > 0 is given, the grid cell size of the output grid will be larger by factor 2**redlev (2 to the power of redlev) in all directions. The conv command does not do any interpolation (because ghost cells would be needed for that), so, larger grid cells are printed just as groups of small cells with the same value. Similarly, if the resolution is reduced, some grid cells are simply deleted, instead of calculating averages. Default: 0 |
--regen | If set, regenerate existing ASCII files. Default: keep existing ASCII files |
--ofname | Name of the output file. If oftype = 'fits', argument quans can include only one quantity and it is used as a prefix of the default file name. Default: <asc |
--oftype {asc,fits,blk} | Type of the output file. Default: asc |
Example 1:
fl conv --mode=xy --quans='{ALL},i;dens,d;ihp_,d;iha_,d;ih2_' --ihdf FLTest3d_hdf5_plt_cnt_0010
will create a 2d slice in xy plane through the grid at the centre of the z-coordinate. It will output all quantities from the AMR grid, plus the column density (integral of the density in the z-direction), and column densities of the ionised, atomic and molecular hydrogen (density weighted integrals of the appropriate abundances.)
Example 2:
fl conv --regen --ihdf FLTest3d_hdf5_plt_cnt_0010 --mode=y --pos=1e19,1e19 --quans='{ALL},i;dens'
will create a line along the y-direction cutting the 3d grid at coordinates x=1e19, z=1e19. It will output all quantities from the AMR grid, plus the linear density (integral over x and z directions).
Example 3:
fl conv --regen --mode=xz --ihdf FLTest3d_hdf5_plt_cnt_0010 --quans='qtst:qtest,velm,s1+;qtst:qtest,p2-;iha_'
will create a slice in the xz plane, writing out quantity qtst defined in module qtest.py, quantity velm (velocity magnitude) defined in libquans, cumulative sum of quantity qtst along axis 1, and cumulative product of the atomic hydrogen abundance (iha_ quantity) along axis 2 in the negative direction.