PRO rdmnparm,year,month,day,cam,c0,r0,r,k,ca,site=site ;+ ; NAME: ; RDMNPARM ; PURPOSE: ; Read a set of mean parameters describing the transformation ; from azimuth and zenith angle at a Polar Camera site to ; column and row within the images acquired by the camera. ; CATEGORY: ; ; CALLING SEQUENCE: ; RDMNPARM, YEAR, MONTH, DAY, CAMERA, C0, R0, STRETCH, WARP $ ; , AZIMUTH, SITE=SITE ; INPUTS: ; YEAR: The year of the observations (2 or 4 digits). ; MONTH: The number of the month of observations (January = 1). ; DAY: The day of the month of observations, reckoned by UT. ; CAMERA: The number of the Polar Camera imager acquiring the ; images. ; KEYWORD PARAMETERS: ; SITE: A number indicating the geographical location of ; the Polar Camera on the date of the observations. ; The appropriate number is returned by POCASITE.PRO. ; If this parameter is not supplied, the routine ; calls POCASITE to get the value. ; OUTPUTS: ; C0: The column number of the pixel containing the zenith. ; R0: The row number of the pixel containing the zenith. ; STRETCH: The multiplier of SIN( WARP * zenith angle ) in ; the transformation equation. ; WARP: The multiplier inside the argument of SIN above. ; The product STRETCH * WARP gives the ratio of pixel ; distances from the center of the image, and zenith ; angles (radians) for small zenith angles, at least. ; AZIMUTH: The azimuth (angle East of geographic North) of ; column C0 of the imager CCD, expressed in radians. ; COMMON BLOCKS: ; None. ; SIDE EFFECTS: ; IF YEAR is supplied with 2 digits, it is converted to 4 digits. ; RESTRICTIONS: ; The date supplied must be one for which the Polar Camera ; was operating in the field somewhere, i.e., after January ; 1, 1993. ; PROCEDURE: ; The Polar Camera location is either supplied by the user, ; or determined from the observation date, which must now be ; supplied. If the location is U of C Airglow Observatory ; or Rabbit Lake, the parameters are read from the appropriate ; file and returned. If the location is Eureka, the file ; appropriate to the specific date of observations is identified ; and read, and the parameters returned. ; MODIFICATION HISTORY: ; Written 93/11 by D P Steele. ; Modified 94/06 by D P Steele to handle multiple orientations ; at Eureka. ; Documented 94/06 by D P Steele. ;- ; Set up OS-specific items @isitdos IF year LT 100 THEN BEGIN ; convert to a 4-digit year IF year LT 50 THEN year=year+2000 ; years 2000-2049 IF year GE 50 THEN year=year+1900 ; years 1950-1999 ENDIF IF KEYWORD_SET(site) THEN BEGIN IF (site EQ 1) OR (site EQ 2) OR (site EQ 3) $ THEN loc=site $ ELSE BEGIN MESSAGE,'Bad site code: '+STRTRIM(site,2),/INFORMATIONAL MESSAGE,'Getting site from date supplied',/INFORMATIONAL loc=PoCaSite(year,month,day) ENDELSE ENDIF ELSE loc=PoCaSite(year,month,day) ; This block of code should no longer be needed, but I'll leave it ; in for now. D P Steele, 94/06/22 IF NOT KEYWORD_SET(loc) THEN BEGIN REPEAT BEGIN PRINT,'Enter the camera location' PRINT,'1: U of C 2: Rabbit Lake 3: Eureka, NWT' READ,loc ENDREP UNTIL (loc EQ 1) OR (loc EQ 2) OR (loc EQ 3) ENDIF CASE loc OF 1: file=meanparmroot+dd+'meanparm.UC' 2: file=meanparmroot+dd+'meanparm.RL' 3: BEGIN ; The multiple orientations at Eureka require special handling mpf=rfindfile(meanparmroot+dd+'mnp*.EU',count=nmpf) ; Determine which mean parameters file is the appropriate one. jdobs=julday(month,day,year) jddiff=LONARR(nmpf) FOR i=0,nmpf-1 DO BEGIN mpdate=LONG(STRMID(mpf(i),STRLEN(mpf(i))-8,5)) ; jddiff(i)=jdobs-julday((mpdate/100) MOD 100,mpdate MOD 100 $ ; ,1900+(mpdate/10000)) jddiff(i)=jdobs $ -(julday(1,1,1900+mpdate/1000)-1) $ -(mpdate MOD 1000) ; Mean parameters from a date after the observations are of no ; value, so leave them out of contention by making the Julian date ; interval impossibly large. IF jddiff(i) LT 0 THEN jddiff(i)=99999 ENDFOR jddmin=MIN(jddiff,n) file=mpf(n) END ENDCASE mpstr=qgetfile(file) st=mpstr(cam) c0=0. & r0=0. & r=0. & k=0. & ca=0. READS,st,c0,r0,r,k,ca IF loc EQ 1 THEN ca=0. RETURN END