com1DFA.com1DFA.readFields

readFields(inDir, resType, simName='', flagAvaDir=True, comModule='com1DFA', timeStep='', atol=1e-06)[source]

Read ascii files within a directory and return List of dictionaries

Parameters
  • inDir (str) – path to input directory

  • resType (list) – list of desired result types, if string converted to list

  • simName (str) – simulation name

  • flagAvaDir (bool) – if True inDir corresponds to an avalanche directory and pickles are read from avaDir/Outputs/com1DFA/particles

  • comModule (str) – module that computed the particles

  • timeStep (float or list of floats) – desired time step if difference to time step of field file is smaller than atol field is found - optional

  • atol (float) – look for matching time steps with atol tolerance - default is atol=1.e-6

Returns

  • fieldsList (list) – list of fields dictionaries

  • fieldHeader (dict) – raster header corresponding to first element in fieldsList

  • timeList (list) – tme corresponding to elements in fieldsList