Function: irds_rd_detoff Purpose: To extract (projected) sky position offsets from an IRDS Category: IR File: irds_dpos.c Author: Peter Roelfsema Use: INTEGER IRDS_RD_DETOFF( IRDS , Input character*(*) SNIP , Input integer SDET , Input integer TICK , Input integer INCOOR , Input integer LON , Input double LAT , Input double OUTCOOR , Input integer PROJ , Input integer LONOFF , Output double( >=NDATA ) LATOFF , Output double( >=NDATA ) TWISTOFF , Output double( >=NDATA ) NDATA , In/Out integer STATUS ) Output integer IRDS_RD_DETOFF 0 - error condition n - LON,LAT closest to detector center at sample number abs(n) n>0 - LON,LAT inside detector at sample n n<0 - LON,LAT outside detector at sample n IRDS Name of IRDS to read from. SNIP Sequential snip number to read. SDET Sequential detector number to read. SDET = 0 corresponds to boresight, SDET < 0 corresponds to the center of gravity of band number SDET (see IRCC_BANDNR etc.) TICK Sequential tick of first sample to read. INCOOR coordinate system of input LON,LAT ( cf irco.dc2 ) LON input longitude (radians) LAT input latitude (radians) OUTCOOR coordinate system of output LONOFF,LATOFF 0 is a valid number => no transformations PROJ projection system number ( cf irco_prname.dc2 ) 0 is a valid number => no projection LONOFF Array to receive LON(det)-LON offsets (radians) LATOFF Array to receive LAT(det)-LAT offsets (radians) TWISTOFF Array to receive TWIST(det)-TWIST angles (radadians ccw w.r.t. +LAT) NDATA I - max number of samples to read. O - number of samples actually read. STATUS Error return code: 0 - no error. -1 - IRDS does not exist -2 - IRDS is not a legal irds -3 - SNIP not in IRDS -4 - SDET not in IRDS -5 - TICK not in IRDS -6 - gds read error -7 - no coordinate info in header -8 - bad SDET Description: The BPHF data are read for the satcal ticks in the scan. The boresight positions are transformed to the proper detector positions. Transformation and projection take place ( when requested with outcoor and proj ) and the resulting positions are interpolated to the sample times. Subsequently the offsets of the detector postitions w.r.t the input position are calculated. No conscious shortcuts or approximations have been taken in these calculations. The routine also will find out at which of the requested samples the the input position (LON,LAT) was closest to the detector center, and whether that position was inside or outside the detector. The routine has been optimized for an inner loop over the detectors and an outer loop over the snips. The input and returned angles are in radians Updates: Jan 9, 1991: PRR, Document created. Apr 2, 1991: PRR, Corrected error in return parameter.