Function: irds_rd_detpos Purpose: To extract (projected) sky positions data from an IRDS Category: IR File: irds_dpos.c Author: Do Kester Use: IRDS_RD_DETPOS( IRDS , Input character*(*) SNIP , Input integer SDET , Input integer TICK , Input integer COOR , Input integer PROJ , Input integer YLON , Output double( >=NDATA ) ZLAT , Output double( >=NDATA ) TWIST , Output double( >=NDATA ) NDATA , In/Out integer STATUS ) Output integer 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. COOR coordinate system identification ( cf irco.dc2 ) 0 is a valid number => no transformations PROJ projection system number ( cf irco_prname.dc2 ) 0 is a valid number => no projection YLON Array to receive LON coordinates (rad) ZLAT Array to receive LAT coordinates (rad) TWIST Array to receive TWIST angles (rad. ccw w.r.t. +ZLAT) NDATA I - max number of samples to return O - number of samples actually returned. 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 -9 - not enough memory for boresight data -10 - only one point bphf tick found Description: The BPHF data are read for the satcal ticks in the scan. The boresight positions are transformed to the proper detector positions, still in sunreferenced coordinates. Transformation and projection take place ( when requested with coor and proj ) and the resulting positions are interpolated to the sample times. No conscious shortcuts or approximations have been taken in these calculations. The routine has been optimized for an inner loop over the detectors and an outer loop over the snips. It is assumed that the ecliptic coordinate system has been precessed to 1983.5. The returned angles will be in radians Bugs: Funny things will happen when the snip crosses an edge of the projection type. Updates: 30 Nov 1990: DK 30 May 1991 DK, improved interpolation 03 Jun 1991 DK, partial satcals allowed. 07 Aug 1991 DK, free memory.