Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
marinerhemant committed Sep 1, 2024
1 parent efc6ab7 commit 6a4b6cc
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions FF_HEDM/v7/pf_MIDAS.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,20 @@ def parallel_peaks(layerNr,positions,startNrFirstLayer,nrFilesPerSweep,topdir,pa
omegaOffsetThis = -delOmega # Because we subtract this
print(f"Offsetting omega: {omegaOffsetThis}, original value: {thisOmega}.")
tOme = time.time()
shutil.copy2(f'Result_StartNr_{startNr}_EndNr_{endNr}.csv',f'Result_StartNr_{startNr}_EndNr_{endNr}.csv.old') # Must use the new file that we just generated.
shutil.copy2(f'Result_StartNr_{startNr}_EndNr_{endNr}.csv',f'Result_StartNr_{startNr}_EndNr_{endNr}.csv.old')
Result = np.genfromtxt(f'Result_StartNr_{startNr}_EndNr_{endNr}.csv',skip_header=1,delimiter=' ')
if len(Result.shape) > 1:
headRes = open(f'Result_StartNr_{startNr}_EndNr_{endNr}.csv').readline()
Result = Result[Result[:,5] > minThresh]
Result[:,2] -= omegaOffsetThis
Result[Result[:,2]<-180,6] += 360
Result[Result[:,2]<-180,7] += 360
Result[Result[:,2]<-180,2] += 360
Result[Result[:,2]> 180,6] -= 360
Result[Result[:,2]> 180,7] -= 360
Result[Result[:,2]> 180,2] -= 360
np.savetxt(f'Result_StartNr_{startNr}_EndNr_{endNr}.csv',Result,fmt="%.6f",delimiter=' ',header=headRes.split('\n')[0],comments='')
if len(Result.shape) > 1:
Result[:,2] -= omegaOffsetThis
Result[Result[:,2]<-180,6] += 360
Result[Result[:,2]<-180,7] += 360
Result[Result[:,2]<-180,2] += 360
Result[Result[:,2]> 180,6] -= 360
Result[Result[:,2]> 180,7] -= 360
Result[Result[:,2]> 180,2] -= 360
np.savetxt(f'Result_StartNr_{startNr}_EndNr_{endNr}.csv',Result,fmt="%.6f",delimiter=' ',header=headRes.split('\n')[0],comments='')
print(f"Omega offset done. Time taken: {time.time()-tOme} seconds.")
subprocess.call(os.path.expanduser("~/opt/MIDAS/FF_HEDM/bin/CalcRadiusAllZarr")+f' {outFStem} {thisDir}',env=env,shell=True,stdout=f,stderr=f_err)
subprocess.call(os.path.expanduser("~/opt/MIDAS/FF_HEDM/bin/FitSetupZarr")+f' {outFStem} {thisDir}',env=env,shell=True,stdout=f,stderr=f_err)
Expand Down

0 comments on commit 6a4b6cc

Please sign in to comment.