Output.jl
Luna.Output.GridCondition
— TypeCondition callable that distributes save points evenly on a grid
Luna.Output.HDF5Output
— TypeInternal constructor - creates the file
Luna.Output.HDF5Output
— TypeSimple constructor
Luna.Output.HDF5Output
— TypeOutput handler for writing to an HDF5 file
Luna.Output.HDF5Output
— MethodCalling the output handler writes data to the file Arguments: y: current function value t: current propagation point dt: current stepsize yfun: callable which returns interpolated function value at different t Note that from RK45.jl, this will be called with yn and tn as arguments.
Luna.Output.HDF5Output
— MethodCalling the output on a dictionary writes the items to the file
Luna.Output.HDF5Output
— MethodCalling the output on a key, value pair writes the value to the file
Luna.Output.MemoryOutput
— TypeOutput handler for writing only to memory
Luna.Output.MemoryOutput
— MethodCalling the output handler saves data in the arrays Arguments: y: current function value t: current propagation point dt: current stepsize yfun: callable which returns interpolated function value at different t Note that from RK45.jl, this will be called with yn and tn as arguments.
Luna.Output.MemoryOutput
— MethodCalling the output with a key, value pair writes the value to the array.
Luna.Output.MemoryOutput
— MethodCalling the output on a dictionary writes the items to the array
Base.getindex
— Methodgetindex works interchangeably so when switching from one Output to another, subsequent code can stay the same
Luna.Output.ScanHDF5Output
— MethodScanHDF5Output(scan, scanidx, args...; fname=nothing, fdir=nothing, kwargs...)
Create an HDF5Output
for the given scan
at the current scanidx
and automatically save the scan arrays and current values of the scan variables in the file. If given, fdir
is used as a directory in which to store the scan output. fname
can be used to manually name files. The running scan index will be appended to fname
for each file.
Luna.Output.always
— MethodCondition which saves every native point of the propagation
Luna.Output.check_cache
— Methodcheck_cache(o::HDF5Output, y, t, dt)
Check for an existing cached propagation in the output o
and return this cache if present.
Luna.Output.every_nth
— MethodCondition which saves every nth native point
Luna.Output.init_dims
— MethodFor other conditions, we do not know in advance.
Luna.Output.init_dims
— MethodMaking initial array dimensions. For a GridCondition, we know in advance how many points there will be.
Luna.Output.scansave
— Methodscansave(scan, scanidx; grid, stats, fpath, script, kwargs...)
While running the given scan
, save the variables given as keyword arguments into the scan grid as determined from the variables of the scan
. Special keyword arguments are:
grid::AbstractGrid
: Save the simulation grid in a dictionary (but only once)stats
: The statistics dictionary from a simulation is saved in scan grid andNaN
-padded to account for variable lengths in the output arraysfpath
: Path to the file. Defaults to the scan name plus "_collected"script
: Path to the Julia scrpt file running the scan. Can be grabbed automatically using the macro@scansave
.
Another keyword argument lock_stale_age
sets the time in seconds after which the function ignores the lock on the file and writes to it anyway. Defaults to 300 s (5 min). (Note that if the PID of the locking process appears valid, this is automatically increased 25x.)
Luna.Output.scansave_stats_array
— Methodscansave_stats_array(stats_dict)
Convert the statistics dictionary created by scansave
into a dictionary containing arrays of arrays. This removes unused elements in the arrays and the need to use valid_length
to avoid including NaN
s.
Luna.Output.@ScanHDF5Output
— Macro@ScanHDF5Output(scan, scanidx, args...)
Create an HDF5Output
for the given scan
at the current scanidx
and automatically save the running script, scan arrays, and current values of the scan variables in the file. All arguments, including keyword arguments, after scanidx
are identical to HDF5Output
.
Luna.Output.@scansave
— Macro@scansave(scan, scanidx; kwargs...)
Like scansave
but also saves the script being run automatically.