Bug #1025

x2sys_datalist -F<var> crashes

Added by Joaquim 10 months ago. Updated 10 months ago.

Status:FeedbackStart date:2017-01-11
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Affected version:5.3-svn Platform:


Probably the same root trouble as #1022

x2sys_datalist hu68022m.nc -TMGD77+ -Lcoe_table.dat -Fbest_cm4

crashes at line 498

ds = (row == 0) ? 0.0 : dist_scale * gmt_distance (GMT, data[xpos][row], data[ypos][row], data[xpos][row-1], data[ypos][row-1]);

because xpos = -1, except that I now don't know how to restore to a working state.


#1 Updated by Joaquim 10 months ago

Found more things. Since the coe_table.dat has the 'dist' key

hu68022m               best_cm4     -164.0735     0.00614585*((dist))

auxlist[MGD77_AUX_DS].requested becomes true and the crashing path is followed.

It works, however, if stating "-Flon,lat,best_cm4" since now it knows how to compute 'dist'

#2 Updated by Paul 10 months ago

  • Status changed from New to Feedback

Given how it all works I think we will have to expand this test:

    if (Ctrl->L.active) {    /* Load an ephemeral correction table */
        x2sys_get_corrtable (GMT, s, Ctrl->L.file, n_tracks, trk_name, NULL, aux, auxlist, &CORR);
        if (auxlist[MGD77_AUX_SP].requested && s->t_col == -1) {
            GMT_Report (API, GMT_MSG_NORMAL, "Selected correction table requires velocity which implies time (not selected)\n");
            MGD77_Free_Correction (GMT, CORR, n_tracks);
            x2sys_free_list (GMT, trk_name, n_tracks);
            GMT_exit (GMT, GMT_RUNTIME_ERROR); return GMT_RUNTIME_ERROR;

to do the same with other columns required by the choices. One can always use -o to only output what is of interest. Alternatively we must read in this table earlier, detect the extra columns required, and append to the F.flags string. Later.

#3 Updated by Joaquim 10 months ago

By expanding, you mean test and tell user that he has to select lon,lat as well?
More interesting would be to select the extra needed vars under the hood.

Also available in: Atom PDF