sand-atlas


Namesand-atlas JSON
Version 1.2.0 PyPI version JSON
download
home_pageNone
SummaryA python package for processing 3d volumetric data to build meshes for the Sand Atlas data repository
upload_time2024-12-12 00:52:47
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords 3d data granular meshes particles sand volumetric
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Sand Atlas
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

[Documentation here](https://scigem.github.io/sand-atlas-python/), or compile it yourself following the details below.

## Installation
First, install `ffmpeg` and `blender` on your system. Both of these need to be available in your system path (so that running `ffmpeg` and `blender` in the command line works).

This package can then be installed via `pip install sand-atlas`. If installing from github, try cloning and then running:
```
pip install -e .
```
If you make any changes to the source code, re-run those two lines to have your changes reflected in your installed package.

## Usage

### Processing particles
If you are interested in reproducing a dataset that is available in the Sand Atlas, you can use the installed script `sand_atlas_process`, like so:

```
sand_atlas_process <path_to_json_file> --label <path_to_labelled_image> --raw <path_to_raw_image>
```

If you supply only the raw image, the script will attempt to label the image for you. If you supply the labelled image, the script will use that to generate the dataset. The `json` file contains the metadata for the dataset you are interested in. The `json` files for the datasets in the Sand Atlas are available [here](https://github.com/scigem/sand-atlas/tree/main/_data/sands).

### VDB files
VDB files are the industry standard for level set data. They can be viewed in recent versions of the open source software `blender`, via `Add -> Volume -> Import OpenVDB`. If you would like to use these files in a python environment that doesn't include the `pyopenvdb` package, you can use the `vdb_to_npy` script provided by the `sand_atlas` package to convert the VDB file to a numpy array:
```
vdb_to_npy <path_to_vdb_file>
```

This will produce a `.npy` file in the same directory where you run the script. You can then load this file in python with `np.load`:
```python
import numpy as np
data = np.load('path_to_npy_file.npy')
```

### Downloading particles from the python API
You can query the server to get a list of all of the available types of particles with
```
import sand_atlas
particles = sand_atlas.data.list()
print(particles)
```

If you would like to download all of the particles with a particular mesh quality to the current working directory, you do this via
```
import sand_atlas
sand_atlas.data.get_all('SAND-NAME', MESH-QUALITY)
```

If you would like to download a specific particle, you can do this via
```
import sand_atlas
sand_atlas.data.get_by_id('SAND-NAME', MESH-QUALITY, PARTICLE-ID)
```

## Documentation

We use `sphinx` to manage the docs. Update documentation with:
```
cd docs
make html
```
Once these are built, you can commit and push the changes to github to have them refreshed on github pages. You can also view them locally.
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sand-atlas",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "3d, data, granular, meshes, particles, sand, volumetric",
    "author": null,
    "author_email": "Benjy Marks <benjy.marks@sydney.edu.au>, Ilija Vego <ilija.vego@sydney.edu.au>",
    "download_url": "https://files.pythonhosted.org/packages/a3/b0/a831d366a686df3c411a8e1f451b2b07ba3d9a78b3ea886701566ab73082/sand_atlas-1.2.0.tar.gz",
    "platform": null,
    "description": "# Sand Atlas\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\n[Documentation here](https://scigem.github.io/sand-atlas-python/), or compile it yourself following the details below.\n\n## Installation\nFirst, install `ffmpeg` and `blender` on your system. Both of these need to be available in your system path (so that running `ffmpeg` and `blender` in the command line works).\n\nThis package can then be installed via `pip install sand-atlas`. If installing from github, try cloning and then running:\n```\npip install -e .\n```\nIf you make any changes to the source code, re-run those two lines to have your changes reflected in your installed package.\n\n## Usage\n\n### Processing particles\nIf you are interested in reproducing a dataset that is available in the Sand Atlas, you can use the installed script `sand_atlas_process`, like so:\n\n```\nsand_atlas_process <path_to_json_file> --label <path_to_labelled_image> --raw <path_to_raw_image>\n```\n\nIf you supply only the raw image, the script will attempt to label the image for you. If you supply the labelled image, the script will use that to generate the dataset. The `json` file contains the metadata for the dataset you are interested in. The `json` files for the datasets in the Sand Atlas are available [here](https://github.com/scigem/sand-atlas/tree/main/_data/sands).\n\n### VDB files\nVDB files are the industry standard for level set data. They can be viewed in recent versions of the open source software `blender`, via `Add -> Volume -> Import OpenVDB`. If you would like to use these files in a python environment that doesn't include the `pyopenvdb` package, you can use the `vdb_to_npy` script provided by the `sand_atlas` package to convert the VDB file to a numpy array:\n```\nvdb_to_npy <path_to_vdb_file>\n```\n\nThis will produce a `.npy` file in the same directory where you run the script. You can then load this file in python with `np.load`:\n```python\nimport numpy as np\ndata = np.load('path_to_npy_file.npy')\n```\n\n### Downloading particles from the python API\nYou can query the server to get a list of all of the available types of particles with\n```\nimport sand_atlas\nparticles = sand_atlas.data.list()\nprint(particles)\n```\n\nIf you would like to download all of the particles with a particular mesh quality to the current working directory, you do this via\n```\nimport sand_atlas\nsand_atlas.data.get_all('SAND-NAME', MESH-QUALITY)\n```\n\nIf you would like to download a specific particle, you can do this via\n```\nimport sand_atlas\nsand_atlas.data.get_by_id('SAND-NAME', MESH-QUALITY, PARTICLE-ID)\n```\n\n## Documentation\n\nWe use `sphinx` to manage the docs. Update documentation with:\n```\ncd docs\nmake html\n```\nOnce these are built, you can commit and push the changes to github to have them refreshed on github pages. You can also view them locally.",
    "bugtrack_url": null,
    "license": null,
    "summary": "A python package for processing 3d volumetric data to build meshes for the Sand Atlas data repository",
    "version": "1.2.0",
    "project_urls": {
        "Documentation": "https://github.com/scigem/sand-atlas-python/docs/index.html",
        "Homepage": "https://sand-atlas.scigem.com",
        "Repository": "https://github.com/scigem/sand-atlas-python.git"
    },
    "split_keywords": [
        "3d",
        " data",
        " granular",
        " meshes",
        " particles",
        " sand",
        " volumetric"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "431f46ba089a06c857d0fa14b5e7a77a947ae7291733b5bf63ba8e682c5c1376",
                "md5": "db31c51d0c476d83018372ccbcde2639",
                "sha256": "24122e0c0ac183f5d838f14d1f5ff1465b7b07cb2b7a1b3df8057224c975b8fd"
            },
            "downloads": -1,
            "filename": "sand_atlas-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "db31c51d0c476d83018372ccbcde2639",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 34608,
            "upload_time": "2024-12-12T00:52:46",
            "upload_time_iso_8601": "2024-12-12T00:52:46.180529Z",
            "url": "https://files.pythonhosted.org/packages/43/1f/46ba089a06c857d0fa14b5e7a77a947ae7291733b5bf63ba8e682c5c1376/sand_atlas-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a3b0a831d366a686df3c411a8e1f451b2b07ba3d9a78b3ea886701566ab73082",
                "md5": "f2a20d93bdac1d5f3752a8fe064e69e1",
                "sha256": "2004ab34f238d2fdfc7835fc2e525257be8e42e5c51bec26842b995329d6ac05"
            },
            "downloads": -1,
            "filename": "sand_atlas-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f2a20d93bdac1d5f3752a8fe064e69e1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 33781,
            "upload_time": "2024-12-12T00:52:47",
            "upload_time_iso_8601": "2024-12-12T00:52:47.633513Z",
            "url": "https://files.pythonhosted.org/packages/a3/b0/a831d366a686df3c411a8e1f451b2b07ba3d9a78b3ea886701566ab73082/sand_atlas-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-12 00:52:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "scigem",
    "github_project": "sand-atlas-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sand-atlas"
}
        
Elapsed time: 0.50901s