Sig1 Differential from two .sav files

Hi Community,

Anybody can help with how to show the differential of sig1 (value stored in Extra) from the stress state of a previous .sav file to another .sav file using FISH (say delta(sig1) from sequence 1 to sequence 2).

I tried saving sig1 values from the previous sav file in an array, but then when I move to the next .sav file, the array is emptied out.

Thanks,

You could use python to loop through all of your .sav files and extract whatever you need. Something like the below might help to achieve what you’re after?

#---------------------
# import libraries
#---------------------

import itasca as it
it.command('python-reset-state false')
import json
import os


#---------------------
# create blank dictionary to store data
#---------------------

dict = {}


#---------------------
# loop through all .sav files in directory & carry out ....
#---------------------

for filename in os.listdir(os.getcwd()):
    if ".sav" not in filename:
        continue
    
	#restore saved state
    it.command("""
model restore "{}"
""".format(filename))
        
	'''
	carry out whatever process needed to extract your data
	e.g. 
	x = extra	
	'''

    #write output for that file to dictionary            
    dict[filename] = x


#---------------------
# create output file and dump dict to output file
#---------------------

output_file = ("outputs.json")
with open(output_file, 'w') as fout:
    json.dump(dict, fout)

It worked perfectly.
Thanks James !

1 Like