Way2DSSAT


NameWay2DSSAT JSON
Version 0.0.11 PyPI version JSON
download
home_pageNone
SummaryPackage to handle input DSSAT files
upload_time2024-05-08 15:51:25
maintainerNone
docs_urlNone
authorManavjot Singh
requires_python>=3.8
licenseNone
keywords python dssat input gssurgo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # README
This is a package to handle DSSAT input and output files

## ```Way2DSSAT.SOL()``` : Creates DSSAT Soil File (SG.SOL)
 Use `Way2DSSAT.SOL("path/to/you/gssurgo.csv")` to create a soil file first. The funciton will save a SG.SOL file. It also returns a dictionary of soil depth:SDUL which will be used as intial conditions in the Xfile. a string of MUKEYS of all the soil profiles created. 
 If you have multiple soil profiles in the csv exported from GSSURGO data, different soil profiles will be created with name convention of soil ID as "SGG"+"MUKEY".eg. GSS2733103.
 
Since the funciton is designed to handle the csv generated from gSSURGO soil database. It is aware of the column names which the gSSURGO arcmap toolbox generates. Thus no need to remove any columns containing .pct string in the column name. 

**Columns required**:

        * path to your .csv file containing the data from gSSURGO. Must have the following columns(and other related depths)
        * WC15Bar_DCP_0to5
        * WC3rdbar_DCP_0to5
        * Clay_DCP_0to5
        * Silt_DCP_0to5
        * pHwater_DCP_0to5
        * CEC_DCP_0to5
        * Db3rdbar_DCP_0to5
        * Ksat_DCP_0to5
        * OrgMatter_DCP_0to5
        * MUKEY_DCP_0to5 
 
 
**Important**Save the returned dicitonary to a variable
For eg.
returned dictionary is: 

{'GSS2733103': {5: 0.2, 15: 0.2, 30: 0.2, 60: 0.2, 100: 0.338, 200: 0.308},
 'GSS2733104': {5: 0.2, 15: 0.2, 30: 0.2, 60: 0.2, 100: 0.338, 200: 0.308}}
 
- 'GSS2733103' is soil ID (individual soil profile)
- {5: 0.2, 15: 0.2, 30: 0.2, 60: 0.2, 100: 0.338, 200: 0.308} is a dictinary of key=depth, value=SDUL.

Incase of multiple profiles (as here), there is a need to further save the Individual sub-dictionaries(nested dictionary) to different variables. Individual sub-dictionary has to be provided as the Input argument Inside the `Way2DSSAT.Xfile()` funciton.

### Example

```
path = 'Username/pathtothecsv'.
A,B = Way2DSSAT.SOL(path)
```
A is the returned dictionary
B is the list of (MUKEYS) Soil profiles
***

## ```Way2DSSAT.WTH()``` : Creates .WTH file

This function creates a weather file of DSSAT format .WTH by taking input as paath to the .csv file contaitng weather data. The funciton is writes single year data thus csv should contain data from once year. Although it will create .WTH file even if the data is not from a single year but the name of the outputfile will be saved using the year of first row of the .csv.

The funciton also returns the name of the file created. 

**Following columns are required**
        - 'SRAD','Tmax','Tmin','Rain','timedate' 
        - 'timedate' in format = '%m/%d/%Y'


### Example
```
path = "path/to/your/weatherdata.csv"
Way2DSSAT.WTH(path,
        stname = 'ABCd',
        latitude= 34.583,
        longitude= -103.200,
        elevation= 1348)
```        

***

## ```Way2DSSAT.Xfile()``` : Creates .SNX file

