<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.uni-due.de/agk/index.php?action=history&amp;feed=atom&amp;title=Scale-dbl</id>
	<title>Scale-dbl - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.uni-due.de/agk/index.php?action=history&amp;feed=atom&amp;title=Scale-dbl"/>
	<link rel="alternate" type="text/html" href="https://wiki.uni-due.de/agk/index.php?title=Scale-dbl&amp;action=history"/>
	<updated>2026-05-31T03:55:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://wiki.uni-due.de/agk/index.php?title=Scale-dbl&amp;diff=347&amp;oldid=prev</id>
		<title>Lothar.brendel: doc link</title>
		<link rel="alternate" type="text/html" href="https://wiki.uni-due.de/agk/index.php?title=Scale-dbl&amp;diff=347&amp;oldid=prev"/>
		<updated>2024-05-07T11:11:37Z</updated>

		<summary type="html">&lt;p&gt;doc link&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:11, 7 May 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l28&quot;&gt;Line 28:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         line = line.split()&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         line = line.split()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         # nout t dt nstep single_file little var1 var2 ..&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         # nout t dt nstep single_file little var1 var2 ..&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        # cf. 12.1.1 in https://plutocode.ph.unito.it/userguide.pdf&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if line[5] != &amp;quot;little&amp;quot;:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         if line[5] != &amp;quot;little&amp;quot;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             exit(f&amp;quot;{me}: need doubles in little endian, quitting...&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             exit(f&amp;quot;{me}: need doubles in little endian, quitting...&amp;quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lothar.brendel</name></author>
	</entry>
	<entry>
		<id>https://wiki.uni-due.de/agk/index.php?title=Scale-dbl&amp;diff=340&amp;oldid=prev</id>
		<title>Lothar.brendel: usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.uni-due.de/agk/index.php?title=Scale-dbl&amp;diff=340&amp;oldid=prev"/>
		<updated>2024-05-07T06:36:11Z</updated>

		<summary type="html">&lt;p&gt;usage&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:36, 7 May 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A little Python tool to scale fields stored in PLUTO&amp;#039;s &amp;lt;code&amp;gt;dbl&amp;lt;/code&amp;gt;-files&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A little Python tool to scale fields stored in PLUTO&amp;#039;s &amp;lt;code&amp;gt;dbl&amp;lt;/code&amp;gt;-files&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;If you use it for creating new initial conditions for a &amp;lt;code&amp;gt;-restart&amp;lt;/code&amp;gt; (what else?), you have to run it in the source run-folder, then move the modified &amp;lt;code&amp;gt;dbl&amp;lt;/code&amp;gt;-file(s) (having a &amp;quot;scaled&amp;quot; in the file name) to the new run-folder and rename them to their standard form.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lothar.brendel</name></author>
	</entry>
	<entry>
		<id>https://wiki.uni-due.de/agk/index.php?title=Scale-dbl&amp;diff=338&amp;oldid=prev</id>
		<title>Lothar.brendel: check for n_out not found</title>
		<link rel="alternate" type="text/html" href="https://wiki.uni-due.de/agk/index.php?title=Scale-dbl&amp;diff=338&amp;oldid=prev"/>
		<updated>2024-05-07T05:46:32Z</updated>

		<summary type="html">&lt;p&gt;check for n_out not found&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:46, 7 May 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l42&quot;&gt;Line 42:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             single = line[4]==&amp;quot;single_file&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             single = line[4]==&amp;quot;single_file&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             break&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;             break&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    else:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        exit(f&quot;{me}: dbl-file number {out_nr} does not exist, quitting...&quot;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lothar.brendel</name></author>
	</entry>
	<entry>
		<id>https://wiki.uni-due.de/agk/index.php?title=Scale-dbl&amp;diff=334&amp;oldid=prev</id>
		<title>Lothar.brendel: new</title>
		<link rel="alternate" type="text/html" href="https://wiki.uni-due.de/agk/index.php?title=Scale-dbl&amp;diff=334&amp;oldid=prev"/>
		<updated>2024-05-06T20:23:18Z</updated>

		<summary type="html">&lt;p&gt;new&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A little Python tool to scale fields stored in PLUTO&amp;#039;s &amp;lt;code&amp;gt;dbl&amp;lt;/code&amp;gt;-files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3&lt;br /&gt;
#&lt;br /&gt;
# Scale the contents of a PLUTO&amp;#039;s dbl-file,&lt;br /&gt;
# must be run inside the data directory.&lt;br /&gt;
#&lt;br /&gt;
# L.B. 2024&lt;br /&gt;
&lt;br /&gt;
import os&lt;br /&gt;
from sys import exit,argv&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
me = os.path.basename(argv[0])&lt;br /&gt;
&lt;br /&gt;
if len(argv) &amp;lt; 4:&lt;br /&gt;
    exit(f&amp;quot;usage: {me} &amp;lt;n_out&amp;gt; &amp;lt;fact&amp;gt; &amp;lt;field_1&amp;gt; ...\nwith &amp;lt;n_out&amp;gt; being int, &amp;lt;fact&amp;gt; float and &amp;lt;fields&amp;gt; being strings&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
out_nr = int(argv[1])  # the number of the dbl-file&lt;br /&gt;
fact = float(argv[2])  # the multiplication factor&lt;br /&gt;
fields = argv[3:]      # fields as listed in &amp;#039;dbl.out&amp;#039;&lt;br /&gt;
&lt;br /&gt;
with open(&amp;quot;dbl.out&amp;quot;,&amp;quot;r&amp;quot;) as dbl_out:&lt;br /&gt;
    for line in dbl_out:&lt;br /&gt;
        line = line.split()&lt;br /&gt;
        # nout t dt nstep single_file little var1 var2 ..&lt;br /&gt;
        if line[5] != &amp;quot;little&amp;quot;:&lt;br /&gt;
            exit(f&amp;quot;{me}: need doubles in little endian, quitting...&amp;quot;)&lt;br /&gt;
        if int(line[0]) == out_nr:&lt;br /&gt;
            field_nrs = []&lt;br /&gt;
            fields_ok = []&lt;br /&gt;
            for field in fields:&lt;br /&gt;
                if field in line:&lt;br /&gt;
                    fields_ok.append(field)&lt;br /&gt;
                    field_nrs.append(line.index(field)-6)&lt;br /&gt;
                else:&lt;br /&gt;
                    print(f&amp;quot;{me}: field &amp;#039;{field}&amp;#039; not found&amp;quot;)&lt;br /&gt;
            if not field_nrs:&lt;br /&gt;
                exit(f&amp;quot;{me}: none of the fields found, quitting...&amp;quot;)&lt;br /&gt;
            fields = fields_ok&lt;br /&gt;
            single = line[4]==&amp;quot;single_file&amp;quot;&lt;br /&gt;
            break&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# get number of cells from file &amp;#039;grid.out&amp;#039;:&lt;br /&gt;
N = 1&lt;br /&gt;
with open(&amp;quot;grid.out&amp;quot;,&amp;quot;r&amp;quot;) as grid_out:&lt;br /&gt;
    for line in grid_out:&lt;br /&gt;
        if line[0] == &amp;quot;#&amp;quot;:  # information is in comment block&lt;br /&gt;
            line = line.split()&lt;br /&gt;
            if len(line)&amp;gt;1 and line[1][0]==&amp;quot;X&amp;quot;:&lt;br /&gt;
                N *= int(line[line.index(&amp;quot;point(s),&amp;quot;)-1])&lt;br /&gt;
        else:&lt;br /&gt;
            break&lt;br /&gt;
&lt;br /&gt;
if N == 1:&lt;br /&gt;
    exit(f&amp;quot;{me}: could not determine number of grid cells, quitting...&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# read, scale, write:&lt;br /&gt;
for file in ([&amp;quot;data&amp;quot;] if single else fields):&lt;br /&gt;
    dbl_fn = f&amp;quot;{file}.{out_nr:04}.dbl&amp;quot;&lt;br /&gt;
    print(f&amp;quot;{me}: reading &amp;#039;{dbl_fn}&amp;#039;&amp;quot;)&lt;br /&gt;
    with open(dbl_fn,&amp;quot;rb&amp;quot;) as dbl_in:&lt;br /&gt;
        data = np.fromfile(dbl_in,dtype=&amp;quot;&amp;lt;f8&amp;quot;).reshape((-1,N)) # N doubles for each field&lt;br /&gt;
&lt;br /&gt;
    dbl_fn = file&lt;br /&gt;
    if single:&lt;br /&gt;
        for f,field_nr in enumerate(field_nrs):&lt;br /&gt;
            print(f&amp;quot;{me}: multiplying {N} doubles of {fields[f]}-data by {fact}&amp;quot;)&lt;br /&gt;
            data[field_nr,:] *= fact&lt;br /&gt;
        dbl_fn += &amp;quot;_&amp;quot;+&amp;#039;+&amp;#039;.join(fields)&lt;br /&gt;
    else:&lt;br /&gt;
        print(f&amp;quot;{me}: multiplying {N} doubles by {fact}&amp;quot;)&lt;br /&gt;
        data[0,:] *= fact&lt;br /&gt;
&lt;br /&gt;
    dbl_fn += f&amp;quot;-scaled.{out_nr:04}.dbl&amp;quot;&lt;br /&gt;
    print(f&amp;quot;{me}: writing result into &amp;#039;{dbl_fn}&amp;#039;&amp;quot;)&lt;br /&gt;
    with open(dbl_fn,&amp;quot;wb&amp;quot;) as dbl_out:&lt;br /&gt;
        data.tofile(dbl_out)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lothar.brendel</name></author>
	</entry>
</feed>