Skip to content

Commit

Permalink
fix issue #150
Browse files Browse the repository at this point in the history
  • Loading branch information
adokter committed Jul 28, 2020
1 parent e6f8908 commit 4adfaa7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/librender.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,6 @@ PolarVolume_t* PolarVolume_selectScansByScanUse(PolarVolume_t* volume, vol2birdS
* @return a polar scan
*/
PolarScan_t* PolarVolume_getScanClosestToElevation_vol2bird(PolarVolume_t* volume, double elev){
int iScan;
int nScans;
double elevDifference = 1000;
double elevDifferenceCandidate = 1000;
Expand Down Expand Up @@ -798,7 +797,7 @@ PolarScan_t* PolarVolume_getScanClosestToElevation_vol2bird(PolarVolume_t* volum
scan = scanCandidate;
}
}

return(scan);
}

Expand Down
9 changes: 7 additions & 2 deletions lib/libvol2bird.c
Original file line number Diff line number Diff line change
Expand Up @@ -1947,6 +1947,7 @@ static int getListOfSelectedGates(PolarScan_t* scan, vol2birdScanUse_t scanUse,

int vol2birdLoadClutterMap(PolarVolume_t* volume, char* file, float rangeMax){
PolarVolume_t* clutVol = NULL;

clutVol = vol2birdGetVolume(&file, 1, rangeMax,1);

if(clutVol == NULL){
Expand Down Expand Up @@ -1983,8 +1984,12 @@ int vol2birdLoadClutterMap(PolarVolume_t* volume, char* file, float rangeMax){
scan = PolarVolume_getScan(volume, iScan);

// extract the cluttermap scan parameter closest in elevation
elev = PolarScan_getElangle(scan);
clutScan = PolarVolume_getScanClosestToElevation_vol2bird(clutVol,elev);
elev = PolarScan_getElangle(scan);

//FIXME: here PolarVolume_getScanClosestToElevation_vol2bird leads to a segmentation fault. It finds the correct scan, but
//any operation here on the pointer leads to segfault...
//clutScan = PolarVolume_getScanClosestToElevation_vol2bird(clutVol,elev);
clutScan = PolarVolume_getScanClosestToElevation(clutVol,elev,0);
param = PolarScan_getParameter(clutScan,CLUTNAME);

if(param == NULL){
Expand Down
4 changes: 2 additions & 2 deletions src/vol2bird.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@ int main(int argc, char** argv) {

volume = vol2birdGetVolume(fileIn, nInputFiles, 1000000,1);
//volume = vol2birdGetVolume(fileIn, nInputFiles, alldata.misc.rCellMax,1);

if (volume == NULL) {
fprintf(stderr,"Error: failed to read radar volume\n");
return -1;
}

// loading static clutter map upon request
if (alldata.options.useClutterMap){
int clutterSuccessful = vol2birdLoadClutterMap(volume, alldata.options.clutterMap,alldata.misc.rCellMax) == 0;
Expand Down

0 comments on commit 4adfaa7

Please sign in to comment.