PRO RampOff, RampName, Wcen, Detector=Detector, RampAper=RampAper ; PURPOSE: ; Calculate offsets for the ACS ramp filters as a function of ; requested wavelength and aperture. Offsets are in filter wheel ; steps (=1/12 deg). ; ; EXPLANATION: ; ACS ramp filters are all in FW2 and there are four apertures ; defined for the WFC (two for the middle ramp segments and one ; each for the inner and outer segmens) and one for the HRC ; (middle segments only). To place a given wavelength over the ; desired aperture one needs to calculate the offset form the ; nominal (central) position of the filter wheel 2 for the ; appropriate ramp filter slot. The calculation is done based ; on the GSFC lab calibrated relations for the wavelength, ; average throughput and FWHM for each ramp segment: ; Xpos(lambda) = a0 + a1*lambda + a2*lambda^2 in mm ; T(lambda) = b0 + b1*lambda + b2*lambda^2 ; FWHM(lambda) = c0 + c1*lambda + c2*lambda^2 ; ; The offset in steps is calculated as follows: ; Offset = AperOff + round(-12.*(atan(Xpos/RampRad)*180./!pi)) ; ; where AperOff is the aperture offset from the nominal filter ; slot position (in steps), and RampRad is the filter wheel radius ; of the ramp segment, and the "-" signs reflects the sense of ; rotation for FW2. ; ; CALLING SEQUENCE: ; rampoff, RampName, Wcen, [Detector =, RampAper =] ; ; EXAMPLES: ; rampoff, 'FR505N', 5071. ; rampoff, 'FR656N', 6615., detector='HRC' ; rampoff, 'FR656N', 6615., detector='WFC', rampaper='WFC2-MRAMP' ; ; HISTORY: ; Written Zlatan Tsvetanov November, 2000 ; On_Error, 2 ; Return to caller ; read ramp filters wavelength transformation coefficients fmt = 'A,A,F,F,F,F,F,F,F,F,F' nskip = 2 readcol, 'RampCoeff.dat', name, segment, a0, a1, a2, b0, b1, b2, $ c0, c1, c2, format = fmt, skipline = nskip ; set default aperture IF NOT keyword_set(Detector) THEN Detector = 'WFC' IF NOT keyword_set(RampAper) THEN RampAper = 'WFC1-MRAMP' ; aperture offsets for ramp segments off_inner = 0 ; WFC offset for inner ramp segments off_middle_1= -62 ; offset for WFC1-MRAMP aperture, middle segments off_middle_2= 62 ; offset for WFC2-MRAMP aperture, middle segments off_outer = 0 ; WFC offset for outer ramp segments off_middle_hrc = 0 ; HRC offset for middle ramp segments ; filter wheel radiuses for ramp segments R_inner =187.513 ; in mm R_middle =214.243 ; in mm R_outer =240.973 ; in mm ; figure out which coefficients to use j = where(name EQ RampName, count) ; NOTE: where returns array, and j = j[0] ; we need the first element only ; calculate filter parameters - wavelength position, throughput, FWHM Xpos = a0[j] + a1[j]*Wcen + a2[j]*Wcen^2 Tavg = b0[j] + b1[j]*Wcen + b2[j]*Wcen^2 BW50 = (c0[j] + c1[j]*Wcen + c2[j]*Wcen^2)*Wcen RampSeg = segment[j] ; choose filter radius to use CASE RampSeg OF 'inner': RampRad = R_inner 'middle': RampRad = R_middle 'outer': RampRad = R_outer ENDCASE ; choose aperture offset to use IF (Detector EQ 'HRC') THEN BEGIN AperOff = off_middle_hrc ENDIF ELSE BEGIN CASE RampSeg OF 'inner': AperOff = off_inner 'outer': AperOff = off_outer 'middle': IF (RampAper EQ 'WFC1-MRAMP') THEN AperOff = off_middle_1 ELSE $ IF (RampAper EQ 'WFC2-MRAMP') THEN AperOff = off_middle_2 ELSE $ print, 'Incorrect segment/detector combination!' ENDCASE ENDELSE ; IF (Detector EQ 'HRC') THEN AperOff = off_middle_hrc ELSE $ ; IF (RampSeg EQ 'inner') THEN AperOff = off_inner ELSE $ ; IF (RampSeg EQ 'outer') THEN AperOff = off_outer ELSE $ ; IF (RampAper EQ 'WFC1-MRAMP') THEN AperOff = off_middle_1 ELSE $ ; IF (RampAper EQ 'WFC2-MRAMP') THEN AperOff = off_middle_2 ; calculate FW2 offset in steps and print results RampStepOff = AperOff + round(-12.*(atan(Xpos/RampRad)*180./!pi)) print, 'Filter2 ', 'Wavelength ', 'Offset2' print, RampName, Wcen, RampStepOff ; print, ' ' ; print, 'Detector ', 'Segment ', 'Aperture Offset' ; print, Detector+' ', Segment[j], AperOff END