{"id":24506963,"url":"https://github.com/fschuch/xcompact3d_toolbox_data","last_synced_at":"2025-03-15T08:46:24.526Z","repository":{"id":112597183,"uuid":"412635233","full_name":"fschuch/xcompact3d_toolbox_data","owner":"fschuch","description":"Data repository for xcompact3d-toolbox's examples","archived":false,"fork":false,"pushed_at":"2021-10-06T22:09:10.000Z","size":65684,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T23:41:26.382Z","etag":null,"topics":["python","xarray","xcompact3d","xcompact3d-toolbox"],"latest_commit_sha":null,"homepage":"https://xcompact3d-toolbox.readthedocs.io/en/stable/tutorial.html","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fschuch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-01T22:42:44.000Z","updated_at":"2021-10-06T22:10:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f5425a0-7a70-4590-a6b7-c7ffe771da3d","html_url":"https://github.com/fschuch/xcompact3d_toolbox_data","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fschuch%2Fxcompact3d_toolbox_data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fschuch%2Fxcompact3d_toolbox_data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fschuch%2Fxcompact3d_toolbox_data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fschuch%2Fxcompact3d_toolbox_data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fschuch","download_url":"https://codeload.github.com/fschuch/xcompact3d_toolbox_data/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243707308,"owners_count":20334615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","xarray","xcompact3d","xcompact3d-toolbox"],"created_at":"2025-01-21T23:41:10.816Z","updated_at":"2025-03-15T08:46:24.504Z","avatar_url":"https://github.com/fschuch.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# XCompact3d-toolbox: Data for Tutorials\n\nUseful links:\n\n  * XCompact3d: https://github.com/xcompact3d/Incompact3d\n  * XCompact3d-toolbox: https://github.com/fschuch/xcompact3d_toolbox\n  * Tutorials: https://xcompact3d-toolbox.readthedocs.io/en/latest/tutorial.html\n\n## Available Cases\n\n* 2D Flow around a Cylinder (`cylinder.nc`):\n\n  ```python\n  \u003e\u003e\u003e import xcompact3d_toolbox as x3d\n  \u003e\u003e\u003e dataset, prm = x3d.tutorial.open_dataset(\"cylinder\")\n  \u003e\u003e\u003e print(dataset)\n  \u003cxarray.Dataset\u003e\n  Dimensions:  (i: 2, t: 201, x: 257, y: 128)\n  Coordinates:\n    * x        (x) float64 0.0 0.07812 0.1562 0.2344 ... 19.77 19.84 19.92 20.0\n    * y        (y) float64 0.0 0.09375 0.1875 0.2812 ... 11.62 11.72 11.81 11.91\n    * t        (t) float64 0.0 0.75 1.5 2.25 3.0 ... 147.0 147.8 148.5 149.2 150.0\n    * i        (i) object 'x' 'y'\n  Data variables:\n      u        (i, x, y, t) float32 ...\n      pp       (x, y, t) float32 ...\n      epsi     (x, y) float32 0.0 0.0 0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0 0.0 0.0\n  Attributes:\n      xcompact3d_version:          v3.0-397-gff531df\n      xcompact3d_toolbox_version:  1.0.1\n      url:                         https://github.com/fschuch/xcompact3d_toolbo...\n      dataset_license:             MIT License\n  ```\n\n* Poli-dispersed Turbidity Current (coming soon).\n\n## Converting the dataset from a simulation to netCDF\n\nThis is an example showing how to create the file(s):\n\n```python\n\u003e\u003e\u003e import xcompact3d_toolbox as x3d\n\u003e\u003e\u003e # Load the parameters file from the disc\n\u003e\u003e\u003e prm = x3d.Parameters(loadfile=\"input.i3d\", raise_warning=True)\n\u003e\u003e\u003e # Specify the options for the dataset [optional]\n\u003e\u003e\u003e prm.dataset.set(stack_velocity=True)\n\u003e\u003e\u003e # Load the entire dataset from the disc\n\u003e\u003e\u003e dataset = prm.dataset[:] # may not work for large scale simulations\n\u003e\u003e\u003e # Load the geometry at epsilon.bin\n\u003e\u003e\u003e dataset[\"epsi\"] = prm.dataset.load_array(\n...     \"./data/geometry/epsilon.bin\", add_time=False\n... )\n\u003e\u003e\u003e # Specify extra atributes to help reproducibility [optional]\n\u003e\u003e\u003e dataset.attrs = dict(\n...     xcompact3d_version = \"v3.0-397-gff531df\",\n...     xcompact3d_toolbox_version = x3d.__version__,\n...     url = \"https://github.com/fschuch/xcompact3d_toolbox_data\",\n...     dataset_license = \"MIT License\",\n...     prm = str(prm),\n... )\n\u003e\u003e\u003e # To save space and make it easier to share [optional]:\n\u003e\u003e\u003e #     Convert float64 to float32\n\u003e\u003e\u003e dataset = dataset.astype(np.float32)\n\u003e\u003e\u003e #     Compute span-wise average for all variables\n\u003e\u003e\u003e dataset = dataset.mean(\"z\")\n\u003e\u003e\u003e #     Drop span-wise velocity\n\u003e\u003e\u003e dataset = dataset.drop_sel(i=\"z\")\n\u003e\u003e\u003e # Write the dataset to a netcdf file, keeping all data\n\u003e\u003e\u003e # together with its dimensions, coordinates and atributes\n\u003e\u003e\u003e dataset.to_netcdf(\"cylinder.nc\")\n```\n\n## Copyright and License\n\nAll content is under the [MIT License](https://github.com/fschuch/xcompact3d_toolbox_data/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffschuch%2Fxcompact3d_toolbox_data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffschuch%2Fxcompact3d_toolbox_data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffschuch%2Fxcompact3d_toolbox_data/lists"}