def wsSecondary(rays,r0,z0,psi): """Trace a W-S secondary surface Fortran function computes Chase parameters for an equivalent W-I betas, f, g, and k computed from alpha and z0 """ opd,x,y,z,l,m,n,ux,uy,uz = rays a,p,d,e = con.woltparam(r0,z0) wolt.wssecondary(x,y,z,l,m,n,ux,uy,uz,a,z0,psi) return
def wsSecondaryB(rays,r0,z0,psi,thick,check=False): """Trace a W-S secondary surface Fortran function computes Chase parameters for an equivalent W-I betas, f, g, and k computed from alpha and z0 If check is True, function will check for rays that fail to converge to surface """ opd,x,y,z,l,m,n,ux,uy,uz = rays a,p,d,e = con.woltparam(r0,z0) if check is True: x0,y0,z0 = np.copy([x,y,z,]) wolt.wssecondaryback(x,y,z,l,m,n,ux,uy,uz,a,z0,psi,thick) if check is True: fail = np.logical_and(x0==x,\ np.logical_and(y0==y,z0==z)) return fail return
def woltersinetan(rays,r0,z0,amp,freq): """Wrapper for Wolter sinusoidal surface - place at surface tangent point +z is surface normal +y is toward sky +x is azimuthal direction """ opd,x,y,z,l,m,n,ux,uy,uz = rays #Compute Wolter parameters alpha,p,d,e = con.woltparam(r0,z0) transform(0,0,0,-np.pi/2-alpha,0,0) #Go to Wolter focus minus gap and half mirror length transform(0,con.primrad(z0+75.,r0,z0),-z0-75.,0,0,0) #Place Wolter surface woltersine(r0,z0,amp,freq) #Go back to original coordinate system transform(0,-con.primrad(z0+75.,r0,z0),z0+75.,0,0,0) transform(0,0,0,np.pi/2+alpha,0,0) return