FUNCTION smei_orbit_set, number, fraction ;+ ; NAME: ; smei_orbit_set ; PURPOSE: ; Creates structure for manipulating SMEI orbit numbers ; CATEGORY: ; camera/gen/idl/toolbox ; CALLING SEQUENCE: ; rtn = smei_orbit_set(number, [fraction]) ; INPUTS: ; number scalar or array; any numerical type ; fraction scalar or array; any numerical type ; number and fraction are added together ; and put in the structure ; OUTPUTS: ; rtn array; type: orbit structure ; rtn.number is integer orbit number ; rtn.fraction is double precision orbital fraction ; with 0 <= fraction < 1 ; INCLUDE: @compile_opt.pro ; On error, return to caller ; CALLS: ; IsType ; PROCEDURE: ; MODIFICATION HISTORY: ; JAN-2006, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- n = floor(number) f = number-n IF IsType(fraction,/defined) THEN BEGIN nn = floor(fraction) ff = fraction-nn n += nn f += ff nn = floor(f) n += nn f -= nn ENDIF orb = {orbit_struct, number: 0L, fraction: 0d0} IF n_elements(n) NE 1 THEN orb = replicate(orb,size(n,/dim)) orb.number = n orb.fraction = f RETURN, orb & END