;------------------------------------------------------------------ ;+ ; NAME: ; GETCARR ; PURPOSE: ; ; This function gets the central Carrington longitude for a ; BBSO image. ; ; Routines used: ; sun (from Johns Hopkins library) to find P, B, and Carrington long. ; CATEGORY: ; POLAR ; CALLING SEQUENCE: ; cencarr = GETCARR(imhdr) ; INPUTS: ; imhdr = A FITS header. This is used to get date and time ; information. ; KEYWORD PARAMETERS: ; OUTPUTS: ; cencarr = Central Carrington longitude of the image. ; COMMON BLOCKS: ; NOTES: ; MODIFICATION HISTORY: ; J. Varsik, 04 May 1999 ;- ;------------------------------------------------------------------- FUNCTION GETCARR,imh,HELP=help ; Display IDL header if help is required. IF (KEYWORD_SET(help)) THEN BEGIN GET_IDLHDR,'getcarr.pro' GOTO,finishup ENDIF ; Find center, radius, p angle, b angle, etc. datec = FXPAR(imh,'DATE-OBS') timec = FXPAR(imh,'TIME-OBS') IF (STRMID(datec, 2, 1) EQ '/') THEN BEGIN READS,datec,day,mon,yrs,FORMAT='(i2,1x,i2,1x,i2)' yrs = yrs + 1900 ENDIF ELSE BEGIN READS,datec,yrs,mon,day,FORMAT='(i4,1x,i2,1x,i2)' ENDELSE READS,timec,hour,min,sec,FORMAT='(i2,1x,i2,1x,i2)' hr = hour + ((min + (sec / 60.0)) / 60.0) ; Use solar ephemeris from Johns Hopkins library SUN,yrs,mon,day,hr,pa=p,lat0=b,sd=rsun,long0=lnaught ; Check parameters PRINT, 'p = ',p,' b = ',b,' lnaught = ',lnaught,' rsun = ',rsun ; First make a subimage that only has the points we want to use. ; Get central position of image (use coordinates in header) ew = fxpar(imh,'CRVAL1') ns = fxpar(imh,'CRVAL2') ew = -1 * ew ;for mapping, east is positive cpr = sqrt(ew^2 + ns^2) cptheta = atan(ns,ew) - p ; Convert to heliographic rho = asin(cpr/rsun) cplat = asin(cos(rho)*sin(b) + sin(rho)*cos(b)*sin(cptheta)) cprlon = asin((cos(cptheta) * sin(rho))/cos(cplat)) cpalon = lnaught + cprlon IF (cpalon LT 0.0) THEN cpalon = cpalon + 360.0 IF (cpalon GE 360.0) THEN cpalon = cpalon - 360.0 ; Return central Carrington longitude finishup: RETURN,cpalon end