Types
Abstract type hierarchies

- HydroMapsType <: DataMapsType
- PartMapsType <: DataMapsType
List of types
Mera.CheckOutputNumberTypeMera.ClumpDataTypeMera.CompilationInfoTypeMera.ContainMassDataSetTypeMera.DataMapsTypeMera.DataSetTypeMera.DescriptorTypeMera.GridInfoTypeMera.Histogram2DMapTypeMera.HydroDataTypeMera.HydroMapsTypeMera.HydroPartTypeMera.InfoTypeMera.PartDataTypeMera.PartInfoTypeMera.PartMapsTypeMera.PhysicalUnitsTypeMera.ScalesTypeMera.WStatType
Functions
Mera.amroverviewMera.amroverviewMera.average_velocityMera.bulk_velocityMera.center_of_massMera.center_of_massMera.checkoutputsMera.comMera.comMera.construct_datatypeMera.createpathMera.createscales!Mera.dataoverviewMera.dataoverviewMera.dataoverviewMera.getclumpsMera.getextentMera.gethydroMera.getinfoMera.getmassMera.getparticlesMera.getpositionsMera.gettimeMera.getvarMera.histogram2dMera.humanizeMera.makefileMera.msumMera.patchfileMera.prep_cylindrical_shellrangesMera.prep_spherical_shellrangesMera.preprangesMera.preprangesMera.printtimeMera.projectionMera.projectionMera.remapMera.shellregionMera.storageoverviewMera.timerfileMera.usedmemoryMera.viewallfieldsMera.viewfieldsMera.viewmoduleMera.wstat
Documentation Types
Mera.ClumpDataType — TypeMutable Struct: Contains clump data and information about the selected simulation
ClumpDataType <: ContainMassDataSetType
Mera.CompilationInfoType — TypeMutable Struct: Contains the collected information about the compilation of RAMSES
Mera.ContainMassDataSetType — TypeAbstract Supertype of all datasets that contain mass variables
HydroPartType <: ContainMassDataSetType <: DataSetType
Mera.DataMapsType — TypeAbstract Supertype of all the different dataset type maps HydroMapsType <: DataMapsType PartMapsType <: DataMapsType
Mera.DataSetType — TypeAbstract Supertype of all the different dataset types
HydroPartType <: ContainMassDataSetType <: DataSetType
Mera.DescriptorType — TypeMutable Struct: Contains the collected information about the descriptors
Mera.GridInfoType — TypeMutable Struct: Contains the collected information about grid
Mera.Histogram2DMapType — TypeMutable Struct: Contains the 2D histogram returned by the function: histogram2 and information about the selected simulation
Mera.HydroDataType — TypeMutable Struct: Contains hydro data and information about the selected simulation
HydroDataType <: HydroPartType
Mera.HydroMapsType — TypeMutable Struct: Contains the maps/units returned by the hydro-projection information about the selected simulation
Mera.HydroPartType — TypeAbstract Supertype of data-sets that contain hydro and particle data
HydroPartType <: ContainMassDataSetType <: DataSetType
Mera.InfoType — TypeMutable Struct: Collected information about the selected simulation output
Mera.PartDataType — TypeMutable Struct: Contains particle data and information about the selected simulation
PartDataType <: HydroPartType
Mera.PartInfoType — TypeMutable Struct: Contains the collected information about particles
Mera.PartMapsType — TypeMutable Struct: Contains the maps/units returned by the particles-projection information about the selected simulation
Mera.PhysicalUnitsType — TypeMutable Struct: Contains the physical constants in cgs units
Mera.ScalesType — TypeMutable Struct: Contains the created scale factors from code to physical units
Mera.CheckOutputNumberType — TypeMutable Struct: Contains the existing simulation snapshots in a folder and a list of the empty output-folders
Mera.WStatType — TypeMutable Struct: Contains the output statistics returned by wstat
Documentation Functions
Mera.amroverview — MethodGet the number of cells and/or the CPUs per level
function overview_amr(dataobject::HydroDataType, verbose::Bool=true)
function overview_amr(dataobject::HydroDataType; verbose::Bool=true)
return a JuliaDB tableMera.amroverview — MethodGet the number of particles and/or the CPUs per level
function overview_amr(dataobject::PartDataType, verbose::Bool=true)
function overview_amr(dataobject::PartDataType; verbose::Bool=true)
return a JuliaDB tableMera.average_velocity — MethodCalculate the average velocity (w/o mass-weight) of any ContainMassDataSetType:
average_velocity(dataobject::ContainMassDataSetType; unit::Symbol=:standard, weighting::Symbol=:mass, mask::MaskType=[false])
return Tuple{Float64, Float64, Float64,}Arguments
Required:
dataobject: needs to be of type: "ContainMassDataSetType"
Optional Keywords:
unit: the unit of the result (can be used w/o keyword): :standard (code units) :kms, :ms, :cm_s (of typye Symbol) ..etc. ; see for defined velocity-scales viewfields(info.scale)weighting: use different weightings: :mass (default), :volume (hydro), :nomask: needs to be of type MaskType which is a supertype of Array{Bool,1} or BitArray{1} with the length of the database (rows)
Mera.bulk_velocity — MethodCalculate the average velocity (w/o mass-weight) of any ContainMassDataSetType:
bulk_velocity(dataobject::ContainMassDataSetType; unit::Symbol=:standard, weighting::Symbol=:mass, mask::MaskType=[false])
return Tuple{Float64, Float64, Float64,}Arguments
Required:
dataobject: needs to be of type: "ContainMassDataSetType"
Optional Keywords:
unit: the unit of the result (can be used w/o keyword): :standard (code units) :kms, :ms, :cm_s (of typye Symbol) ..etc. ; see for defined velocity-scales viewfields(info.scale)weighting: use different weightings: :mass (default), :volume (hydro), :nomask: needs to be of type MaskType which is a supertype of Array{Bool,1} or BitArray{1} with the length of the database (rows)
Mera.center_of_mass — MethodCalculate the center-of-mass of any ContainMassDataSetType:
center_of_mass(dataobject::ContainMassDataSetType; unit::Symbol=:standard, mask::MaskType=[false])
return Tuple{Float64, Float64, Float64,}Arguments
Required:
dataobject: needs to be of type: "ContainMassDataSetType"
Optional Keywords:
unit: the unit of the result (can be used w/o keyword): :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)mask: needs to be of type MaskType which is a supertype of Array{Bool,1} or BitArray{1} with the length of the database (rows)
Mera.center_of_mass — MethodCalculate the joint center-of-mass of any HydroPartType:
center_of_mass(dataobject::Array{HydroPartType,1}, unit::Symbol; mask::MaskArrayAbstractType=[[false],[false]])
return Tuple{Float64, Float64, Float64,}Arguments
Required:
dataobject: needs to be of type: "Array{HydroPartType,1}""
Optional Keywords:
unit: the unit of the result (can be used w/o keyword): :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)mask: needs to be of type MaskArrayAbstractType which contains two entries with supertype of Array{Bool,1} or BitArray{1} and the length of the database (rows)
Mera.checkoutputs — FunctionGet the existing simulation snapshots in a given folder
- returns field
outputswith Array{Int,1} containing the output-numbers of the existing simulations - returns field
misswith Array{Int,1} containing the output-numbers of empty simulation folders - returns field
pathas String
checkoutputs(path::String="./")
return CheckOutputNumberTypeExamples
# Example 1:
# look in current folder
julia> N = checkoutputs();
julia> N.outputs
julia> N.miss
julia> N.path
# Example 2:
# look in given path
# without any keyword
julia>N = checkoutputs("simulation001");Mera.com — MethodCalculate the center-of-mass of any ContainMassDataSetType:
com(dataobject::ContainMassDataSetType; unit::Symbol=:standard, mask::MaskType=[false])
return Tuple{Float64, Float64, Float64,}Arguments
Required:
dataobject: needs to be of type: "ContainMassDataSetType"
Optional Keywords:
unit: the unit of the result (can be used w/o keyword): :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)mask: needs to be of type MaskType which is a supertype of Array{Bool,1} or BitArray{1} with the length of the database (rows)
Mera.com — MethodCalculate the joint center-of-mass of any HydroPartType:
com(dataobject::Array{HydroPartType,1}, unit::Symbol; mask::MaskArrayAbstractType=[[false],[false]])
return Tuple{Float64, Float64, Float64,}Arguments
Required:
dataobject: needs to be of type: "Array{HydroPartType,1}""
Optional Keywords:
unit: the unit of the result (can be used w/o keyword): :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)mask: needs to be of type MaskArrayAbstractType which contains two entries with supertype of Array{Bool,1} or BitArray{1} and the length of the database (rows)
Mera.construct_datatype — MethodCreate a New DataSetType from a Filtered Data Table
function construct_datatype(data::JuliaDB.AbstractIndexedTable, dataobject::HydroDataType)
return HydroDataType
function construct_datatype(data::JuliaDB.AbstractIndexedTable, dataobject::PartDataType)
return PartDataType
function construct_datatype(data::JuliaDB.AbstractIndexedTable, dataobject::ClumpDataType)
return ClumpDataTypeExample
# read simulation information
julia> info = getinfo(420)
julia> gas = gethydro(info)
# filter and create a new` data table
julia> density = 3. /gas.scale.Msol_pc3
julia> filtered_db = @filter gas.data :rho >= density
# construct a new HydroDataType
# (comparable to the object "gas" but only with filtered data)
julia> gas_new = construct_datatype(filtered_db, gas)Mera.createpath — Method```julia createpath(output::Real, path::String; namelist::String="")
return FileNamesType ```
Mera.dataoverview — MethodGet the extrema of each variable in the database
function dataoverview(dataobject::ClumpDataType)
return a JuliaDB tableMera.dataoverview — MethodGet the mass and min/max value of each variable in the database per level
function dataoverview(dataobject::HydroDataType, verbose::Bool=true)
function dataoverview(dataobject::HydroDataType; verbose::Bool=true)
return a JuliaDB tableMera.dataoverview — MethodGet the min/max value of each variable in the database per level
function dataoverview(dataobject::PartDataType, verbose::Bool=true)
function dataoverview(dataobject::PartDataType; verbose::Bool=true)
return a JuliaDB tableMera.getclumps — MethodRead the clump-data:
- selected variables
- limited to a spatial range
- print the name of each data-file before reading it
- toggle verbose mode
getclumps( dataobject::InfoType;
vars::Array{Symbol,1}=[:all],
xrange::Array{<:Any,1}=[missing, missing],
yrange::Array{<:Any,1}=[missing, missing],
zrange::Array{<:Any,1}=[missing, missing],
center::Array{<:Any,1}=[0., 0., 0.],
range_unit::Symbol=:standard,
print_filenames::Bool=false,
verbose::Bool=verbose_mode)Returns an object of type ClumpDataType, containing the clump-data table, the selected options and the simulation ScaleType and summary of the InfoType
return ClumpDataType()
# get an overview of the returned fields:
# e.g.:
julia> info = getinfo(100)
julia> clumps = getclumps(info)
julia> viewfields(clumps)
#or:
julia> fieldnames(clumps)Arguments
Required:
dataobject: needs to be of type: "InfoType", created by the function getinfo
Predefined/Optional Keywords:
vars: Currently, the length of the loaded variable list can be modified *(see examples below).xrange: the range between [xmin, xmax] in units given by argumentrange_unitand relative to the givencenter; zero length for xmin=xmax=0. is converted to maximum possible lengthyrange: the range between [ymin, ymax] in units given by argumentrange_unitand relative to the givencenter; zero length for ymin=ymax=0. is converted to maximum possible lengthzrange: the range between [zmin, zmax] in units given by argumentrange_unitand relative to the givencenter; zero length for zmin=zmax=0. is converted to maximum possible lengthrange_unit: the units of the given ranges: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)center: in units given by argumentrange_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..print_filenames: print on screen the current processed particle file of each CPUverbose: print timestamp, selected vars and ranges on screen; default: set by the variableverbose_mode
Defined Methods - function defined for different arguments
- getclumps(dataobject::InfoType; ...) # no given variables -> all variables loaded
- getclumps(dataobject::InfoType, vars::Array{Symbol,1}; ...) # one or several given variables -> array needed
Examples
# read simulation information
julia> info = getinfo(420)
# Example 1:
# read clump data of all variables, full-box
julia> clumps = getclumps(info)
# Example 2:
# read clump data of all variables
# data range 20x20x4 kpc; ranges are given in kpc relative to the box (here: 48 kpc) center at 24 kpc
julia> clumps = getclumps( info,
xrange=[-10.,10.],
yrange=[-10.,10.],
zrange=[-2.,2.],
center=[24., 24., 24.],
range_unit=:kpc )
# Example 3:
# give the center of the box by simply passing: center = [:bc] or center = [:boxcenter]
# this is equivalent to center=[24.,24.,24.] in Example 2
# the following combination is also possible: e.g. center=[:bc, 12., 34.], etc.
julia> clumps = getclumps( info,
xrange=[-10.,10.],
yrange=[-10.,10.],
zrange=[-2.,2.],
center=[33., bc:, 10.],
range_unit=:kpc )
# Example 4:
# Load less than the found 12 columns from the header of the clump files;
# Pass an array with the variables to the keyword argument *vars*.
# The order of the variables has to be consistent with the header in the clump files:
julia> lumps = getclumps(info, [ :index, :lev, :parent, :ncell,
:peak_x, :peak_y, :peak_z ])
# Example 5:
# Load more than the found 12 columns from the header of the clump files.
# E.g. the list can be extended with more names if there are more columns
# in the data than given by the header in the files.
# The order of the variables has to be consistent with the header in the clump files:
julia> clumps = getclumps(info, [ :index, :lev, :parent, :ncell,
:peak_x, :peak_y, :peak_z,
Symbol("rho-"), Symbol("rho+"),
:rho_av, :mass_cl, :relevance,
:vx, :vy, :vz ])
...Mera.getextent — MethodGet the extent of the dataset-domain:
function getextent( dataobject::DataSetType;
unit::Symbol=:standard,
center::Array{<:Any,1}=[0., 0., 0.],
center_unit::Symbol=:standard,
direction::Symbol=:z)
return (xmin, xmax), (ymin ,ymax ), (zmin ,zmax )Arguments
Required:
dataobject: needs to be of type: "DataSetType"
Predefined/Optional Keywords:
center: in unit given by argumentcenter_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..center_unit: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)direction: todounit: return the variables in given unit
Defined Methods - function defined for different arguments
- getextent( dataobject::DataSetType; # one given variable
- getextent( dataobject::DataSetType, unit::Symbol; ...) # one given variable with its unit
Mera.gethydro — MethodRead the leaf-cells of the hydro-data:
- select variables
- limit to a maximum level
- limit to a spatial range
- set a minimum density or sound speed
- check for negative values in density and thermal pressure
- print the name of each data-file before reading it
- toggle verbose mode
gethydro( dataobject::InfoType;
lmax::Real=dataobject.levelmax,
vars::Array{Symbol,1}=[:all],
xrange::Array{<:Any,1}=[missing, missing],
yrange::Array{<:Any,1}=[missing, missing],
zrange::Array{<:Any,1}=[missing, missing],
center::Array{<:Any,1}=[0., 0., 0.],
range_unit::Symbol=:standard,
smallr::Real=0.,
smallc::Real=0.,
check_negvalues::Bool=false,
print_filenames::Bool=false,
verbose::Bool=verbose_mode )Returns an object of type HydroDataType, containing the hydro-data table, the selected options and the simulation ScaleType and summary of the InfoType
return HydroDataType()
# get an overview of the returned fields:
# e.g.:
julia> info = getinfo(100)
julia> gas = gethydro(info)
julia> viewfields(gas)
#or:
julia> fieldnames(gas)Arguments
Required:
dataobject: needs to be of type: "InfoType", created by the function getinfo
Predefined/Optional Keywords:
lmax: the maximum level to be read from the datavar(s): the selected hydro variables in arbitrary order: :all (default), :cpu, :rho, :vx, :vy, :vz, :p, :var6, :var7...xrange: the range between [xmin, xmax] in units given by argumentrange_unitand relative to the givencenter; zero length for xmin=xmax=0. is converted to maximum possible lengthyrange: the range between [ymin, ymax] in units given by argumentrange_unitand relative to the givencenter; zero length for ymin=ymax=0. is converted to maximum possible lengthzrange: the range between [zmin, zmax] in units given by argumentrange_unitand relative to the givencenter; zero length for zmin=zmax=0. is converted to maximum possible lengthrange_unit: the units of the given ranges: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)center: in units given by argumentrange_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..smallr: set lower limit for density; zero means inactivesmallc: set lower limit for thermal pressure; zero means inactivecheck_negvalues: check loaded data of "rho" and "p" on negative values; false by defaultprint_filenames: print on screen the current processed hydro file of each CPUverbose: print timestamp, selected vars and ranges on screen; default: set by the variableverbose_mode
Defined Methods - function defined for different arguments
- gethydro( dataobject::InfoType; ...) # no given variables -> all variables loaded
- gethydro( dataobject::InfoType, var::Symbol; ...) # one given variable -> no array needed
- gethydro( dataobject::InfoType, vars::Array{Symbol,1}; ...) # several given variables -> array needed
Examples
# read simulation information
julia> info = getinfo(420)
# Example 1:
# read hydro data of all variables, full-box, all levels
julia> gas = gethydro(info)
# Example 2:
# read hydro data of all variables up to level 8
# data range 20x20x4 kpc; ranges are given in kpc relative to the box (here: 48 kpc) center at 24 kpc
julia> gas = gethydro( info,
lmax=8,
xrange=[-10.,10.],
yrange=[-10.,10.],
zrange=[-2.,2.],
center=[24., 24., 24.],
range_unit=:kpc )
# Example 3:
# give the center of the box by simply passing: center = [:bc] or center = [:boxcenter]
# this is equivalent to center=[24.,24.,24.] in Example 2
# the following combination is also possible: e.g. center=[:bc, 12., 34.], etc.
julia> gas = gethydro( info,
lmax=8,
xrange=[-10.,10.],
yrange=[-10.,10.],
zrange=[-2.,2.],
center=[33., bc:, 10.],
range_unit=:kpc )
# Example 4:
# read hydro data of the variables density and the thermal pressure, full-box, all levels
julia> gas = gethydro( info, [:rho, :p] ) # use array for the variables
# Example 5:
# read hydro data of the single variable density, full-box, all levels
julia> gas = gethydro( info, :rho ) # no array for a single variable needed
...Mera.getinfo — MethodGet the simulation overview from RAMSES info, descriptor and output header files
getinfo(; output::Real=1, path::String="", namelist::String="", verbose::Bool=verbose_mode)
return InfoTypeKeyword Arguments
output: timestep number (default=1)path: the path to the output folder relative to the current folder or absolute pathnamelist: give the path to a namelist file (by default the namelist.txt-file in the output-folder is read)verbose:: informations are printed on the screen by default: gloval variableverbose_mode=true
Examples
# read simulation information from output `1` in current folder
julia> info = getinfo()
# read simulation information from output `420` in given folder (relative path to the current working folder)
julia> info = getinfo(output=420, path="../MySimFolder/")
# or simply use
julia> info = getinfo(420, "../MySimFolder/")
# get an overview of the returned field-names
julia> propertynames(info)
# a more detailed overview
julia> viewfields(info)
julia> viewallfields(info)
julia> namelist(info)Mera.getmass — MethodGet mass-array from the dataset (cells/particles/clumps/...):
getmass(dataobject::HydroDataType)
getmass(dataobject::PartDataType)
getmass(dataobject::ClumpDataType)
return Array{Float64,1}Mera.getparticles — MethodRead the particle-data
- select variables
- limit to a maximum range
- print the name of each data-file before reading it
- toggle verbose mode
getparticles( dataobject::InfoType;
lmax::Real=dataobject.levelmax,
vars::Array{Symbol,1}=[:all],
stars::Bool=true,
xrange::Array{<:Any,1}=[missing, missing],
yrange::Array{<:Any,1}=[missing, missing],
zrange::Array{<:Any,1}=[missing, missing],
center::Array{<:Any,1}=[0., 0., 0.],
range_unit::Symbol=:standard,
presorted::Bool=true,
print_filenames::Bool=false,
verbose::Bool=verbose_mode)Returns an object of type PartDataType, containing the particle-data table, the selected and the simulation ScaleType and summary of the InfoType
return PartDataType()
# get an overview of the returned fields:
# e.g.:
julia> info = getinfo(100)
julia> particles = getparticles(info)
julia> viewfields(particles)
#or:
julia> fieldnames(particles)Arguments
Required:
dataobject: needs to be of type: "InfoType", created by the function getinfo
Predefined/Optional Keywords:
lmax: not definedstars: not definedvar(s): the selected particle variables in arbitrary order: :all (default), :cpu, :mass, :vx, :vy, :vz, :birth :metals, ...xrange: the range between [xmin, xmax] in units given by argumentrange_unitand relative to the givencenter; zero length for xmin=xmax=0. is converted to maximum possible lengthyrange: the range between [ymin, ymax] in units given by argumentrange_unitand relative to the givencenter; zero length for ymin=ymax=0. is converted to maximum possible lengthzrange: the range between [zmin, zmax] in units given by argumentrange_unitand relative to the givencenter; zero length for zmin=zmax=0. is converted to maximum possible lengthrange_unit: the units of the given ranges: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)center: in units given by argumentrange_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..presorted: presort data according to the key vars (by default)print_filenames: print on screen the current processed particle file of each CPUverbose: print timestamp, selected vars and ranges on screen; default: set by the variableverbose_mode
Defined Methods - function defined for different arguments
- getparticles( dataobject::InfoType; ...) # no given variables -> all variables loaded
- getparticles( dataobject::InfoType, var::Symbol; ...) # one given variable -> no array needed
- getparticles( dataobject::InfoType, vars::Array{Symbol,1}; ...) # several given variables -> array needed
Examples
# read simulation information
julia> info = getinfo(420)
# Example 1:
# read particle data of all variables, full-box, all levels
julia> particles = getparticles(info)
# Example 2:
# read particle data of all variables
# data range 20x20x4 kpc; ranges are given in kpc relative to the box (here: 48 kpc) center at 24 kpc
julia> particles = getparticles( info,
xrange=[-10., 10.],
yrange=[-10., 10.],
zrange=[-2., 2.],
center=[24., 24., 24.],
range_unit=:kpc )
# Example 3:
# give the center of the box by simply passing: center = [:bc] or center = [:boxcenter]
# this is equivalent to center=[24.,24.,24.] in Example 2
# the following combination is also possible: e.g. center=[:bc, 12., 34.], etc.
julia> particles = getparticles( info,
xrange=[-10.,10.],
yrange=[-10.,10.],
zrange=[-2.,2.],
center=[33., bc:, 10.],
range_unit=:kpc )
# Example 4:
# read particle data of the variables mass and the birth-time, full-box, all levels
julia> particles = getparticles( info, [:mass, :birth] ) # use array for the variables
# Example 5:
# read particle data of the single variable mass, full-box, all levels
julia> particles = getparticles( info, :mass ) # no array for a single variable needed
...Mera.getpositions — MethodGet the x,y,z positions from the dataset (cells/particles/clumps/...):
getpositions( dataobject::DataSetType;
unit::Symbol=:standard,
direction::Symbol=:z,
center::Array{<:Any,1}=[0., 0., 0.],
center_unit::Symbol=:standard)
return x, y, zArguments
Required:
dataobject: needs to be of type: "DataSetType"
Predefined/Optional Keywords:
center: in unit given by argumentcenter_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..center_unit: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)direction: todounit: return the variables in given unitmask: needs to be of type MaskType which is a supertype of Array{Bool,1} or BitArray{1} with the length of the database (rows)
Defined Methods - function defined for different arguments
- getpositions( dataobject::DataSetType; ...) # one given variable
- getpositions( dataobject::DataSetType, unit::Symbol; ...) # one given variable with its unit
Mera.gettime — MethodGet physical time in selected units
returns Float
gettime(output::Real; path::String="./", unit::Symbol=:standard)
gettime(dataobject::DataSetType; unit::Symbol=:standard)
gettime(dataobject::InfoType, unit::Symbol=:standard)
return timeArguments Function 1
Required:
output: give the output-number of the simulation
Predefined/Optional Keywords:
path: the path to the output folder relative to the current folder or absolute pathunit: return the variable in given unit
Arguments Function 2
Required:
dataobject: needs to be of type: "DataSetType"
Predefined/Optional Keywords:
unit: return the variable in given unit
Arguments Function 3
Required:
dataobject: needs to be of type: "InfoType"
Predefined/Optional Keywords:
unit: return the variable in given unit
Mera.getvar — MethodGet variables or derived quantities from the dataset:
- overview the list of predefined quantities with: getinfo()
- select variable(s) and their unit(s)
- give the spatial center (with units) of the data within the box (relevant e.g. for radius dependency)
- relate the coordinates to a direction (x,y,z)
- pass a modified database
- pass a mask to exclude elements (cells/particles/...) from the calculation
getvar( dataobject::DataSetType, var::Symbol;
filtered_db::JuliaDB.AbstractIndexedTable=JuliaDB.table([1]),
center::Array{<:Any,1}=[0.,0.,0.],
center_unit::Symbol=:standard,
direction::Symbol=:z,
unit::Symbol=:standard,
mask::MaskType=[false],
ref_time::Real=dataobject.info.time)
return Array{Float64,1}
Arguments
Required:
dataobject: needs to be of type: "DataSetType"var(s): select a variable from the database or a predefined quantity (see field: info, function getvar(), dataobject.data)
Predefined/Optional Keywords:
filtered_db: pass a filtered or manipulated database together with the corresponding DataSetType object (required argument)center: in units given by argumentcenter_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..center_unit: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)direction: todounit(s): return the variable in given unitsmask: needs to be of type MaskType which is a supertype of Array{Bool,1} or BitArray{1} with the length of the database (rows)ref_time: reference zero-time for particle age calculation
Defined Methods - function defined for different arguments
- getvar( dataobject::DataSetType, var::Symbol; ...) # one given variable -> returns 1d array
- getvar( dataobject::DataSetType, var::Symbol, unit::Symbol; ...) # one given variable with its unit -> returns 1d array
- getvar( dataobject::DataSetType, vars::Array{Symbol,1}; ...) # several given variables -> array needed -> returns dictionary with 1d arrays
- getvar( dataobject::DataSetType, vars::Array{Symbol,1}, units::Array{Symbol,1}; ...) # several given variables and their corresponding units -> both arrays -> returns dictionary with 1d arrays
- getvar( dataobject::DataSetType, vars::Array{Symbol,1}, unit::Symbol; ...) # several given variables that have the same unit -> array for the variables and a single Symbol for the unit -> returns dictionary with 1d arrays
Examples
```julia
read simulation information
julia> info = getinfo(420) julia> gas = gethydro(info)
Example 1: get the mass for each cell of the hydro data (1dim array)
mass1 = getvar(gas, :mass) # in [code units] mass = getvar(gas, :mass) * gas.scale.Msol # scale the result from code units to solar masses mass = getvar(gas, :mass, unit=:Msol) # unit calculation, provided by a keyword argument mass = getvar(gas, :mass, :Msol) # unit calculation provided by an argument
Example 2: get the mass and |v| (several variables) for each cell of the hydro data
quantities = getvar(gas, [:mass, :v]) # in [code units] returns: Dict{Any,Any} with 2 entries: :mass => [8.9407e-7, 8.9407e-7, 8.9407e-7, 8.9407e-7, 8.9407e-7, 8.9407e-7, 8… :v => [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 … 2.28274e-7, 2.…
quantities = getvar(gas, [:mass, :v], units=[:Msol, :kms]) # unit calculation, provided by a keyword argument quantities = getvar(gas, [:mass, :v], [:Msol, :kms]) # unit calculation provided by an argument
Example 3: get several variables in the same units by providing a single argument
quantities = getvar(gas, [:vx, :vy, :vz], :km_s) ...
Mera.histogram2d — Method2d histogram of 2 given arrays or derived quantities (calculations based on StatsBase.jl)
- pass two 1d data arrays
- or give the quantity with units
- costum/automatic data ranges (left-/right-closed)
- binsizes
- give quantity for weighting with units
- pass a mask to exclude elements (cells/particles/...) from the calculation
- toggle verbose mode
histogram2d(dataobject::DataSetType, data::Array{Array{Float64,1},1};
xrange::Array{<:Any,1}=[missing, missing],
yrange::Array{<:Any,1}=[missing, missing],
nbins::Array{Int,1}=[100,100],
weight::Tuple{Symbol,Symbol}=(:mass,:Msol),
closed::Symbol=:left,
mask=[false],
mode::Symbol=:none,
verbose::Bool=verbose_mode)
return Histogram2DMapTypeArguments
Required:
dataobject: needs to be of type: "DataSetType"data: provide two 1d data arrays for axis [x,y]
Predefined/Optional Keywords:
xrange: the considered interval [xmin, xmax] in units of the given x-axis datayrange: the considered interval [ymin, ymax] in units of the given y-axis dataclosed: bin intervals :left [a,b) or :right (a,b] closednbins: number of bins for x- and y-axisweight: give a tuple with the quantity und unit that is used for weighting (see getvar() for possible derived quantities)mask: needs to be of type MaskType which is a supertype of Array{Bool,1} or BitArray{1} with the length of the database (rows)
mode: see Histogram from StatsBase.jl:
:pdf: Normalize by sum of weights and bin sizes. Resulting histogram has norm 1 and represents a PDF.:density: Normalize by bin sizes only. Resulting histogram represents count density of input and does not have norm 1. Will not modify the histogram if it already represents a density.:probability: Normalize by sum of weights only. Resulting histogram represents the fraction of probability mass for each bin and does not have norm 1.:none: Leaves histogram unchanged. Useful to simplify code that has to conditionally apply different modes of normalization.
Defined Methods - function defined for different arguments
- histogram2d(dataobject::DataSetType, data::Array{Array{Float64,1},1}; ...) # enclose two 1d arrays in an array -> [xdata, ydata], ...
- histogram2d(dataobject::DataSetType, data1::Array{<:Number,1}, data2::Array{<:Number,1}; ...) # give two 1d arrays separately without keywords -> xdata, ydata,...
- histogram2d(dataobject::DataSetType, data1::Array{<:Number,1}, data2::Array{<:Number,1}, xrange::Array{<:Any,1}, yrange::Array{<:Any,1}; ...) # give two 1d arrays separately and the intervals without keywords -> xdata, ydata, [xmin,xmax], [ymin,ymax],...
- histogram2d(dataobject::DataSetType, data::Array{Tuple{Symbol,Symbol},1}; ...) # give the quantity names with units for the 2 data components in a tuple (default: assumes linear scale) -> ((:rho, :Msolpc3), (:cs, :kms)), ....
- histogram2d(dataobject::DataSetType, data::Array{Tuple{Symbol,Symbol,Symbol},1}; ...) # give the quantity names with units and scaling (:linear or :log10) for the 2 data components in a tuple -> ((:rho, :Msolpc3, :log10), (:cs, :kms, :log10)), ....
Short summary how to give the data and ranges (keep order):
- histogram2d( dataobject, [xdata, ydata], ...)
- histogram2d( dataobject, xdata, ydata, ...)
- histogram2d( dataobject, xdata, ydata, [xmin,xmax], [ymin,ymax], ...)
- histogram2d( dataobject, ((:rho, :nH), (:cs, :km_s)), ....)
- histogram2d( dataobject, ((:rho, :nH, :log10), (:cs, :km_s, :log10)), ....)
Mera.humanize — MethodConvert a value to human-readable astrophysical units and round to ndigits
(pass the value in code units and the quantity specification (length, time) )
function humanize(value::Float64, scale::ScalesType, ndigits::Int, quantity::String)
return value, value_unitMera.makefile — MethodGet a printout of the makefile:
makefile(object::InfoType)Mera.msum — MethodCalculate the total mass of any ContainMassDataSetType:
msum(dataobject::ContainMassDataSetType; unit::Symbol=:standard, mask::MaskType=[false])
return Float64Arguments
Required:
dataobject: needs to be of type: "ContainMassDataSetType"
Optional Keywords:
unit: the unit of the result (can be used w/o keyword): :standard (code units) :Msol, :Mearth, :Mjupiter, :g, :kg (of typye Symbol) ..etc. ; see for defined mass-scales viewfields(info.scale)mask: needs to be of type MaskType which is a supertype of Array{Bool,1} or BitArray{1} with the length of the database (rows)
Mera.patchfile — MethodGet a printout of the patchfile:
patchfile(object::InfoType)Mera.printtime — Functionprint a Mera timestamp on the screen if the global variable: verbose_mode == true
function printtime(text::String="", verbose::Bool=verbose_mode)Mera.projection — MethodProject variables or derived quantities from the hydro-dataset:
- projection to a grid related to the maximum level of the loaded data
- overview the list of predefined quantities with: projection()
- select variable(s) and their unit(s)
- limit to a maximum range
- select a coarser grid than the maximum resolution of the loaded data (maps with both resolutions are created)
- give the spatial center (with units) of the data within the box (relevant e.g. for radius dependency)
- relate the coordinates to a direction (x,y,z)
- select between mass (default) and volume weighting
- pass a mask to exclude elements (cells/particles/...) from the calculation
- toggle verbose mode
projection( dataobject::HydroDataType, vars::Array{Symbol,1};
units::Array{Symbol,1}=[:standard],
lmax::Real=dataobject.lmax,
mask=[false],
direction::Symbol=:z,
weighting::Symbol=:mass,
xrange::Array{<:Any,1}=[missing, missing],
yrange::Array{<:Any,1}=[missing, missing],
zrange::Array{<:Any,1}=[missing, missing],
center::Array{<:Any,1}=[0., 0., 0.],
range_unit::Symbol=:standard,
data_center::Array{<:Any,1}=[missing, missing, missing],
data_center_unit::Symbol=:standard,
verbose::Bool=verbose_mode)
return HydroMapsType
Arguments
Required:
dataobject: needs to be of type: "HydroDataType"var(s): select a variable from the database or a predefined quantity (see field: info, function projection(), dataobject.data)
Predefined/Optional Keywords:
unit(s): return the variable in given unitslmax: create maps with coarser grid than provided by the maximum level of the loaded dataxrange: the range between [xmin, xmax] in units given by argumentrange_unitand relative to the givencenter; zero length for xmin=xmax=0. is converted to maximum possible lengthyrange: the range between [ymin, ymax] in units given by argumentrange_unitand relative to the givencenter; zero length for ymin=ymax=0. is converted to maximum possible lengthzrange: the range between [zmin, zmax] in units given by argumentrange_unitand relative to the givencenter; zero length for zmin=zmax=0. is converted to maximum possible lengthrange_unit: the units of the given ranges: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)center: in units given by argumentrange_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..weighting: select between:massweighting (default) and:volumeweightingdata_center: to calculate the data relative to the datacenter; in units given by argument `datacenterunit`; by default the argument datacenter = center ;data_center_unit: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)direction: select between: :x, :y, :zmask: needs to be of type MaskType which is a supertype of Array{Bool,1} or BitArray{1} with the length of the database (rows)
Defined Methods - function defined for different arguments
- projection( dataobject::HydroDataType, var::Symbol; ...) # one given variable
- projection( dataobject::HydroDataType, var::Symbol, unit::Symbol; ...) # one given variable with its unit
- projection( dataobject::HydroDataType, vars::Array{Symbol,1}; ...) # several given variables -> array needed
- projection( dataobject::HydroDataType, vars::Array{Symbol,1}, units::Array{Symbol,1}; ...) # several given variables and their corresponding units -> both arrays
- projection( dataobject::HydroDataType, vars::Array{Symbol,1}, unit::Symbol; ...) # several given variables that have the same unit -> array for the variables and a single Symbol for the unit
Examples
...
Mera.projection — MethodProject variables or derived quantities from the particle-dataset:
- projection to a grid related to a given level
- overview the list of predefined quantities with: projection()
- select variable(s) and their unit(s)
- limit to a maximum range
- give the spatial center (with units) of the data within the box (relevant e.g. for radius dependency)
- relate the coordinates to a direction (x,y,z)
- select between mass (default) and volume weighting
- pass a mask to exclude elements (cells/particles/...) from the calculation
- toggle verbose mode
projection( dataobject::PartDataType, vars::Array{Symbol,1};
units::Array{Symbol,1}=[:standard],
lmax::Int=9,
mask=[false],
direction::Symbol=:z,
weighting::Symbol=:mass,
xrange::Array{<:Any,1}=[missing, missing],
yrange::Array{<:Any,1}=[missing, missing],
zrange::Array{<:Any,1}=[missing, missing],
center::Array{<:Any,1}=[0., 0., 0.],
range_unit::Symbol=:standard,
data_center::Array{<:Any,1}=[missing, missing, missing],
data_center_unit::Symbol=:standard,
ref_time::Real=dataobject.info.time,
verbose::Bool=verbose_mode)
return HydroMapsType
Arguments
Required:
dataobject: needs to be of type: "PartDataType"var(s): select a variable from the database or a predefined quantity (see field: info, function projection(), dataobject.data)
Predefined/Optional Keywords:
unit(s): return the variable in given unitslmax: create maps with coarser grid than provided by the maximum level of the loaded dataxrange: the range between [xmin, xmax] in units given by argumentrange_unitand relative to the givencenter; zero length for xmin=xmax=0. is converted to maximum possible lengthyrange: the range between [ymin, ymax] in units given by argumentrange_unitand relative to the givencenter; zero length for ymin=ymax=0. is converted to maximum possible lengthzrange: the range between [zmin, zmax] in units given by argumentrange_unitand relative to the givencenter; zero length for zmin=zmax=0. is converted to maximum possible lengthrange_unit: the units of the given ranges: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)center: in units given by argumentrange_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..weighting: select between:massweighting (default) and:volumeweightingdata_center: to calculate the data relative to the datacenter; in units given by argument `datacenterunit`; by default the argument datacenter = center ;data_center_unit: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)direction: select between: :x, :y, :zmask: needs to be of type MaskType which is a supertype of Array{Bool,1} or BitArray{1} with the length of the database (rows)ref_time: the age quantity relative to a given time (code_units); default relative to the loaded snapshot time
Defined Methods - function defined for different arguments
- projection( dataobject::PartDataType, var::Symbol; ...) # one given variable
- projection( dataobject::PartDataType, var::Symbol, unit::Symbol; ...) # one given variable with its unit
- projection( dataobject::PartDataType, vars::Array{Symbol,1}; ...) # several given variables -> array needed
- projection( dataobject::PartDataType, vars::Array{Symbol,1}, units::Array{Symbol,1}; ...) # several given variables and their corresponding units -> both arrays
- projection( dataobject::PartDataType, vars::Array{Symbol,1}, unit::Symbol; ...) # several given variables that have the same unit -> array for the variables and a single Symbol for the unit
Examples
...
Mera.remap — MethodRemap projected data of DataMapsType onto a coarser grid:
- select the level of the coarser grid
- select the weighting
- toggle verbose mode
remap(dataobject::DataMapsType, lmax::Real; weighting::Symbol=:volume, verbose::Bool=verbose_mode)
return DataMapsTypeArguments
Required:
dataobject: needs to be of type: "DataMapsType", e.g. created by the function projectionlmax: the level of the coarser grid to be created
Predefined/Optional Keywords:
weighting: choose between: :volume, :massverbose: print the dimensions/pixel size of the provided and created maps on screen; default: set by the variableverbose_mode
Mera.shellregion — FunctionCutout sub-regions of the data base of DataSetType
- select shape of a shell-region
- select size of a region (w/o intersecting cells)
- give the spatial center (with units) of the data relative to the full box
- relate the coordinates to a direction (x,y,z)
- inverse the selected region
shellregion(dataobject::DataSetType, shape::Symbol=:cylinder;
radius::Array{<:Real,1}=[0.,0.], # cylinder, sphere;
height::Real=0., # cylinder
direction::Symbol=:z, # cylinder
center::Array{<:Any,1}=[0., 0., 0.], # all
range_unit::Symbol=:standard, # all
cell::Bool=true, # hydro and gravity
inverse::Bool=false, # all
verbose::Bool=verbose_mode) # allArguments
Required:
dataobject: needs to be of type: "DataSetType"shape: select between region shapes: :cuboid, :cylinder/:disc, :sphere
Predefined/Optional Keywords:
For cylindrical shell-region, related to a given center:
radius: the inner and outer radius of the shell in units given by argumentrange_unitand relative to the givencenterheight: the hight above and below a plane [-height, height] in units given by argumentrange_unitand relative to the givencenterdirection: todo
For spherical shell-region, related to a given center:
radius: the inner and outer radius of the shell in units given by argumentrange_unitand relative to the givencenter
Keywords related to all region shapes
range_unit: the units of the given ranges: :standard (code units), :Mpc, :kpc, :pc, :mpc, :ly, :au , :km, :cm (of typye Symbol) ..etc. ; see for defined length-scales viewfields(info.scale)center: in units given by argumentrange_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..inverse: inverse the region selection = get the data outside of the regioncell: take intersecting cells of the region boarder into account (true) or only the cells-centers within the selected region (false)verbose: print timestamp, selected vars and ranges on screen; default: set by the variableverbose_mode
Mera.storageoverview — MethodPrint overview of the used storage per file type for a given timestep
function storageoverview(dataobject::InfoType, verbose::Bool=true)
function storageoverview(dataobject::InfoType; verbose::Bool=true)
return dictionary in bytesMera.timerfile — MethodGet a printout of the timerfile:
timerfile(object::InfoType)Mera.usedmemory — FunctionGet the memory that is used for an object in human-readable units
function usedmemory(object, verbose::Bool=true)
return value, unitMera.viewallfields — MethodGet a detailed overview of many fields from the MERA InfoType:
viewallfields(dataobject::InfoType)Mera.viewfields — MethodGet an overview of the fields from MERA composite types:
viewfields(object)Mera.viewmodule — MethodGet a list of all exported Mera types and functions:
function viewmodule(modulename::Module)Mera.wstat — MethodCalculate statistical values w/o weighting of any Array:
wstat(array::Array{<:Real,1}; weight::Array{<:Real,1}=[1.], mask::MaskType=[false])
WStatType(mean, median, std, skewness, kurtosis, min, max)Arguments
Required:
array: Array needs to be of type: "<:Real"
Optional Keywords:
weight: Array needs to be of type: "<:Real" (can be used w/o keyword)mask: needs to be of type MaskType which is a supertype of Array{Bool,1} or BitArray{1} with the length of the Array
Mera.createscales! — MethodCreate an object with predefined scale factors from code to pysical units
function createscales!(dataobject::InfoType)
return ScalesTypeMera.prep_cylindrical_shellranges — Methodcylindrical shell ranges convert given ranges + radius and print overview on screen used for shellregions...
Mera.prep_spherical_shellranges — Methodspherical shell ranges convert given ranges + radius and print overview on screen used for shellregions...
Mera.prepranges — Methodcuboid ranges convert given ranges and print overview on screen used for gethydro, getparticles, getgravity, getclumps..., subregions...
Mera.prepranges — Methodcylinder ranges (height != 0.), sphere ranges (height==0.) convert given ranges + radius and print overview on screen used for subregions...