; docformat = 'rst' ;+ ; This defines a sofie_fov (field of view) object. ; ; :Author: ; Chris Jeppesen, Bill Barrett ; ; :Examples: ; elements[i]=obj_new("sofie_fov", scpos(t,/ecef), sunvec(t,/ecef)) ;- function sofie_fov::init, r0, v v/=norm(v) self.r0=r0 self.v=v self.t=-dotp(v,r0) self.xyz=r0+v*self.t self.lla=xyz_to_lla(self.xyz) ;Sofie FOV parameters SofieHHfov = !dpi / 3600d SofieHVfov = SofieHHfov / 3 ;Calculate the four planes' normals right=crossp_grid(v,r0) right/=norm(right) up=crossp_grid(right,v) up/=norm(up) ;Now v,up,right are basis vectors properly oriented. Make ;normal vectors using appropriate linear combination ;of the basis vectors v_sin_SofieHVfov = v*sin(SofieHVfov) up_cos_SofieHVfov = up*cos(SofieHVfov) Nt= up_cos_SofieHVfov-v_sin_SofieHVfov Nb= - up_cos_SofieHVfov-v_sin_SofieHVfov v_sin_SofieHHfov = v*sin(SofieHHfov) right_cos_SofieHHfov = right*cos(SofieHHfov) Nr= right_cos_SofieHHfov-v_sin_SofieHHfov Nl= -right_cos_SofieHHfov-v_sin_SofieHHfov ;Create planes with the appropriate normals which pass ;through the spacecraft location pt=obj_new("plane",Nt,r0) pb=obj_new("plane",Nb,r0) pr=obj_new("plane",Nr,r0) pl=obj_new("plane",Nl,r0) ; Common volume size is set here elements=[pt,pb,pr,pl, $ obj_new("plane", v,410), $ obj_new("plane",-v,410) $ ]; ; init superclass saying that this is the intersection of the child objects is_intersection = 0 status = self->csg::init(elements, is_intersection) return, status end ; -------------------------------------------------------------------------- ; Object Data Structure Definition ; -------------------------------------------------------------------------- ; PURPOSE: ; Define the data structure associated with this object. pro sofie_fov__define self = {sofie_fov, inherits csg, r0:[0d,0,0],v:[0d,0,0],t:0d,xyz:[0d,0,0],lla:[0d,0,0]} end