Skip to content

Commit

Permalink
Merge pull request #560 from SuperDARN/feature/field_plot_databeam
Browse files Browse the repository at this point in the history
Adding new -databeam option to field_plot
  • Loading branch information
pasha-ponomarenko authored Jun 17, 2024
2 parents b060107 + 63f3585 commit 577bfbc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
</option>
<option><on>-maxbeam <ar>maxbeam</ar></on><od>set the maximum number of beams to draw for the radar field of view outline to <ar>maxbeam</ar>.</od>
</option>
<option><on>-databeam</on><od>set the minimum and maximum number of beams to draw for the radar field of view according to the data in each scan (default is to use the radar hardware file).</od>
</option>
<option><on>-dot</on><od>Mark the location of the radar site with a dot.</od>
</option>
<option><on>-dotr <ar>radius</ar></on><od>set the radius of the dot used to mark the station.</od>
Expand Down
12 changes: 12 additions & 0 deletions codebase/superdarn/src.bin/tk/plot/field_plot.1.12/field_plot.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,7 @@ int main(int argc,char *argv[]) {

int minbeam=0;
int maxbeam=-1;
unsigned char databeam=0;

char *chnstr=NULL;

Expand Down Expand Up @@ -894,6 +895,7 @@ int main(int argc,char *argv[]) {

OptionAdd(&opt,"minbeam",'i',&minbeam);
OptionAdd(&opt,"maxbeam",'i',&maxbeam);
OptionAdd(&opt,"databeam",'x',&databeam);

OptionAdd(&opt,"gscol",'t',&gscol_txt);

Expand Down Expand Up @@ -1735,6 +1737,16 @@ int main(int argc,char *argv[]) {
ffovcol,0x0f,0.5,NULL,
rfov,1);

if (databeam) {
minbeam=999;
maxbeam=-1;
for (c=0;c<scn->num;c++) {
if (scn->bm[c].bm < minbeam) minbeam=scn->bm[c].bm;
if (scn->bm[c].bm > maxbeam) maxbeam=scn->bm[c].bm;
}
maxbeam=maxbeam+1;
}

for (c=0;c<scn->num;c++) {
if ((sflg) && (scn->bm[c].scan !=scan)) continue;
if ((nsflg) && (scn->bm[c].scan<0)) continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ void plot_outline(struct Plot *plot,struct RadarBeam *sbm,
}
}

if ((gbm->bm < minbeam) || (gbm->bm >= maxbeam)) return;

if (magflg) {
map[0]=gbm->mlat[0][0];
Expand Down

0 comments on commit 577bfbc

Please sign in to comment.