#include "dccrad.h" /************************************************************************ * CR_GSWR * * * * Given a radial velocity ray from volume 1 of the RSL library radar * * structure, this function locates and returns the spectral width ray * * from volume 2 which has the same metadata (e.g. date-time, azimuth, * * elevation, frequency, etc.) * * * * CR_GSWR ( CRADFL, LUNOUT ) * * * * Input parameters: * * RADAR Radar* RSL library radar structure * * RAY Ray* Radial velocity ray from * * volume 1 of RADAR * * * * Output parameters: * * CR_GSWR Ray* Spectral width ray from * * volume 2 of RADAR which has * * same metadata as RAY: * * NULL = not found * ** * * Log: * * J. Ator/NCEP 03/11 * ***********************************************************************/ Ray *cr_gswr( Radar *radar, Ray *ray ) { Volume *volume; Sweep *sweep; Ray *swray; int j, k; volume = radar->v[2]; if (volume == NULL) return NULL; for ( j = 0; j < volume->h.nsweeps; j++ ) { if ( ( sweep = volume->sweep[j] ) == NULL ) continue; for ( k = 0; k < sweep->h.nrays; k++ ) { if ( ( swray = sweep->ray[k] ) == NULL ) continue; if ( ( ray->h.year ) == ( swray->h.year ) && ( ray->h.month ) == ( swray->h.month ) && ( ray->h.day ) == ( swray->h.day ) && ( ray->h.hour ) == ( swray->h.hour ) && ( ray->h.minute ) == ( swray->h.minute ) && ( ray->h.sec ) == ( swray->h.sec ) && ( ray->h.azimuth ) == ( swray->h.azimuth ) && ( ray->h.elev ) == ( swray->h.elev ) && ( ray->h.frequency ) == ( swray->h.frequency ) && ( ray->h.prf ) == ( swray->h.prf ) && ( ray->h.pulse_width ) == ( swray->h.pulse_width ) && ( ray->h.beam_width ) == ( swray->h.beam_width ) && ( ray->h.nyq_vel ) == ( swray->h.nyq_vel ) ) return swray; } } return NULL; }