pynusdas


Namepynusdas JSON
Version 0.0.3 PyPI version JSON
download
home_pageNone
SummaryPython interface for the JMA's NuSDaS format
upload_time2024-08-20 19:34:47
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License Copyright (c) 2024 Takumi Matsunobu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pynus
[![PyPI - Version](https://img.shields.io/pypi/v/pynusdas)](https://pypi.org/project/pynusdas/)
![Static Badge](https://img.shields.io/badge/NuSDaS-_1.1---blue)

A python library enabling to handle files in the NuSDaS format operationally used in the NWP systems in JMA.  
You will find Japanese readme [below](#Japanese).

## Usage

***Install using pip***  
I like the name "pynus", but this library is distibuted as "pynusdas" package in PyPI. 
```sh
pip install pynusdas
```

***Feed a NuSDaS file and get full xarray Datasets***  
`decode_nusdas` function returns you fully loaded xarray Datasets. This is handy when you want to simply convert the entire dataset into netcdf.  
```Python
from pynus import decode_nusdas

mdls, surfs = decode_nusdas(f"./data/fcst_mdl.nus/ZSSTD1/200910070000")

mdls.to_netcdf(f"./data/MF10km_MDLL_200910070000.nc")
surfs.to_netcdf(f"./data/MF10km_SURF_200910070000.nc")
```

***Lazy-loading with xarray using pynus as an engine***  
You can also use `xr.open_dataset` function with specifying `engine='pynus'` or `engine='pynusdas'`. More suitable when you handle a dataset intreactively e.g. in jupyter notebook. 
```Python
mdls = xr.open_dataset(f"./data/fcst_mdl.nus/ZSSTD1/200910070000",
                          engine="pynus", chunks={"x": 19, "y": 17},)
print(mdls)
```


## Disclaimer
This library is **NOT** an official project of JMA. Don't send any inquiries to JMA regarding this project.

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Acknowledgement
This work is inspired and partly coming from by the tutorial codes on the Laboratory of Meteorology website at Hokkaido University.  
<https://geodynamics.sci.hokudai.ac.jp/humet/meteo/tutorial.html>



## Japanese

pynusは気象庁の現業気象予報システムで使用されているNuSDaSフォーマットで記述されたファイルをpythonで簡便に読み込むことを目的としたライブラリです。

***使いかた***  
PyPIでは "pynusdas" パッケージとして登録されているため以下のコマンドでインストールできます。
```sh
pip install pynusdas
```

***NuSDaSファイルを丸ごと読み込む***  
`decode_nusdas` 関数にNuSDaSファイルのパスを渡すことで全ての変数をxarray datasetとして読み込みます。返されるデータセットは地上と大気成分に別れた2つのデータセットです。この関数はnetcdf形式への変換などデータセット全体に対し作業するときに便利です。

```Python
from pynus import decode_nusdas

mdls, surfs = decode_nusdas(f"./data/fcst_mdl.nus/ZSSTD1/200910070000")

mdls.to_netcdf(f"./data/MF10km_MDLL_200910070000.nc")
surfs.to_netcdf(f"./data/MF10km_SURF_200910070000.nc")
```

***xarray.open_datasetを用いて逐次読み込む***  
`xr.open_dataset`関数の引数に`engine="pynus"`または`engine="pynusdas"`を指定することでnetcdfファイルの読み込みと同じ感覚で作業することも可能です。Jupyter notebookでの描画などデータのごく一部のみを逐次読み出すときに便利です。
```Python
mdls = xr.open_dataset(f"./data/fcst_mdl.nus/ZSSTD1/200910070000",
                          engine="pynus", chunks={"x": 19, "y": 17},)
print(mdls)
```

***免責事項***  
このライブラリの開発は気象庁および関連機関の業務とは**一切関係がございません**。気象庁および関係者の方へのこのライブラリに関する問い合わせはお控えください。


***謝辞***  
ライブラリのコードは北海道大学気象学研究室のチュートリアルをベースにさせていただきました。ここに感謝を申し上げます。  
<https://geodynamics.sci.hokudai.ac.jp/humet/meteo/tutorial.html>



            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pynusdas",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/53/29/4417585437997c743819304cda000fc7af173368fc0d51774a0a8185b590/pynusdas-0.0.3.tar.gz",
    "platform": null,
    "description": "# pynus\n[![PyPI - Version](https://img.shields.io/pypi/v/pynusdas)](https://pypi.org/project/pynusdas/)\n![Static Badge](https://img.shields.io/badge/NuSDaS-_1.1---blue)\n\nA python library enabling to handle files in the NuSDaS format operationally used in the NWP systems in JMA.  \nYou will find Japanese readme [below](#Japanese).\n\n## Usage\n\n***Install using pip***  \nI like the name \"pynus\", but this library is distibuted as \"pynusdas\" package in PyPI. \n```sh\npip install pynusdas\n```\n\n***Feed a NuSDaS file and get full xarray Datasets***  \n`decode_nusdas` function returns you fully loaded xarray Datasets. This is handy when you want to simply convert the entire dataset into netcdf.  \n```Python\nfrom pynus import decode_nusdas\n\nmdls, surfs = decode_nusdas(f\"./data/fcst_mdl.nus/ZSSTD1/200910070000\")\n\nmdls.to_netcdf(f\"./data/MF10km_MDLL_200910070000.nc\")\nsurfs.to_netcdf(f\"./data/MF10km_SURF_200910070000.nc\")\n```\n\n***Lazy-loading with xarray using pynus as an engine***  \nYou can also use `xr.open_dataset` function with specifying `engine='pynus'` or `engine='pynusdas'`. More suitable when you handle a dataset intreactively e.g. in jupyter notebook. \n```Python\nmdls = xr.open_dataset(f\"./data/fcst_mdl.nus/ZSSTD1/200910070000\",\n                          engine=\"pynus\", chunks={\"x\": 19, \"y\": 17},)\nprint(mdls)\n```\n\n\n## Disclaimer\nThis library is **NOT** an official project of JMA. Don't send any inquiries to JMA regarding this project.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgement\nThis work is inspired and partly coming from by the tutorial codes on the Laboratory of Meteorology website at Hokkaido University.  \n<https://geodynamics.sci.hokudai.ac.jp/humet/meteo/tutorial.html>\n\n\n\n## Japanese\n\npynus\u306f\u6c17\u8c61\u5e81\u306e\u73fe\u696d\u6c17\u8c61\u4e88\u5831\u30b7\u30b9\u30c6\u30e0\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u308bNuSDaS\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u8a18\u8ff0\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092python\u3067\u7c21\u4fbf\u306b\u8aad\u307f\u8fbc\u3080\u3053\u3068\u3092\u76ee\u7684\u3068\u3057\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\n\n***\u4f7f\u3044\u304b\u305f***  \nPyPI\u3067\u306f \"pynusdas\" \u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u3057\u3066\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002\n```sh\npip install pynusdas\n```\n\n***NuSDaS\u30d5\u30a1\u30a4\u30eb\u3092\u4e38\u3054\u3068\u8aad\u307f\u8fbc\u3080***  \n`decode_nusdas` \u95a2\u6570\u306bNuSDaS\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u6e21\u3059\u3053\u3068\u3067\u5168\u3066\u306e\u5909\u6570\u3092xarray dataset\u3068\u3057\u3066\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002\u8fd4\u3055\u308c\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306f\u5730\u4e0a\u3068\u5927\u6c17\u6210\u5206\u306b\u5225\u308c\u305f2\u3064\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u3059\u3002\u3053\u306e\u95a2\u6570\u306fnetcdf\u5f62\u5f0f\u3078\u306e\u5909\u63db\u306a\u3069\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u5168\u4f53\u306b\u5bfe\u3057\u4f5c\u696d\u3059\u308b\u3068\u304d\u306b\u4fbf\u5229\u3067\u3059\u3002\n\n```Python\nfrom pynus import decode_nusdas\n\nmdls, surfs = decode_nusdas(f\"./data/fcst_mdl.nus/ZSSTD1/200910070000\")\n\nmdls.to_netcdf(f\"./data/MF10km_MDLL_200910070000.nc\")\nsurfs.to_netcdf(f\"./data/MF10km_SURF_200910070000.nc\")\n```\n\n***xarray.open_dataset\u3092\u7528\u3044\u3066\u9010\u6b21\u8aad\u307f\u8fbc\u3080***  \n`xr.open_dataset`\u95a2\u6570\u306e\u5f15\u6570\u306b`engine=\"pynus\"`\u307e\u305f\u306f`engine=\"pynusdas\"`\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067netcdf\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u3068\u540c\u3058\u611f\u899a\u3067\u4f5c\u696d\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002Jupyter notebook\u3067\u306e\u63cf\u753b\u306a\u3069\u30c7\u30fc\u30bf\u306e\u3054\u304f\u4e00\u90e8\u306e\u307f\u3092\u9010\u6b21\u8aad\u307f\u51fa\u3059\u3068\u304d\u306b\u4fbf\u5229\u3067\u3059\u3002\n```Python\nmdls = xr.open_dataset(f\"./data/fcst_mdl.nus/ZSSTD1/200910070000\",\n                          engine=\"pynus\", chunks={\"x\": 19, \"y\": 17},)\nprint(mdls)\n```\n\n***\u514d\u8cac\u4e8b\u9805***  \n\u3053\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u958b\u767a\u306f\u6c17\u8c61\u5e81\u304a\u3088\u3073\u95a2\u9023\u6a5f\u95a2\u306e\u696d\u52d9\u3068\u306f**\u4e00\u5207\u95a2\u4fc2\u304c\u3054\u3056\u3044\u307e\u305b\u3093**\u3002\u6c17\u8c61\u5e81\u304a\u3088\u3073\u95a2\u4fc2\u8005\u306e\u65b9\u3078\u306e\u3053\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u95a2\u3059\u308b\u554f\u3044\u5408\u308f\u305b\u306f\u304a\u63a7\u3048\u304f\u3060\u3055\u3044\u3002\n\n\n***\u8b1d\u8f9e***  \n\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30b3\u30fc\u30c9\u306f\u5317\u6d77\u9053\u5927\u5b66\u6c17\u8c61\u5b66\u7814\u7a76\u5ba4\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u30d9\u30fc\u30b9\u306b\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002\u3053\u3053\u306b\u611f\u8b1d\u3092\u7533\u3057\u4e0a\u3052\u307e\u3059\u3002  \n<https://geodynamics.sci.hokudai.ac.jp/humet/meteo/tutorial.html>\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Takumi Matsunobu  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Python interface for the JMA's NuSDaS format",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/tkmim/pynus",
        "Repository": "https://github.com/tkmim/pynus.git"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "57cf0c10d85fe5caeda6ad659c87da9ddd7cec3eb9140d1659e358f775208d67",
                "md5": "96d28d8372d5c8dc0d409ee2b41bb8d9",
                "sha256": "c401e4ace40b9dc551980e9310f62730bba3df6497cd39020f76c8007a6f9b8a"
            },
            "downloads": -1,
            "filename": "pynusdas-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "96d28d8372d5c8dc0d409ee2b41bb8d9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 9392,
            "upload_time": "2024-08-20T19:34:45",
            "upload_time_iso_8601": "2024-08-20T19:34:45.570258Z",
            "url": "https://files.pythonhosted.org/packages/57/cf/0c10d85fe5caeda6ad659c87da9ddd7cec3eb9140d1659e358f775208d67/pynusdas-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "53294417585437997c743819304cda000fc7af173368fc0d51774a0a8185b590",
                "md5": "aee1053ca3d007865cfe50db3234033d",
                "sha256": "196007d794cadc275331c64d2da8f768a62d66aac7c2b3dcd8eb3af0c8b6bb21"
            },
            "downloads": -1,
            "filename": "pynusdas-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "aee1053ca3d007865cfe50db3234033d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 8628,
            "upload_time": "2024-08-20T19:34:47",
            "upload_time_iso_8601": "2024-08-20T19:34:47.006215Z",
            "url": "https://files.pythonhosted.org/packages/53/29/4417585437997c743819304cda000fc7af173368fc0d51774a0a8185b590/pynusdas-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-20 19:34:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tkmim",
    "github_project": "pynus",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pynusdas"
}
        
Elapsed time: 0.44238s