> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Example 06: NSC Phase

Ex 6: A file with a simple spherical wavefront is created using a point source, which propagates to a detector. Rather than using a Detector Viewer to extract the phase of the wavefront, the GetAllCoherentDataSafe() method is used to extract a 2D array to manually calculate the phase. The GetAllCoherentDataSafe() method will only return the real & imaginary parts of the electric field, so atan2(image, real) is used to calculate the phase. Note that for C++, GetAllCoherentData() method is used to return a 1D array which is then read out in nested FOR loops and provides the 2D phase data in the correct orientation.

```csharp theme={null}
Input:      None

Output:     Graph (Matlab, Python)
            API\e06_nsc_phase.txt (C++, C#)
            API\e06_nsc_phase.zos
```

[C#](https://developer.synopsys.com/docs/zemax/zemax-opticstudio-zos-api/2025-r2-sp02/page_ex06_cs.md)

[C++](https://developer.synopsys.com/docs/zemax/zemax-opticstudio-zos-api/2025-r2-sp02/page_ex06_cpp.md)

[Matlab](https://developer.synopsys.com/docs/zemax/zemax-opticstudio-zos-api/2025-r2-sp02/page_ex06_m.md)

[Python](https://developer.synopsys.com/docs/zemax/zemax-opticstudio-zos-api/2025-r2-sp02/page_ex06_py.md)
