nakametpy.util module

nakametpy.util.anom_levels(levs)[source]

Return minus ans plus levels.

Parameters

levs (list`or`np.ndarray) –

Returns

anom levels

Return type

np.ndarray

Examples

>>> levs = [0.5, 1., 2.]
>>> print(anom_levels(levs))
[-2.  -1.  -0.5  0.5  1.   2. ]
nakametpy.util.check_tar_content(file)[source]

tar ファイルの中身のファイル名を表示する関数

Print the content name of the tar file.

Parameters

file (str) – file path ファイルのPATH

nakametpy.util.concat_array(*arr, sort=True)[source]

Return concatenated array in numpy.ndarray.

Parameters

arr (some of list`or`np.ndarray) –

Returns

concat_ndarray

Return type

np.ndarray

Examples

>>> levs = concat_array(np.arange(0.5, 2., 0.5), np.arange(2., 5.1, 1.))
>>> print(levs)
[0.5  1.   1.5  2.   2.5  3.   3.5  4.   4.5  5. ]
nakametpy.util.dt_ymdhm(date, opt=1)[source]

datetime.datetime から year, month, day, hour, minute の set を返す関数。 opt = 1 : string, 0 : int

Return the set of year, month, day, hour, minute from datetime.datetime.

Parameters
  • date (datetime.datetime) – datetime

  • opt (int) – return string or not

Returns

(year, month, day, hour, minute)

Return type

set

nakametpy.util.dt_yyyymmdd(date, fmt='yyyymmdd')[source]

datetime.datetime を yyyymmdd 形式の文字列で返す関数。

Return yyyymmdd format string from datetime.

Parameters
  • date (datetime.datetime) – datetime

  • fmt (str) – yyyymmdd format. Default is yyyymmdd

Returns

string in fmt.

Return type

str

nakametpy.util.get_gsmap_lat()[source]

GSMaPの緯度を返す関数

Returns

lat

Return type

numpy.ndarray

nakametpy.util.get_gsmap_lon()[source]

GSMaPの経度を返す関数

Returns

lon

Return type

numpy.ndarray

nakametpy.util.get_jmara_lat()[source]

解析雨量の緯度を返す関数

Returns

lat

Return type

numpy.ndarray

nakametpy.util.get_jmara_lon()[source]

解析雨量の経度を返す関数

Returns

lon

Return type

numpy.ndarray

nakametpy.util.load_jmara_grib2(file, tar_flag=False, tar_contentname=None)[source]

気象庁解析雨量やレーダー雨量を返す関数

欠損値は負の値として表現される

Parameters
  • file (str) – file path ファイルのPATH

  • tar_flag (bool) – file type whether file is tar or GRIB2 (not tar).

  • tar_contentname (str) – content name in tar file.

Returns

rain – Units(単位) [mm/h]

Return type

numpy.ma.MaskedArray

Note

jma_rain_lat , jma_rain_lon はそれぞれ返り値に対応する np.ndarray 型の緯度経度である。

nakametpy.util.myglob(path, reverse=False)[source]

Return sorted glob results. :param path: :type path: str :param reverse: :type reverse: bool

nakametpy.util.unit_knots_ms1(kt)[source]

Convert unit knots into m/s.

Parameters

kt (int) – Velocity in knots.

Returns

Velocity in meter per second.

Return type

ms

nakametpy.util.unit_ms1_knots(ms)[source]

Convert unit m/s into knots.

Parameters

ms (int) – Velocity in meter per second.

Returns

Velocity in knots.

Return type

kt