Hi Roberto, Unfortunately the documentation for that parameter is incorrect. It is not the timestep for the current step, but rather the timestep for the *first* step. It is a way to limit the first timestep to be small, which is useful for some problem types. I'll open an issue for this incorrect documentation. If you are analyzing a series of outputs, it may be fairly straightforward to calculate the dt between them using a TimeSeries object ( http://yt-project.org/doc/analyzing/time_series_analysis.html) , but I don't know of a way to get this directly from any information that Enzo dumps out -- same goes for yt's ability to read it in. Sam On Mon, Dec 2, 2013 at 4:14 PM, trobolo dinni < trobolo.trobolo.dinni5@gmail.com> wrote:
Hi Sam,
referring to the Enzo documentation:
InitialTime (internal) The time, in code units, of the current step. For cosmology the units are in free-fall times at the initial epoch (see *Enzo Output Formats*http://enzo.readthedocs.org/en/latest/user_guide/EnzoOutputFormat.html#enzoo...). Default: generally 0, depending on problem Initialdt (internal) The timestep, in code units, for the current step. For cosmology the units are in free-fall times at the initial epoch (see *Enzo Output Formats*http://enzo.readthedocs.org/en/latest/user_guide/EnzoOutputFormat.html#enzoo...). Default: generally 0, depending on problem my understanding from this is that as Enzo does for the parameter InitialTime, also Initialdt should be saved in the parameters file and represents the TopGrid timestep computed by Enzo at each TopGrid cycle. So when during a run the console outputs for example: TopGrid dt = 7.815060e-05 time = 0.52042974743667 cycle = 7138
the time and cycle are actually saved in the parameter file (if an output is scheduled for that cycle), but dt is not, while I would expect that to be saved to. Am I right? dt is the thing I need because I would like to do some data analysis that requires the time step (iI need to analyse the evolution of some quantities over a cycle).
Thanks, Roberto
On 3 December 2013 10:43, Sam Skillman
wrote: Hi Roberto,
InitialTime is the current timestep in the simulation. It refers to the start time of the current timestep (as opposed to an intermediate time during the adaptive timestepping in Enzo). Initialdt is not written out to the output parameter files because it is only used for the very first step in the simulation.
A shortcut that currently exists is pf.current_time, which is the same as pf.parameters['InitialTime'].
I hope that helps, Sam
On Mon, Dec 2, 2013 at 3:36 PM, trobolo dinni < trobolo.trobolo.dinni5@gmail.com> wrote:
Hi Matt,
yes, I don't know why it is not there.
I tried with the pf.parameters function:
*In [456]: pf.parameters['Initialdt']*
*---------------------------------------------------------------------------* *KeyError Traceback (most recent call last)*
*/home/cthulhu/Repository/Python/yt scripts/5.primary_damping_analysis.py http://5.primary_damping_analysis.py in <module>()* *----> 1 * * 2 * * 3 * * 4 * * 5 *
*KeyError: 'Initialdt'*
*In [458]: pf.parameters['InitialTime']* *Out[458]: 0.52818454582493*
but since Initialdt is not there it is not able to find it.
Can I ask if is there a way to tell Enzo to write out the Initialdt or should be there by default?
Thanks, Roberto
On 3 December 2013 10:13, Matthew Turk
wrote: Hi Roberto,
On Mon, Dec 2, 2013 at 6:10 PM, trobolo dinni
wrote: Dear YT users,
I would like to ask a simple question to which I was not able to find a solution.
My Enzo parameters file does not have any Initialdt line saved, also if by reading the Enzo documentation at http://enzo.readthedocs.org/en/latest/parameters/initialization.htmllooks like the line should be there; and I would like to obtain the current timestep from the output using yt.
I would like to ask if is there a way to do that or if there is some alternative solution.
Thanks for the help, Roberto
Weird that it's not there! yt can get the cycle number if it's not. You can see this and other parameters by looking at pf.parameters . You can try using the "pprint" module to make it looks nice:
import pprint pprint.pprint(pf.parameters)
-Matt
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org