C+ C NAME: C XMAP_OBS_POS C PURPOSE: C Given the modified Carrington variable XSC of the spacecraft, calculate C the corresponding modified Carrington variable for an observed location C at heliographic longitude XLNG C CATEGORY: C Celestial mechanics C CALLING SEQUENCE: function XMAP_OBS_POS(XSC,XLNG) C INPUTS: C XSC real modified Carrington variable for spacecraft position C XLNG real heliographic longitude for point of observation C (degrees; 0 <= XLNG < 360) C OUTPUTS: C XMAP_OBS_POS C real modified Carrington variable for observation point C PROCEDURE: C The difference in heliographic longitude between spacecraft and C observed location is used to obtain the modified Carrington variable C for the observed location. C The difference in longitude is subject to the restriction: C If the observed point lies in the eastern hemisphere, 0 <= DXLNG < -180; C If it lies in the western hemisphere 0 <= DXLNG < 180. C Then XOBS = XSC-DXLNG/360. C MODIFICATION HISTORY: C JAN-1992, Paul Hick (UCSD/CASS; pphick@ucsd.edu) C- real XSC real XLNG !------- ! The spacecraft position as given by XSC determines the Carrington ! rotation number (the integer part of XSC); the decimal fraction of ! XSC determines the spacecraft heliographic longitude. ICAR = int(XSC) XLNGSC = (1.0-(XSC-ICAR))*360.0 !------- ! Get the difference in heliographic longitude between observation ! point and spacecraft. The observation point is located east or ! west relative to the spacecraft. ! If it lies in the eastern hemisphere 0 <= DXLNG < -180; ! If it lies in the western hemisphere 0 <= DXLNG < 180. DXLNG = XLNG-XLNGSC if (abs(DXLNG) .gt. 180.0) DXLNG = DXLNG-sign(1.,DXLNG)*360.0 !------- ! Calculate modified Carrington variable for point of observation XMAP_OBS_POS = XSC-DXLNG/360.0 return end