;+ mk4time.pro ; ; PURPOSE ; This function will find the exact time ; of a feature's position in a mk4 image during the 3 minute scan. ; ; SYNTAX angle_time mk4time (fits_file, position_angle) ; ; fits_file name of FITS file ; position_angle Position Angle in degrees (CCW from solar north) ; ; AUTHOR Tony Darnell [findtime.pro] ; ; HISTORY 3 April 2001: [ALS] Get raw_tmin & raw_tmax from extension. ; Arguments are now the Mk4 fits file name & angle. ;- FUNCTION mk4time, fits_name, angle ;--- Read primary HDU & extension HDU. hdu1 = headfits (fits_name) hdu2 = headfits (fits_name, exten = 1) ;--- Get relevant information from HDU's. time_obs = fxpar (hdu1, 'TIME-OBS') duration = fxpar (hdu2, 'DURATION') bar_dir = fxpar (hdu2, 'BAR_DIR') pangle = fxpar (hdu2, 'PANGLE') phase = fxpar (hdu2, 'PHASE') raw_tmin = fxpar (hdu2, 'RAW_TMIN') raw_tmax = fxpar (hdu2, 'RAW_TMAX') ang_range = ABS (raw_tmax - raw_tmin) ; Convert scan duration from Hertz units into seconds. duration = duration / 60.0 ;--- Convert observation time into seconds. time = DOUBLE (STR_SEP (time_obs, ':')) obs_sec = time [0] * 3600 + time [1] * 60 + time [2] ;--- Compute angle with respect to scan start position. IF (bar_dir EQ -1) THEN $ ang = 360 - (angle - 180 + pangle + phase) IF (bar_dir EQ 1) THEN $ ang = (angle - 180 + pangle + phase) IF (ang LT 0) THEN ang = ang + 360 IF (ang GT 360) THEN ang = ang - 360 ang_frac = ang / ang_range angtime = obs_sec + (duration * (ang_frac)) hour = FIX (angtime / (60 * 60)) minute = FIX (angtime / (60) - hour * 60) second = FIX (angtime - ((hour * 60 + minute) * 60.0)) sangtime = STRING (hour, minute, second, FORMAT="(i2.2, ':', i2.2, ':', i2.2)") RETURN, sangtime END