It creates DSSAT seasonal file (.SNX) from a reference template. Click [here](https://github.com/ManavjotSingh97/Way2DSSAT/blob/main/Seasonl/KSMR6301.SNX) to download 

The [dictionary](#```Way2DSSAT.SOL()```-:-Creates-DSSAT-Soil-File-(SG.SOL)) created above using ```.SOL``` funciton is used as an argument along with other arguments as shown here

```

A,B = Way2DSSAT("path/to/csvfromssurgo.csv")
print(A)

#this will return
```

{'GSS2733103': {5: 0.2, 15: 0.2, 30: 0.2, 60: 0.2, 100: 0.338, 200: 0.308},
 'GSS2733104': {5: 0.2, 15: 0.2, 30: 0.2, 60: 0.2, 100: 0.338, 200: 0.308}}

We need **{5: 0.2, 15: 0.2, 30: 0.2, 60: 0.2, 100: 0.338, 200: 0.308}**

```
path = 'path/to/template.SNX'
init_cond = A['GSS2733103'] #Relace with the soil id you get from print(A)

Xfile(path,init_cond,site_name = '-99',station = 'ABCD',soil = 'GSS2733103',
          crop = 'SB',cultivar = 'NE0006 NECPHA4 2014',planting_date = '24145')

#replace the default information 
```
> **All the output files are stored in CWD**


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "Way2DSSAT",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "python, DSSAT, Input, gSSURGO",
    "author": "Manavjot Singh",
    "author_email": "Manavjot <manavjotsingh97@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/75/b9/a1734402afdbb569992f23ef72f6296bf485743c3df826f90693cf0a1870/way2dssat-0.0.11.tar.gz",
    "platform": null,
    "description": "# README\r\nThis is a package to handle DSSAT input and output files\r\n\r\n## ```Way2DSSAT.SOL()``` : Creates DSSAT Soil File (SG.SOL)\r\n Use `Way2DSSAT.SOL(\"path/to/you/gssurgo.csv\")` to create a soil file first. The funciton will save a SG.SOL file. It also returns a dictionary of soil depth:SDUL which will be used as intial conditions in the Xfile. a string of MUKEYS of all the soil profiles created. \r\n If you have multiple soil profiles in the csv exported from GSSURGO data, different soil profiles will be created with name convention of soil ID as \"SGG\"+\"MUKEY\".eg. GSS2733103.\r\n \r\nSince the funciton is designed to handle the csv generated from gSSURGO soil database. It is aware of the column names which the gSSURGO arcmap toolbox generates. Thus no need to remove any columns containing .pct string in the column name. \r\n\r\n**Columns required**:\r\n\r\n        * path to your .csv file containing the data from gSSURGO. Must have the following columns(and other related depths)\r\n        * WC15Bar_DCP_0to5\r\n        * WC3rdbar_DCP_0to5\r\n        * Clay_DCP_0to5\r\n        * Silt_DCP_0to5\r\n        * pHwater_DCP_0to5\r\n        * CEC_DCP_0to5\r\n        * Db3rdbar_DCP_0to5\r\n        * Ksat_DCP_0to5\r\n        * OrgMatter_DCP_0to5\r\n        * MUKEY_DCP_0to5 \r\n \r\n \r\n**Important**Save the returned dicitonary to a variable\r\nFor eg.\r\nreturned dictionary is: \r\n\r\n{'GSS2733103': {5: 0.2, 15: 0.2, 30: 0.2, 60: 0.2, 100: 0.338, 200: 0.308},\r\n 'GSS2733104': {5: 0.2, 15: 0.2, 30: 0.2, 60: 0.2, 100: 0.338, 200: 0.308}}\r\n \r\n- 'GSS2733103' is soil ID (individual soil profile)\r\n- {5: 0.2, 15: 0.2, 30: 0.2, 60: 0.2, 100: 0.338, 200: 0.308} is a dictinary of key=depth, value=SDUL.\r\n\r\nIncase of multiple profiles (as here), there is a need to further save the Individual sub-dictionaries(nested dictionary) to different variables. Individual sub-dictionary has to be provided as the Input argument Inside the `Way2DSSAT.Xfile()` funciton.\r\n\r\n### Example\r\n\r\n```\r\npath = 'Username/pathtothecsv'.\r\nA,B = Way2DSSAT.SOL(path)\r\n```\r\nA is the returned dictionary\r\nB is the list of (MUKEYS) Soil profiles\r\n***\r\n\r\n## ```Way2DSSAT.WTH()``` : Creates .WTH file\r\n\r\nThis function creates a weather file of DSSAT format .WTH by taking input as paath to the .csv file contaitng weather data. The funciton is writes single year data thus csv should contain data from once year. Although it will create .WTH file even if the data is not from a single year but the name of the outputfile will be saved using the year of first row of the .csv.\r\n\r\nThe funciton also returns the name of the file created. \r\n\r\n**Following columns are required**\r\n        - 'SRAD','Tmax','Tmin','Rain','timedate' \r\n        - 'timedate' in format = '%m/%d/%Y'\r\n\r\n\r\n### Example\r\n```\r\npath = \"path/to/your/weatherdata.csv\"\r\nWay2DSSAT.WTH(path,\r\n        stname = 'ABCd',\r\n        latitude= 34.583,\r\n        longitude= -103.200,\r\n        elevation= 1348)\r\n```        \r\n\r\n***\r\n\r\n## ```Way2DSSAT.Xfile()``` : Creates .SNX file\r\n\r\nIt creates DSSAT seasonal file (.SNX) from a reference template. Click [here](https://github.com/ManavjotSingh97/Way2DSSAT/blob/main/Seasonl/KSMR6301.SNX) to download \r\n\r\nThe [dictionary](#```Way2DSSAT.SOL()```-:-Creates-DSSAT-Soil-File-(SG.SOL)) created above using ```.SOL``` funciton is used as an argument along with other arguments as shown here\r\n\r\n```\r\n\r\nA,B = Way2DSSAT(\"path/to/csvfromssurgo.csv\")\r\nprint(A)\r\n\r\n#this will return\r\n```\r\n\r\n{'GSS2733103': {5: 0.2, 15: 0.2, 30: 0.2, 60: 0.2, 100: 0.338, 200: 0.308},\r\n 'GSS2733104': {5: 0.2, 15: 0.2, 30: 0.2, 60: 0.2, 100: 0.338, 200: 0.308}}\r\n\r\nWe need **{5: 0.2, 15: 0.2, 30: 0.2, 60: 0.2, 100: 0.338, 200: 0.308}**\r\n\r\n```\r\npath = 'path/to/template.SNX'\r\ninit_cond = A['GSS2733103'] #Relace with the soil id you get from print(A)\r\n\r\nXfile(path,init_cond,site_name = '-99',station = 'ABCD',soil = 'GSS2733103',\r\n          crop = 'SB',cultivar = 'NE0006 NECPHA4 2014',planting_date = '24145')\r\n\r\n#replace the default information \r\n```\r\n> **All the output files are stored in CWD**\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Package to handle input DSSAT files",
    "version": "0.0.11",
    "project_urls": {
        "Homepage": "https://github.com/ManavjotSingh97/Way2DSSAT",
        "Issues": "https://github.com/ManavjotSingh97/Way2DSSAT/issues"
    },
    "split_keywords": [
        "python",
        " dssat",
        " input",
        " gssurgo"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b004743149a066c0a74626c8214fa571a5cd7e022865bce02148b81ccab065a6",
                "md5": "b43b2d60f9da17d27f4c2093b493aec6",
                "sha256": "8d0d3cd6240f7165a98fb3be62e76b2cdd975f3a346427188b236d1df8593c31"
            },
            "downloads": -1,
            "filename": "Way2DSSAT-0.0.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b43b2d60f9da17d27f4c2093b493aec6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 9645,
            "upload_time": "2024-05-08T15:51:22",
            "upload_time_iso_8601": "2024-05-08T15:51:22.974008Z",
            "url": "https://files.pythonhosted.org/packages/b0/04/743149a066c0a74626c8214fa571a5cd7e022865bce02148b81ccab065a6/Way2DSSAT-0.0.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "75b9a1734402afdbb569992f23ef72f6296bf485743c3df826f90693cf0a1870",
                "md5": "54cce944334ed285bc0767fb61c71b00",
                "sha256": "e5a8361c957eea4dccd992389faef82a661c7737898588615c3bbd097bec9312"
            },
            "downloads": -1,
            "filename": "way2dssat-0.0.11.tar.gz",
            "has_sig": false,
            "md5_digest": "54cce944334ed285bc0767fb61c71b00",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 10028,
            "upload_time": "2024-05-08T15:51:25",
            "upload_time_iso_8601": "2024-05-08T15:51:25.191091Z",
            "url": "https://files.pythonhosted.org/packages/75/b9/a1734402afdbb569992f23ef72f6296bf485743c3df826f90693cf0a1870/way2dssat-0.0.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-08 15:51:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ManavjotSingh97",
    "github_project": "Way2DSSAT",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "way2dssat"
}
        
Elapsed time: 0.27406s