;Given an ascending node time, find out everything about the orbit that starts at this node ; input ; t_a_node - Time of an ascending node, GPS microseconds. This time is assumed to be ; exactly at the node, and not verified ; return ; An orbit_info structure, with all elements except orbit_number valid and correct for this ; orbit function find_next_orbit,t_a_node result=get_orbit_info_structure() result.start_time=t_a_node t_d_node=find_next_node(t_a_node,which_node=which_node) ;If we somehow got an ascending node where we expect a descending node, whine if which_node gt 0 then t_d_node=find_next_node(t_d_node, which_node=which_node) if which_node gt 0 then message,"Didn't find a descending node where expected" t_next_a_node=find_next_node(t_d_node,which_node=which_node) ;If we somehow got a descending node where we expect an ascending node, whine if which_node lt 0 then message,"Didn't find an ascending node where expected" result.stop_time=t_next_a_node ;Now, find the terminator crossings result.n_term=rtbis(0,t_d_node-t_a_node,!dpi/2,"term_f",0.01,state=state,time_ofs=t_a_node)+t_a_node result.s_term=rtbis(0,t_next_a_node-t_d_node,!dpi/2,"term_f",0.01,state=state,time_ofs=t_d_node)+t_d_node ;And now for the sunrises result.sunrise=sofie_time_for_alt(result.n_term-20d*60d6,result.n_term, 0) result.rise150=sofie_time_for_alt(result.n_term-20d*60d6,result.n_term,150) result.sunset =sofie_time_for_alt(result.s_term,result.s_term+20d*60d6, 0) result.set150 =sofie_time_for_alt(result.s_term,result.s_term+20d*60d6,150) ;Get sun position for each observation t_rise83=sofie_time_for_alt(result.n_term-20*60d6,result.n_term,83) result.n_look=sunvec(t_rise83) t_set83= sofie_time_for_alt(result.s_term,result.s_term+20d*60d6,83) result.s_look=sunvec(t_set83) result.mission_day=fix(mission_day(result.start_time)) return,result end