[aspect-devel] read parameter file with Python
Marine Lasbleis
marine.lasbleis at elsi.jp
Wed Mar 7 14:54:25 PST 2018
Hi all,
I decided to use whatever outputs already existed, and wrote a simple function in python to read the parameter file in the output directory.
If you’re interested, I've put the couple of functions I’m using on Github (so far, something to read statistics and plot the columns I’m interested, and the function to read parameters). Reading a text file in Python is a mess (there are so many different functions/packages that can do that, all with a slightly different approach.), so let me know if you can think of better way to do it!
https://github.com/MarineLasbleis/python_routines_ASPECT <https://github.com/MarineLasbleis/python_routines_ASPECT>
Marine Lasbleis
=====
ELSI Research Scientist
Earth Life Science Institute
Tokyo Institute of Technology
Tokyo, Japan
+81 70 1572 5070
marine.lasbleis at elsi.jp <mailto:marine.lasbleis at elsi.jp>
https://members.elsi.jp/~marine.lasbleis/ <https://members.elsi.jp/~marine.lasbleis/>
http://elsi.jp/en/ <http://elsi.jp/en/>
> On 23 Feb 2018, at 09:45, Wolfgang Bangerth <bangerth at colostate.edu> wrote:
>
> On 02/21/2018 03:12 PM, Marine Lasbleis wrote:
>> Thanks for the info!
>> A JSON file would definitely do it.
>> I’ll have a look how to output it.
>
> The latex file is output here:
> https://github.com/geodynamics/aspect/blob/master/source/simulator/core.cc#L646
>
> You could just output the same content in JSON format immediately after this into a separate file.
>
> The function you want to call is ParameterHandler::print_parameters(), see
> https://www.dealii.org/developer/doxygen/deal.II/classParameterHandler.html#a3dfbd280d718ee792f62a7081185ac02
>
> The OutputStyle options are defined if you click on the second argument of that function.
>
> Best
> W.
>
>
> --
> ------------------------------------------------------------------------
> Wolfgang Bangerth email: bangerth at colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>
> _______________________________________________
> Aspect-devel mailing list
> Aspect-devel at geodynamics.org
> http://lists.geodynamics.org/cgi-bin/mailman/listinfo/aspect-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geodynamics.org/pipermail/aspect-devel/attachments/20180308/3442103a/attachment.html>
More information about the Aspect-devel
mailing list