#### Read mean file
#================================================================
var = ut.read_FF(pwd, args.MeanFile[:-3])


#================================================================
#### Construct instance of ffClass
#================================================================
meanff = ffClass.FlowField(ff, var['ff'], "pp")


#================================================================
#### Calculate the difference
#================================================================

delta = ut.calculate_Difference(ff.velocityField, meanff.velocityField) # ff1 - ff2


#================================================================
# Construct instance of ffClass
#================================================================
delta = ffClass.FlowField(ff, delta, "pp")


#================================================================
#### Save ASC, GEOM, FF
#================================================================
fileName = args.File[:-3] + "_flucs"
ut.write_ASC(delta, pwd, fileName)
ut.write_GEOM(delta, pwd, fileName)
ut.write_FF(pwd, fileName)
import FlowField as ffClass
parser = argparse.ArgumentParser(description="Calculate difference between two fields and output field in HDF5 format")
parser.add_argument("-f1", "--File1", help="File 1",
                    metavar='\b', required=True)
parser.add_argument("-f2", "--File2", help="File 1",
                    metavar='\b', required=True)
args = parser.parse_args()
#===================================================================#
#### Read the HDF5 and details file                              ####
#===================================================================#
file1_info, original_attrs1 = ut.read_H5(args.File1)
file2_info, original_attrs2 = ut.read_H5(args.File2)
#===================================================================#
#### Calculate difference                                        ####
#===================================================================#
difference = ut.calculate_Difference(file1_info['ff'], file2_info['ff'])
#===================================================================#
#### Declare flow field object                                   ####
#===================================================================#
ff_diff = ffClass.FlowFieldChannelFlow( file1_info['Nd'],
                                        file1_info['Nx'],
                                        file1_info['Ny'],
                                        file1_info['Nz'],
                                        file1_info['Lx'],
                                        file1_info['Lz'],
                                        file1_info['alpha'],
                                        file1_info['beta'],
                                        0.0,
                                        "lam",
                                        0.0,
                                        difference,