Skip to main content

I need get the coherent irradiance from the detector viewer to see a laser behaviors inside of a glass.  The code i used is based on the python example code as:

Detector3D=np.zeros((100,100,100))

 for i in range(1,101):
    D_num=11+i
    d_test= TheSystem.Analyses.New_Analysis(constants.AnalysisIDM_DetectorViewer)
    d_set = d_test.GetSettings()
    setting = CastTo(d_set, 'IAS_DetectorViewer')
    setting.Detector.SetDetectorNumber(D_num)
    setting.ShowAs = constants.DetectorViewerShowAsTypes_FalseColor
    d_test.ApplyAndWaitForCompletion()
    d_test_results = d_test.GetResults()
    results = CastTo(d_test_results, 'IAR_')
    d_test_values = results.GetDataGrid(0).Values
    Detector3De:]b:]/i-1]=np.flipud(np.array(d_test_values))

    d_test.close()

 

unfortunately, this code only give me the incoherent irradiance. My question is how can i set the “show data type” to “ coherent irradiance” or coherent phase” in python code?

 

It works after add “setting.DataType = constants.DetectorViewerShowDataTypes_CoherentIrradiance” as:

    Detector3D=np.zeros((100,100,100))

    for ii in range(1,101):
        D_num=11+ii
        d_test= TheSystem.Analyses.New_Analysis(constants.AnalysisIDM_DetectorViewer)
        d_set = d_test.GetSettings()
        setting = CastTo(d_set, 'IAS_DetectorViewer')
        setting.Detector.SetDetectorNumber(D_num)
        setting.ShowAs = constants.DetectorViewerShowAsTypes_FalseColor
        setting.DataType = constants.DetectorViewerShowDataTypes_CoherentIrradiance
        d_test.ApplyAndWaitForCompletion()
        d_test_results = d_test.GetResults()
        results = CastTo(d_test_results, 'IAR_')
        d_test_values = results.GetDataGrid(0).Values
        Detector3De:]l:].i-1]=np.flipud(np.array(d_test_values))
        d_test.Close()

 


Reply