Types

Abstract type hierarchies

DataSetType hierarchy

  • HydroMapsType <: DataMapsType
  • PartMapsType <: DataMapsType

List of types

Functions

Documentation Types

Mera.ClumpDataTypeType

Mutable Struct: Contains clump data and information about the selected simulation

ClumpDataType <: ContainMassDataSetType

source
Mera.DataMapsTypeType

Abstract Supertype of all the different dataset type maps HydroMapsType <: DataMapsType PartMapsType <: DataMapsType

source
Mera.DataSetTypeType

Abstract Supertype of all the different dataset types

HydroPartType <: ContainMassDataSetType <: DataSetType

source
Mera.Histogram2DMapTypeType

Mutable Struct: Contains the 2D histogram returned by the function: histogram2 and information about the selected simulation

source
Mera.HydroDataTypeType

Mutable Struct: Contains hydro data and information about the selected simulation

HydroDataType <: HydroPartType

source
Mera.HydroMapsTypeType

Mutable Struct: Contains the maps/units returned by the hydro-projection information about the selected simulation

source
Mera.HydroPartTypeType

Abstract Supertype of data-sets that contain hydro and particle data

HydroPartType <: ContainMassDataSetType <: DataSetType

source
Mera.InfoTypeType

Mutable Struct: Collected information about the selected simulation output

source
Mera.PartDataTypeType

Mutable Struct: Contains particle data and information about the selected simulation

PartDataType <: HydroPartType

source
Mera.PartMapsTypeType

Mutable Struct: Contains the maps/units returned by the particles-projection information about the selected simulation

source
Mera.ScalesTypeType

Mutable Struct: Contains the created scale factors from code to physical units

source

Documentation Functions

Mera.amroverviewMethod

Get 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 table
source
Mera.amroverviewMethod

Get 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 table
source
Mera.average_velocityMethod

Calculate 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), :no
  • 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)
source
Mera.bulk_velocityMethod

Calculate 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), :no
  • 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)
source
Mera.center_of_massMethod

Calculate 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)
source
Mera.center_of_massMethod

Calculate 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)
source
Mera.checkoutputsFunction

Get the existing simulation snapshots in a given folder

  • returns field outputs with Array{Int,1} containing the output-numbers of the existing simulations
  • returns field miss with Array{Int,1} containing the output-numbers of empty simulation folders
  • returns field path as String
checkoutputs(path::String="./")
return CheckOutputNumberType

Examples

# 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");
source
Mera.comMethod

Calculate 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)
source
Mera.comMethod

Calculate 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)
source
Mera.construct_datatypeMethod

Create 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 ClumpDataType

Example

# 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)
source
Mera.createpathMethod

```julia createpath(output::Real, path::String; namelist::String="")

return FileNamesType ```

source
Mera.dataoverviewMethod

Get the extrema of each variable in the database

function dataoverview(dataobject::ClumpDataType)
return a JuliaDB table
source
Mera.dataoverviewMethod

Get 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 table
source
Mera.dataoverviewMethod

Get 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 table
source
Mera.getclumpsMethod

Read 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 argument range_unit and relative to the given center; zero length for xmin=xmax=0. is converted to maximum possible length
  • yrange: the range between [ymin, ymax] in units given by argument range_unit and relative to the given center; zero length for ymin=ymax=0. is converted to maximum possible length
  • zrange: the range between [zmin, zmax] in units given by argument range_unit and relative to the given center; zero length for zmin=zmax=0. is converted to maximum possible length
  • 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 argument range_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 CPU
  • verbose: print timestamp, selected vars and ranges on screen; default: set by the variable verbose_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 ])
...
source
Mera.getextentMethod

Get 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 argument center_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: todo
  • unit: 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
source
Mera.gethydroMethod

Read 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 data
  • var(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 argument range_unit and relative to the given center; zero length for xmin=xmax=0. is converted to maximum possible length
  • yrange: the range between [ymin, ymax] in units given by argument range_unit and relative to the given center; zero length for ymin=ymax=0. is converted to maximum possible length
  • zrange: the range between [zmin, zmax] in units given by argument range_unit and relative to the given center; zero length for zmin=zmax=0. is converted to maximum possible length
  • 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 argument range_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 inactive
  • smallc: set lower limit for thermal pressure; zero means inactive
  • check_negvalues: check loaded data of "rho" and "p" on negative values; false by default
  • print_filenames: print on screen the current processed hydro file of each CPU
  • verbose: print timestamp, selected vars and ranges on screen; default: set by the variable verbose_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
...
source
Mera.getinfoMethod

Get the simulation overview from RAMSES info, descriptor and output header files

getinfo(; output::Real=1, path::String="", namelist::String="", verbose::Bool=verbose_mode)
return InfoType

Keyword Arguments

  • output: timestep number (default=1)
  • path: the path to the output folder relative to the current folder or absolute path
  • namelist: 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 variable verbose_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)
source
Mera.getmassMethod

Get mass-array from the dataset (cells/particles/clumps/...):

getmass(dataobject::HydroDataType)
getmass(dataobject::PartDataType)
getmass(dataobject::ClumpDataType)

return Array{Float64,1}
source
Mera.getparticlesMethod

