Pcraster - python - reading stack of maps
<p>I have a stack of maps as follows:</p>

<p><a href="http://i.stack.imgur.com/P9a5U.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/P9a5U.jpg" alt="list of .map files"></a></p>

<p>They are the outputs of every 720 timesteps of a certain dynamic model
I would like to import / read those maps as input of other dynamic models.</p>

<p>What should I do?</p>

<p>(I've tried timeiput but I don't get how to use it correctly).</p>

<p>If the stack of maps is in a particular directory, you can use <code>os.path</code> and read all files in that directory.</p>

<pre><code>from os import listdir
from os.path import isfile, join
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
</code></pre>

<p><code>onlyfiles</code> is a list of files in that directory.</p>

<p>Since the names follow a complex pattern(of difference of 720 in the ending). I think this is best way to go through all files.</p>

python