import numpy as np
import sys
sys.path.append(r"C:\VLF-Python\VLFBatchEvaluation.py")
from VLFBatchEvaluation import*
path = r"C:\VLF-Python"
#############################################################
#default Value 
IndextobeFound = '1'
Search_Parameter='Stack #2 (Rectangular Grating) | Interface #1 (Rectangular Grating Interface) | Modulation Depth'     #default Search_Parameter Value of this program should be same as Search_Parameter of this program
Search_Parameter1='Stack #2 (Rectangular Grating) | Interface #1 (Rectangular Grating Interface) | Relative Slit Width' #default Search_Parameter1 Value of this program should be same as Search_Parameter1 of ParameterScan2D
Search_Parameter_array1=np.array((Search_Parameter,Search_Parameter1))
Set_default_Value_array=((0.00185,50))                                     # default Value while exporting Batch files from VirtualLab Fusion 
print(functionTest(path,IndextobeFound,Search_Parameter_array1,Set_default_Value_array))
####################################################################
IndextobeFound = '1'
Search_Parameter='Stack #2 (Rectangular Grating) | Interface #1 (Rectangular Grating Interface) | Modulation Depth'
Search_Parameter_array=np.array([Search_Parameter])

# define varying range
gratingDepthMax = 0.010 # given in millimeter by default
gratingDepthMin = 0.0001 # given in millimeter by default
stepNumber = 50
stepSize = (gratingDepthMax - gratingDepthMin) / (stepNumber - 1)
efficiencies = np.zeros(stepNumber)
gratingDepth_array = np.zeros(stepNumber)
print(efficiencies)
# loop for input variables
for i in range(stepNumber):
    #current value of variable
    gratingDepth = gratingDepthMin +  (i) * stepSize
    # call function
    print("Modulation depth", gratingDepth)
    Pass_Value=np.array([gratingDepth])
    print("Pass_Value", Pass_Value)
    print(len(Pass_Value))
    efficiencies=[functionTest(path,IndextobeFound,Search_Parameter_array,Pass_Value)]