Read 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 defined
  • stars: not defined
  • var(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 argument range_unit and relative to the given center; zero length for xmin=xmax=0. is converted to maximum possible length
  • yrange: the range between [ymin, ymax] in units given by argument range_unit and relative to the given center; zero length for ymin=ymax=0. is converted to maximum possible length
  • zrange: the range between [zmin, zmax] in units given by argument range_unit and relative to the given center; zero length for zmin=zmax=0. is converted to maximum possible length
  • 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 argument range_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 CPU
  • verbose: print timestamp, selected vars and ranges on screen; default: set by the variable verbose_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
...
source
Mera.getpositionsMethod

Get 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, z

Arguments

Required:

  • dataobject: needs to be of type: "DataSetType"

Predefined/Optional Keywords:

  • center: in unit given by argument center_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: todo
  • unit: return the variables in given unit
  • 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)

Defined Methods - function defined for different arguments

  • getpositions( dataobject::DataSetType; ...) # one given variable
  • getpositions( dataobject::DataSetType, unit::Symbol; ...) # one given variable with its unit
source
Mera.gettimeMethod

Get 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 time

Arguments 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 path
  • unit: 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
source
Mera.getvarMethod

Get 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 argument center_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: todo
  • unit(s): return the variable in given units
  • 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)
  • 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) ...

source
Mera.histogram2dMethod

2d 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 Histogram2DMapType

Arguments

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 data
  • yrange: the considered interval [ymin, ymax] in units of the given y-axis data
  • closed: bin intervals :left [a,b) or :right (a,b] closed
  • nbins: number of bins for x- and y-axis
  • weight: 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)), ....)
source
Mera.humanizeMethod

Convert 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_unit
source
Mera.msumMethod

Calculate the total mass of any ContainMassDataSetType:

msum(dataobject::ContainMassDataSetType; unit::Symbol=:standard, mask::MaskType=[false])

return 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) :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)
source
Mera.printtimeFunction

print a Mera timestamp on the screen if the global variable: verbose_mode == true

function printtime(text::String="", verbose::Bool=verbose_mode)
source
Mera.projectionMethod

Project 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 units
  • lmax: create maps with coarser grid than provided by the maximum level of the loaded data
  • xrange: the range between [xmin, xmax] in units given by argument range_unit and relative to the given center; zero length for xmin=xmax=0. is converted to maximum possible length
  • yrange: the range between [ymin, ymax] in units given by argument range_unit and relative to the given center; zero length for ymin=ymax=0. is converted to maximum possible length
  • zrange: the range between [zmin, zmax] in units given by argument range_unit and relative to the given center; zero length for zmin=zmax=0. is converted to maximum possible length
  • 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 argument range_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..
  • weighting: select between :mass weighting (default) and :volume weighting
  • data_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, :z
  • 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)

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

...

source
Mera.projectionMethod

Project 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 units
  • lmax: create maps with coarser grid than provided by the maximum level of the loaded data
  • xrange: the range between [xmin, xmax] in units given by argument range_unit and relative to the given center; zero length for xmin=xmax=0. is converted to maximum possible length
  • yrange: the range between [ymin, ymax] in units given by argument range_unit and relative to the given center; zero length for ymin=ymax=0. is converted to maximum possible length
  • zrange: the range between [zmin, zmax] in units given by argument range_unit and relative to the given center; zero length for zmin=zmax=0. is converted to maximum possible length
  • 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 argument range_unit; by default [0., 0., 0.]; the box-center can be selected by e.g. [:bc], [:boxcenter], [value, :bc, :bc], etc..
  • weighting: select between :mass weighting (default) and :volume weighting
  • data_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, :z
  • 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)
  • 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

...

source
Mera.remapMethod

Remap 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 DataMapsType

Arguments

Required:

  • dataobject: needs to be of type: "DataMapsType", e.g. created by the function projection
  • lmax: the level of the coarser grid to be created

Predefined/Optional Keywords:

  • weighting: choose between: :volume, :mass
  • verbose: print the dimensions/pixel size of the provided and created maps on screen; default: set by the variable verbose_mode
source
Mera.shellregionFunction

Cutout 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)             # all

Arguments

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 argument range_unit and relative to the given center
  • height: the hight above and below a plane [-height, height] in units given by argument range_unit and relative to the given center
  • direction: todo

For spherical shell-region, related to a given center:

  • radius: the inner and outer radius of the shell in units given by argument range_unit and relative to the given center

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 argument range_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 region
  • cell: 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 variable verbose_mode
source
Mera.storageoverviewMethod

Print 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 bytes
source
Mera.usedmemoryFunction

Get the memory that is used for an object in human-readable units

function usedmemory(object, verbose::Bool=true)
return value, unit
source
Mera.viewallfieldsMethod

Get a detailed overview of many fields from the MERA InfoType:

viewallfields(dataobject::InfoType)
source
Mera.viewfieldsMethod

Get an overview of the fields from MERA composite types:

viewfields(object)
source
Mera.viewmoduleMethod

Get a list of all exported Mera types and functions:

function viewmodule(modulename::Module)
source
Mera.wstatMethod

Calculate 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
source
Mera.createscales!Method

Create an object with predefined scale factors from code to pysical units

function createscales!(dataobject::InfoType)

return ScalesType
source
Mera.preprangesMethod

cuboid ranges convert given ranges and print overview on screen used for gethydro, getparticles, getgravity, getclumps..., subregions...

source
Mera.preprangesMethod

cylinder ranges (height != 0.), sphere ranges (height==0.) convert given ranges + radius and print overview on screen used for subregions...

source