-
Notifications
You must be signed in to change notification settings - Fork 244
Closed
Labels
eswn-workshopGood issues for first-contributions during the ESWN-PyGMT workshopGood issues for first-contributions during the ESWN-PyGMT workshopfeature requestNew feature wantedNew feature wantedhelp wantedHelping hands are appreciatedHelping hands are appreciated
Milestone
Description
Description of the desired feature
Currently, the data parameter for pygmt.surface function accepts a data file name or a 2d numpy array with the tabular data. It would be helpful to expand the list of accepted input options to include pandas.DataFrame, xarray.Dataset, or geopandas.GeoDataFrame similar to blockmedian or plot.
To address, this issue you will need to change this block of code:
Lines 87 to 94 in cd822ca
| if kind == "file": | |
| file_context = dummy_context(data) | |
| elif kind == "matrix": | |
| file_context = lib.virtualfile_from_matrix(data) | |
| elif kind == "vectors": | |
| file_context = lib.virtualfile_from_vectors(x, y, z) | |
| else: | |
| raise GMTInvalidInput("Unrecognized data type: {}".format(type(data))) |
to:
# Choose how data will be passed into the module
file_context = lib.virtualfile_from_data(
check_kind="vector", data=data, x=x, y=y, z=z
)
update the data parameter description in the docstring to:
data : str or {table-like}
Pass in (x, y, z) or (longitude, latitude, elevation) values by
providing a file name to an ASCII data table, a 2D
{table-classes}.
and remove dummy_context from the import statements in pygmt/src/surface.py.
Are you willing to help implement and maintain this feature? I would be glad to help someone implement this feature request.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
eswn-workshopGood issues for first-contributions during the ESWN-PyGMT workshopGood issues for first-contributions during the ESWN-PyGMT workshopfeature requestNew feature wantedNew feature wantedhelp wantedHelping hands are appreciatedHelping hands are appreciated