; docformat = 'rst' ;+ ; This defines a common volume object. ; ; :Author: ; Chris Jeppesen, Bill Barrett ; ; :Examples: ; common_volume_data = OBJ_NEW('common_volume', 20, 20, 0.0D6, self.alt) ;- function common_volume::init, start_time, stop_time, time_interval_length, altitude, print_pov=print_pov ; Break the time span into a series of equally spaced lengths and ; calculate the sofie field of view data for each intermediate time. elements=objarr(floor((stop_time-start_time)/time_interval_length) + 1) t=start_time for i = 0, n_elements(elements) - 1 do begin elements[i]=obj_new("sofie_fov", scpos(t,/ecef), sunvec(t,/ecef)) t+=time_interval_length endfor ; init superclass saying that this is a union of the child objects is_union = 1 status = self->csg::init(elements, is_union) ; same default altitude as geolocation server self.alt = n_elements(altitude) eq 0 ? 83 : altitude ;Debugging - Print out spacecraft pos, sun vector, CV center, and ;POV code for common volume if(keyword_set(print_pov)) then begin ; sofie_time_for_alt ignores the fourth argument tcenter=sofie_time_for_alt(start_time, stop_time, self.alt, !NULL) r0=scpos(tcenter,/ecef) sun0=sunvec(tcenter,/ecef) junk=near_sph_line(r0,sun0,xyz=cvcenter,/neg_dist_ok) print,string(r0[[0,2,1]],format='(%"#declare scpos=<%18.6f,%18.6f,%18.6f>;")') print,string(sun0[[0,2,1]],format='(%"#declare sunvec=<%18.6f,%18.6f,%18.6f>;")') print,string(cvcenter[[0,2,1]],format='(%"#declare cvcenter=<%18.6f,%18.6f,%18.6f>;")') print,self->to_pov() end return, status end ; -------------------------------------------------------------------------- ; Object Data Structure Definition ; -------------------------------------------------------------------------- ; PURPOSE: ; Define the data structure associated with this object. pro common_volume__define self = {common_volume, inherits csg, alt:0d} end