vtsuperdarn / VTRST3.5

Radar Software Toolkit enhanced
0 stars 6 forks source link

Make_grid and scan = -1 issue #11

Open ksterne opened 8 years ago

ksterne commented 8 years ago

Got two reports of people having issues with zho and unw data (1 report of issue with sye, sys data) when running something like:

make_grid filename.zho.fitacf > filename.zho.grd

The common issue seems to be that these radars don't set the scan variable to +1 at the beginning of each scan. Instead they set it to -1. This isn't a problem if the -tl option is used as this ignores the scan flag entirely. Below are some notes from Kevin Krieger (with maybe the help of @kkotyk):

Without the -tl flag: I modified the code to also accept -1 for the beginning of a new scan, and the four radars mentioned below (zho, han, sys, and unw) all fail in a different place. Here are the details:

1) In FitReadRadarScan (line ~205 of fitscan.c) the original code is: if (prm->scan==1) flg=1;

Which I modified to: if (prm->scan==1 || prm->scan ==-1) flg=1;

Which I hoped would just work for the four radars.

2) FitRead is called in the loop (from fitread.c) and it calls DataMapRead on the file

3) Within DataMapRead, DataMapReadBlock is called (dmap.c ~line 1432)

4) Within DataMapReadBlock (dmap.c ~line 1369) The function ConvertReadInt is called and fails

5) ConvertReadInt (convert.c ~line 321) it looks like s=read(fp,tmp+o,1); fails with 0 or -1, who knows why...

Will need to get this bug fixed here soon since it's crept up twice in the last week.