pygmt icon indicating copy to clipboard operation
pygmt copied to clipboard

Improve input/output options for blockm* and grdtrack

Open maxrjones opened this issue 4 years ago • 3 comments

Description of the desired feature

Originally posted by @weiji14 in https://github.com/GenericMappingTools/pygmt/pull/1092#discussion_r598541899

  • [x] Improve the input options for blockmedian, blockmode, and blockmean from only supporting pandas.DataFrame or file to supporting a file, matrix, pandas.DataFrame, or x/y/z.
  • [ ] Improve the output options to support pandas.DataFrame or a file, independent of the input choice (current implementation requires outfile if a data file is provided as the input).

Are you willing to help implement and maintain this feature? Yes

maxrjones avatar Mar 22 '21 14:03 maxrjones

I'll take the blame for this one. Just for context, the " pd.DataFrame in, pd.DataFrame out; filename in, filename out" restriction was added in a37fb0aa3fef025eb1c723039060caa0489fcab1 when I was wrapping the grdtrack function at #308. Some of the blockmedian code was based on grdtrack, and was not really questioned ever since.

So we should also update the grdtrack code as well to have the same I/O design. I actually had a friend using grdtrack last week who would have loved to have file-in and pandas.DataFrame-out for grdtrack so I'll work on refactoring grdtrack while @meghanrjones can work on the blockm* I/O refactor.

weiji14 avatar Mar 22 '21 21:03 weiji14

@weiji14, do you mind if I work on a PR for x/y input for grdtrack?

maxrjones avatar Jun 19 '21 16:06 maxrjones

Just an update - I will hold off until after https://github.com/GenericMappingTools/pygmt/pull/1353 and https://github.com/GenericMappingTools/pygmt/pull/1336 are completed to submit the x/y input PR for grdtrack.

maxrjones avatar Jun 23 '21 15:06 maxrjones

The issue will be tracked in #2731 and #1318. Closing.

seisman avatar Feb 29 '24 00:02 seisman