Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new -databeam option to field_plot #560

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading