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

GPlates API Integration #787

Open
7 tasks
Minerallo opened this issue Jan 20, 2025 · 1 comment
Open
7 tasks

GPlates API Integration #787

Minerallo opened this issue Jan 20, 2025 · 1 comment

Comments

@Minerallo
Copy link
Contributor

Hello everyone,

Integrate the GPlates Web Service API https://github.com/GPlates/gplates-web-service into World Builder to allow users to dynamically retrieve geodynamic data (e.g. plate velocities, continent positions, ocean floor age) and populate World Builder JSON configurations.
The user will be calling the up-to-date plate reconstruction data from the API (additionally we could have a way to read it from local GPML file direclty containing all the features, plate ids etc ...)

**Tasks include
Retrieve and parse JSON data from the GPlates API.
Implement a C++ API wrapper to query GPlates web services.
Store the data in World Builder structures for further processing.

Planned API features:.

Plate reconstruction:
reconstructPoints(points, time, model, anchor_plate_id)
Continental features:
getContinentalFeatures(time, model)
Plate velocities:
getPlateVelocities(time, model, anchor_plate_id)

User workflow:
Users provide the GWB JSON file to call for GPlates API calls.
For example

{
  "version": "1.0",
  "features":
  [
    {"model":"GPlates", "name":"Closed continental boundaries", "coordinates":[] or "plate_ids":[],
     "temperature models":[{"model":"plate model", "max depth":100e3],
     "composition models":[{"model":"uniform", "compositions":[0], "max depth":100e3},          
}

Later, the user will be able to use other thickness schemes for continental thickness and thermal state calculations.
In addition, the half-space oceanic seafloor age for Gplate could be used for the thermal state calculation.

Tasks to Be Completed:

Code Implementation:

  • Try to fetch and parse JSON requests.
  • Create a new C++ module (gplates_api.cc and gplates_api.h) to handle API requests from JSON.
  • Parse API calls in World Builder.

Configuration Updates:

  • Modify the JSON schema to include gplates api, time, model, etc.

Documentation:

  • Update World Builder documentation with API integration instructions.
  • Provide JSON configuration examples for users.
  • Add tutorial on using the API within World Builder.
@tjhei
Copy link
Contributor

tjhei commented Jan 21, 2025

This sounds very neat to have.

One thing is problematic though: You will redownload files every time a new simulation is run (world builder file is loaded), correct? This means that it won't work without internet access (think an ASPECT simulation on a cluster) and if any of the output of the API changes, the .wb file actually represents a different world than before. I know @MFraters worked hard to make sure world do not unexpectedly "change".
I wonder if it makes sense to have a separate tool to download/convert the gplates data and store it in a file (next to the .wb file?). GWB itself can then only operate on these files. That would resolve the problems mentioned above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants