static float (*f)(Range x);
static Range (*invf)(float x);
-FILE *file;
+extern FILE *file;
void get_extended_header_info(NSIG_Sweep **nsig_sweep, int xh_size, int iray,
int nparams,
float second;
float pw;
float bin_space;
- float prf, wave, beam_width;
+ float prf, prf2, wave, beam_width;
+ int prf_mode;
+ float prf_modes[] = {1.0, 2.0/3.0, 3.0/4.0, 4.0/5.0};
float vert_half_bw, horz_half_bw;
float rng_last_bin;
float rng_first_bin, freq;
NSIG_Sweep **nsig_sweep;
NSIG_Ray *ray_p;
int itype, ifield;
- unsigned short nsig_u2byte; /* New for 2-byte data types, Aug 2009 */
+ unsigned short nsig_2byte; /* New for 2-byte data types, Aug 2009 */
+ twob nsig_twob;
Sweep *sweep;
int msec;
float azm, elev, pitch, roll, heading, azm_rate, elev_rate,
num_rays = 0;
pw = (NSIG_I4(prod_file->rec1.prod_end.pulse_wd))/100.0; /* pulse width */
prf = NSIG_I4(prod_file->rec1.prod_end.prf); /* pulse repetition frequency */
+ prf_mode = NSIG_I2(prod_file->rec2.task_config.dsp_info.prf_mode);
+ prf2 = prf * prf_modes[prf_mode];
wave = (NSIG_I4(prod_file->rec1.prod_end.wavelen))/100.0; /* wavelength (cm) */
rsl_kdp_wavelen = wave; /* EXTERNAL (volume.c) This sets KD_F and KD_INVF
* to operate with the proper wavelength.
num_samples = NSIG_I2(prod_file->rec1.prod_end.num_samp);
sweep_rate = 3.0; /** Approximate value -- info not stored **/
azim_rate = sweep_rate*360.0/60.0;
- max_vel = wave*prf/(100.0*4.0);
+ if (prf_mode != 0)
+ {
+ float max_vel1 = wave*prf/(100.0*4.0);
+ float max_vel2 = wave*prf2/(100.0*4.0);
+
+ max_vel = (max_vel1 * max_vel2)/(max_vel1-max_vel2);
+ }
+ else
+ {
+ max_vel = wave*prf/(100.0*4.0);
+ }
+
freq = (299793000.0/wave)*1.0e-4; /** freq in MHZ **/
sqi = NSIG_I2(prod_file->rec2.task_config.calib_info.sqi)/256.0;
}
if (radar_verbose_flag)
- fprintf(stderr, "vel: %f prf: %f\n", max_vel, prf);
+ fprintf(stderr, "vel: %f prf: %f prf2: %f\n", max_vel, prf, prf2);
/** Extracting Latitude and Longitude from nsig file **/
lat = nsig_from_fourb_ang(prod_file->rec2.ingest_head.lat_rad);
ray->h.unam_rng = 299793000.0 / (2.0 * prf * 1000.0); /* km */
else
ray->h.unam_rng = 0.0;
- ray->h.fix_angle = (float)sweep->h.elev;
+ ray->h.prf2 = (int) prf2;
+ ray->h.fix_angle = (float)sweep->h.elev;
ray->h.azim_rate = azim_rate;
- ray->h.pulse_count = (float)num_samples;
+ ray->h.pulse_count = num_samples;
ray->h.pulse_width = pw;
ray->h.beam_width = beam_width;
ray->h.frequency = freq / 1000.0; /* GHz */
case NSIG_DTB_VELC2:
case NSIG_DTB_ZDR2:
case NSIG_DTB_KDP2:
- memmove(&nsig_u2byte, &ray_p->range[2*k], 2);
- nsig_u2byte = NSIG_I2(&nsig_u2byte);
- if (nsig_u2byte == 0 || nsig_u2byte == 65535)
+ memmove(nsig_twob, &ray_p->range[2*k], 2);
+ nsig_2byte = NSIG_I2(nsig_twob);
+ if (nsig_2byte == 0 || nsig_2byte == 65535)
ray_data = NSIG_NO_ECHO2;
- else ray_data = (float)(nsig_u2byte-32768)/100.;
+ else ray_data = (float)(nsig_2byte-32768)/100.;
break;
case NSIG_DTB_WID2:
- memmove(&nsig_u2byte, &ray_p->range[2*k], 2);
- nsig_u2byte = NSIG_I2(&nsig_u2byte);
- if (nsig_u2byte == 0 || nsig_u2byte == 65535)
+ memmove(nsig_twob, &ray_p->range[2*k], 2);
+ nsig_2byte = NSIG_I2(nsig_twob);
+ if (nsig_2byte == 0 || nsig_2byte == 65535)
ray_data = NSIG_NO_ECHO2;
- else ray_data = (float)nsig_u2byte/100.;
+ else ray_data = (float)nsig_2byte/100.;
break;
case NSIG_DTB_PHIDP2:
- memmove(&nsig_u2byte, &ray_p->range[2*k], 2);
- nsig_u2byte = NSIG_I2(&nsig_u2byte);
- if (nsig_u2byte == 0 || nsig_u2byte == 65535)
+ memmove(nsig_twob, &ray_p->range[2*k], 2);
+ nsig_2byte = NSIG_I2(nsig_twob);
+ if (nsig_2byte == 0 || nsig_2byte == 65535)
ray_data = NSIG_NO_ECHO;
else
- ray_data = 360.*(nsig_u2byte-1)/65534.;
+ ray_data = 360.*(nsig_2byte-1)/65534.;
break;
case NSIG_DTB_SQI2:
case NSIG_DTB_RHOHV2:
- memmove(&nsig_u2byte, &ray_p->range[2*k], 2);
- nsig_u2byte = NSIG_I2(&nsig_u2byte);
- if (nsig_u2byte == 0 || nsig_u2byte == 65535)
+ memmove(nsig_twob, &ray_p->range[2*k], 2);
+ nsig_2byte = NSIG_I2(nsig_twob);
+ if (nsig_2byte == 0 || nsig_2byte == 65535)
ray_data = NSIG_NO_ECHO2;
- else ray_data = (float)(nsig_u2byte-1)/65533.;
+ else ray_data = (float)(nsig_2byte-1)/65533.;
break;
case NSIG_DTB_HCLASS2:
- memmove(&nsig_u2byte, &ray_p->range[2*k], 2);
- nsig_u2byte = NSIG_I2(&nsig_u2byte);
- if (nsig_u2byte == 0 || nsig_u2byte == 65535)
+ memmove(nsig_twob, &ray_p->range[2*k], 2);
+ nsig_2byte = NSIG_I2(nsig_twob);
+ if (nsig_2byte == 0 || nsig_2byte == 65535)
ray_data = NSIG_NO_ECHO2;
else
- ray_data = nsig_u2byte;
+ ray_data = nsig_2byte;
}
if (ray_data == NSIG_NO_ECHO || ray_data == NSIG_NO_ECHO2)