You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
block* and -G from externals must always return grids #2795
When calling from externals with -G we are expecting to always get grids, but if, for example, condition "No data records found; no output produced is triggered we return error and no grids. This in itself will trigger calls to the external error() function, which is ... not good. What should happen is the return of empty grids (that is, all NaNs)
if (n_read == 0) { /* Blank/empty input files */
GMT_Report (API, GMT_MSG_WARNING, "No data records found; no output produced\n");
GMT_External_Cleanup (API, GMT_IS_GRID, file); /* Possibly other args but -R should be set already */
Return (GMT_NOERROR);
}
where GMT_External_Cleanup is in charge of creating an empty grid or a no-record data set etc and call GMT_Write_Data on that if API->external is true. in blockmean there may be several grids requested so there may need to be a loop there (module specific). Perhaps think about where else we may run into this and take note of how GMT_External_Cleanup needs to work.
Activity
PaulWessel commentedon Feb 24, 2020
Yes, need elegant solution for this. E.g.,
where GMT_External_Cleanup is in charge of creating an empty grid or a no-record data set etc and call GMT_Write_Data on that if API->external is true. in blockmean there may be several grids requested so there may need to be a loop there (module specific). Perhaps think about where else we may run into this and take note of how GMT_External_Cleanup needs to work.
PaulWessel commentedon Mar 10, 2020
Fixed. closing