Skip to content

Commit

Permalink
fix issue #166
Browse files Browse the repository at this point in the history
  • Loading branch information
adokter committed Nov 23, 2020
1 parent 0d70237 commit 361b18b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/librsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ PolarScan_t* PolarScan_RSL2Rave(Radar *radar, int iScan, float rangeMax){
return scan;
}

// get first RSL volume
// find the first non-zero RSL volume
// usually breaks at iParam==0, the reflectivity volume
for (int iParam = 0; iParam < radar->h.nvolumes; iParam++){
if(radar->v[iParam] == NULL) continue;
rslVol = radar->v[iParam];
Expand Down Expand Up @@ -270,9 +271,11 @@ PolarScan_t* PolarScan_RSL2Rave(Radar *radar, int iScan, float rangeMax){
// add attribute Beamwidth to scan
PolarScan_setBeamwidth(scan, (double) rslVol->sweep[iScan]->h.beam_width);

// add attribute Nyquist velocity to scan
rslRay = RSL_get_first_ray_of_volume(rslVol);
// add attribute Nyquist velocity to scan (from radial velocity sweep)
rslRay = RSL_get_first_ray_of_sweep(radar->v[VR_INDEX]->sweep[iScan]);
nyq_vel = rslRay->h.nyq_vel;
// continue with ray from reflectivity sweep
rslRay = RSL_get_first_ray_of_sweep(radar->v[DZ_INDEX]->sweep[iScan]);

// if no nyquist velocity found, try it with the native RSL function
if(nyq_vel == 0){
Expand Down Expand Up @@ -358,13 +361,15 @@ PolarVolume_t* PolarVolume_RSL2Rave(Radar* radar, float rangeMax){
// this should be in vol2bird version only

// find the first non-zero RSL volume
// usually breaks at iParam==0, the reflectivity volume
for (int iParam = 0; iParam < radar->h.nvolumes; iParam++){
if(radar->v[iParam] == NULL) continue;
rslVol = radar->v[iParam];
break;
}

// find the largest shared maximum range
// based on first ray (i.e. first sweep) of each volume
float maxRange=FLT_MAX;
float iRange;
for (int iParam = 0; iParam < radar->h.nvolumes; iParam++){
Expand Down Expand Up @@ -427,7 +432,7 @@ PolarVolume_t* PolarVolume_RSL2Rave(Radar* radar, float rangeMax){
else{
PolarVolume_addAttribute(volume, attr_wavelength);
}

// read the RSL scans (sweeps) and add them to RAVE polar volume
int result;
for (int iScan = 0; iScan < rslVol->h.nsweeps; iScan++){
Expand Down

0 comments on commit 361b18b

Please sign in to comment.