@@ -651,21 +651,27 @@ class StagyyData:
651651 directory containing the par file, or the path of the par file. If
652652 the path given is a directory, the path of the par file is assumed
653653 to be path/par.
654+ read_parameters_dat: read `parameters.dat` file produced by StagYY. This
655+ flag can be switched off to ignore this file. This is intended for
656+ runs of StagYY that predate version 1.2.6 for which the
657+ `parameters.dat` file contained some values affected by internal
658+ logic.
654659
655660 Attributes:
656661 steps (Steps): collection of time steps.
657662 snaps (Snaps): collection of snapshots.
658663 refstate (Refstate): reference state profiles.
659664 """
660665
661- def __init__ (self , path : PathLike ):
666+ def __init__ (self , path : PathLike , read_parameters_dat : bool = True ):
662667 self ._parpath = Path (path )
663668 if not self ._parpath .is_file ():
664669 self ._parpath /= "par"
665670 self .refstate = Refstate (self )
666671 self .tseries = Tseries (self )
667672 self .steps = Steps (self )
668673 self .snaps = Snaps (self )
674+ self ._read_parameters_dat = read_parameters_dat
669675 self ._nfields_max : Optional [int ] = 50
670676 # list of (istep, field_name) in memory
671677 self ._collected_fields : list [tuple [int , str ]] = []
@@ -723,7 +729,7 @@ def _traxmf(self) -> TracersXmf:
723729 @cached_property
724730 def par (self ) -> StagyyPar :
725731 """Content of par file."""
726- return StagyyPar .from_main_par (self .parpath )
732+ return StagyyPar .from_main_par (self .parpath , self . _read_parameters_dat )
727733
728734 @cached_property
729735 def _rprof_and_times (self ) -> tuple [dict [int , DataFrame ], Optional [DataFrame ]]:
0 commit comments