hipims-io


Namehipims-io JSON
Version 0.6.3 PyPI version JSON
download
home_pagehttps://github.com/mingxiaodong/hipims_io_python
SummaryTo process input and output files of the HiPIMS model
upload_time2024-04-27 15:05:12
maintainerNone
docs_urlNone
authorXiaodong Ming
requires_python>=3.6
licenseLICENSE.txt
keywords hipims model io
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            hipims_io
--------
Python code to process input and output files of [HiPIMS flood model](https://www.hemlab.org/models/). This code follows [Google Python Style Guide](http://google.github.io/styleguide/pyguide.html).

Python version: >=3.6. The main content of this package is also included in a [Python API of HiPIMS](https://pypims.readthedocs.io/en/latest/).

To install hipims_io from command window/terminal:
```
pip install hipims_io
```
To install using github repo:
```
git clone https://github.com/mingxiaodong/hipims_io_python.git
cd hipims_io_python
pip install .
```

A quick demonstration to setup a HiPIMS input object with a sample DEM:
```
import hipims_io as hp
obj_in = hp.demo_input() # create an input object and show domain map
```
A quick demonstration to setup a HiPIMS input object with a data path contaning the following files:
- DEM.gz/.asc/.tif (essential file, in projected crs)
- rain_mask.gz/.asc/.tif (optional file for setting rainfall, having the same crs with DEM)
- rain_source.csv (optional file for setting rainfall rate in timeseries]
- landcover.gz/.asc/.tif (optional file for setting landcover-based parameters, having the same crs with DEM)

```
import os
import hipims_io as hp
from hipims_io.demo_functions import get_sample_data
dem_path, _ = get_sample_data(return_path=True) # get the path of sample data
data_path = os.path.dirname(dem_path)
case_folder = os.path.join(os.getcwd(), 'hipims_case') # define a case folder in the current directory
obj_in = hp.InputHipims(case_folder=case_folder, num_of_sections=1, 
                          data_path=data_path) # create input object
obj_in.domain_show() # show domain map
print(obj_in) # show case information
```

A step-by-step tutorial to setup a HiPIMS input object with sample data:


```
import os
import numpy as np
import hipims_io as hp

dem_file, model_data, _ = hp.get_sample_data() # get sample data
case_folder = os.path.join(os.getcwd(), 'hipims_case') # define a case folder in the current directory
# create a single-gpu input object
obj_in = hp.InputHipims(dem_data=dem_file, num_of_sections=1, case_folder=case_folder)

# set a initial water depth of 0.5 m
obj_in.set_initial_condition('h0', 0.5)

# set boundary condition
bound_list = model_data['boundary_condition'] # with boundary information
obj_in.set_boundary_condition(bound_list, outline_boundary='fall')

# set rainfall mask and source
rain_source = model_data['rain_source']
obj_in.set_rainfall(rain_mask=0, rain_source=rain_source)

# set manning parameter
manning_array = np.zeros(obj_in.DEM.shape)+0.03 # create an array with the same shape of the DEM array
obj_in.set_grid_parameter(manning=manning_array)

# set monitor positions
gauges_pos = model_data['gauges_pos']
obj_in.set_gauges_position(gauges_pos) 

# display model information
obj_in.domain_show() # show domain map
print(obj_in) # print model summary

# write all input files for HiPIMS to the case folder
obj_in.write_input_files() 

```

The domain map will be shown like this:

![Domain map](https://github.com/mingxiaodong/hipims_io_python/blob/master/hipims_io/sample/domain_map.png)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mingxiaodong/hipims_io_python",
    "name": "hipims-io",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "HiPIMS model IO",
    "author": "Xiaodong Ming",
    "author_email": "x.ming@lboro.ac.uk",
    "download_url": "https://files.pythonhosted.org/packages/cc/89/8fa880603c5f5ed19d0cbcc884bf61a6ba9945a7b8c30cc69f9f0e4df3a8/hipims_io-0.6.3.tar.gz",
    "platform": null,
    "description": "hipims_io\n--------\nPython code to process input and output files of [HiPIMS flood model](https://www.hemlab.org/models/). This code follows [Google Python Style Guide](http://google.github.io/styleguide/pyguide.html).\n\nPython version: >=3.6. The main content of this package is also included in a [Python API of HiPIMS](https://pypims.readthedocs.io/en/latest/).\n\nTo install hipims_io from command window/terminal:\n```\npip install hipims_io\n```\nTo install using github repo:\n```\ngit clone https://github.com/mingxiaodong/hipims_io_python.git\ncd hipims_io_python\npip install .\n```\n\nA quick demonstration to setup a HiPIMS input object with a sample DEM:\n```\nimport hipims_io as hp\nobj_in = hp.demo_input() # create an input object and show domain map\n```\nA quick demonstration to setup a HiPIMS input object with a data path contaning the following files:\n- DEM.gz/.asc/.tif (essential file, in projected crs)\n- rain_mask.gz/.asc/.tif (optional file for setting rainfall, having the same crs with DEM)\n- rain_source.csv (optional file for setting rainfall rate in timeseries]\n- landcover.gz/.asc/.tif (optional file for setting landcover-based parameters, having the same crs with DEM)\n\n```\nimport os\nimport hipims_io as hp\nfrom hipims_io.demo_functions import get_sample_data\ndem_path, _ = get_sample_data(return_path=True) # get the path of sample data\ndata_path = os.path.dirname(dem_path)\ncase_folder = os.path.join(os.getcwd(), 'hipims_case') # define a case folder in the current directory\nobj_in = hp.InputHipims(case_folder=case_folder, num_of_sections=1, \n                          data_path=data_path) # create input object\nobj_in.domain_show() # show domain map\nprint(obj_in) # show case information\n```\n\nA step-by-step tutorial to setup a HiPIMS input object with sample data:\n\n\n```\nimport os\nimport numpy as np\nimport hipims_io as hp\n\ndem_file, model_data, _ = hp.get_sample_data() # get sample data\ncase_folder = os.path.join(os.getcwd(), 'hipims_case') # define a case folder in the current directory\n# create a single-gpu input object\nobj_in = hp.InputHipims(dem_data=dem_file, num_of_sections=1, case_folder=case_folder)\n\n# set a initial water depth of 0.5 m\nobj_in.set_initial_condition('h0', 0.5)\n\n# set boundary condition\nbound_list = model_data['boundary_condition'] # with boundary information\nobj_in.set_boundary_condition(bound_list, outline_boundary='fall')\n\n# set rainfall mask and source\nrain_source = model_data['rain_source']\nobj_in.set_rainfall(rain_mask=0, rain_source=rain_source)\n\n# set manning parameter\nmanning_array = np.zeros(obj_in.DEM.shape)+0.03 # create an array with the same shape of the DEM array\nobj_in.set_grid_parameter(manning=manning_array)\n\n# set monitor positions\ngauges_pos = model_data['gauges_pos']\nobj_in.set_gauges_position(gauges_pos) \n\n# display model information\nobj_in.domain_show() # show domain map\nprint(obj_in) # print model summary\n\n# write all input files for HiPIMS to the case folder\nobj_in.write_input_files() \n\n```\n\nThe domain map will be shown like this:\n\n![Domain map](https://github.com/mingxiaodong/hipims_io_python/blob/master/hipims_io/sample/domain_map.png)\n\n\n",
    "bugtrack_url": null,
    "license": "LICENSE.txt",
    "summary": "To process input and output files of the HiPIMS model",
    "version": "0.6.3",
    "project_urls": {
        "Homepage": "https://github.com/mingxiaodong/hipims_io_python"
    },
    "split_keywords": [
        "hipims",
        "model",
        "io"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "05bdda16e016f137c8f9b32411c81247be3676b997e77960a86db3b1ad6d7735",
                "md5": "4487a60b1435e596db260b3bb8c3374b",
                "sha256": "ceb29f9c11185c2f900b5804037a32d2137ab23a86ba232a72eb774e5d62fbbe"
            },
            "downloads": -1,
            "filename": "hipims_io-0.6.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4487a60b1435e596db260b3bb8c3374b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 161253,
            "upload_time": "2024-04-27T15:05:09",
            "upload_time_iso_8601": "2024-04-27T15:05:09.828486Z",
            "url": "https://files.pythonhosted.org/packages/05/bd/da16e016f137c8f9b32411c81247be3676b997e77960a86db3b1ad6d7735/hipims_io-0.6.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cc898fa880603c5f5ed19d0cbcc884bf61a6ba9945a7b8c30cc69f9f0e4df3a8",
                "md5": "b7058784ec03f2e21b4eb648a142574f",
                "sha256": "5b8d187a49ab63febe65f30351d7d80c61f2e3c8cef432d513416c148967069e"
            },
            "downloads": -1,
            "filename": "hipims_io-0.6.3.tar.gz",
            "has_sig": false,
            "md5_digest": "b7058784ec03f2e21b4eb648a142574f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 141967,
            "upload_time": "2024-04-27T15:05:12",
            "upload_time_iso_8601": "2024-04-27T15:05:12.399108Z",
            "url": "https://files.pythonhosted.org/packages/cc/89/8fa880603c5f5ed19d0cbcc884bf61a6ba9945a7b8c30cc69f9f0e4df3a8/hipims_io-0.6.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-27 15:05:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mingxiaodong",
    "github_project": "hipims_io_python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "hipims-io"
}
        
Elapsed time: 0.23714s