Giter Club home page Giter Club logo

msmgrib2decorder's Introduction

MSMgrib2Decorder

気象庁が提供する数値予報GPVのgribファイルをデコードして地上から上層までの風でpandas.DataFrameを生成するスクリプト。

gribファイルの処理ではNOAAが提供するデコードツールであるwgrib2が標準的であるが、 データをpandasで処理するには一旦ファイル出力を噛ませる必要があるので、風に絞ることでpythonネイティブでデコードできるツールを作成。

Usage

from MSMgribDecorder import decord_MSMwind, decord_GSMwind

# MSM
df_result = decord_MSMwind("Z__...Lsurf...bin", "Z__...L-pall...bin", 25.0, 130.0, 3)

# GSM
df_result = decord_GSMwind("Z__....bin", 25.0, 130.0, 0)

input(MSM)

1st argument: 地表面grib2ファイル(Z__C_RJTD_yyyymmddhh0000_MSM_GPV_Rjp_Lsurf_FH00-15_grib2.bin)

2nd argument: 気圧面grib2ファイル(Z__C_RJTD_yyyymmddhh0000_MSM_GPV_Rjp_L-pall_FH00-15_grib2.bin)

3rd argument: 緯度[deg]

4th argument: 経度[deg]

5th argument: gribファイル計算時刻から取得する予報時刻の差分時間(0, 3, 6, 9, ...のようにgribファイルの上限に応じて3時間毎)

input(GSM)

1st argument: grib2ファイル(Z__C_RJTD_yyyymmddhh0000_GSM_GPV_Rgl_FD0000_grib2.bin)

2nd argument: 緯度[deg]

3rd argument: 経度[deg]

4th argument: gribファイル計算時刻から取得する予報時刻の差分時間(0, 6, 12, 18)のgribファイルの上限に応じて6時間毎)

output

pandas.DataFrame

height(高度[m]) pressure(気圧[kPa]) u-wind(東西方向の風速[m/s]) v-wind(南北方向の風速[m/s]) wind_velocity(風速[m/s]) wind_direction(北から時計回りの風向[deg])
10 101.9 -2.0 2.0 2.83 315.0
130.0 100.0 . . . .
. . . . . .
. . . . . .

License

MIT License

msmgrib2decorder's People

Contributors

sus304 avatar

Watchers

 avatar

Forkers

ryutakitamura

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.