[yt-users] Obtaining the current Enzo timestep from yt

Sam Skillman samskillman at gmail.com
Mon Dec 2 15:43:19 PST 2013


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 at 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 <matthewturk at gmail.com> wrote:
>
>> Hi Roberto,
>>
>> On Mon, Dec 2, 2013 at 6:10 PM, trobolo dinni
>> <trobolo.trobolo.dinni5 at gmail.com> 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 at lists.spacepope.org
>> > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> >
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20131202/2a1acada/attachment.htm>


More information about the yt-users mailing list