FUNCTION smei_radial2theta, delta_r, thetax, tol=tol ;+ ; NAME: ; smei_radial2theta ; PURPOSE: ; Converts a radial offset Rccd-R0 to an angle thetay ; CATEGORY: ; camera ; CALLING SEQUENCE: ; thetay = smei_radial2theta(delta_r[, thetax, tol=tol]) ; INPUTS: ; delta_r array; type: float ; radial offsets in left-hand side of Eq. 3 ; in pixels ; OPTIONAL INPUT PARAMETERS: ; thetax scalar or array with structure type as 'delta_r'; ; type: same as 'delta_r'; default: 0.0 ; thetax value in right-hand side of Eq. 3 ; in degrees ; OUTPUTS: ; thetay array with same structure as 'delta_r'; type: same as 'delta_r' ; thetay value that satisfies Eq. 3 for specified ; radial offset and thetax in degrees. ; INCLUDE: @compile_opt.pro ; On error, return to caller ; EXTERNAL: ; smei_theta2radial ; CALLS: ; InitVar, SuperArray, SubArray, nrZbrac, nrZBrent ; PROCEDURE: ; See Andy's memo "Defining the field of view for the SMEI cameras" (11-July-2001) ; This function inverts Equation 3. ; MODIFICATION HISTORY: ; FEB-2003, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ;- InitVar, thetax, 0.0 InitVar, tol, 1.0e-3 ; delta_r may get fed in as an array[1,*] if it is a part of a bigger ; array containing all vector components e.g. array[2,*] ; Get rid of the leading dummy dimension here. IF size(delta_r, /n_dim) EQ 0 THEN tmp = delta_r ELSE tmp = reform(delta_r) tx = SuperArray(tmp, 2, /lead) tx = SubArray(tx, element=0, replace=thetax) ; The first estimate of the zero point is the lowest order solution ; (it may be possible to improve on this by including one more higher order term, ; but it probably won't make any difference). tmp = -tmp/18.0226 ; Set up the initial range of values close to the zero. ty1 = tmp-(1/18.0226)/2 ty2 = tmp+(1/18.0226)/2 ; The above range does not necessarily bracket the zero. ; Expand the range outward until it does. tmp = nrZbrac('smei_theta2radial', ty1, ty2, arg=tx) ; The range ty1, ty2 should now bracket the zero. Warnings are displayed by ; nrZBrent if it doesn't. thetay = nrZBrent('smei_theta2radial', ty1, ty2, tol, arg=tx) RETURN, thetay & END