Giter Site home page Giter Site logo

meteva's Introduction

全流程检验程序库(whole process evaluation program library of weather forecast)

MetEva程序库由国家气象中心预报技术研发室检验科负责研发,旨在为从数值模式、客观方法、精细化网格预报到预报产品的应用的整个气象产品制作流程中的每个环节进行快速高效的检验,促进跨流程跨部门的检验信息共享,为推进研究型业务和改进预报质量提供技术支撑。
The MetEva program library is developed by the Laboratory Division of the Forecast Technology Research and Development Office of the National Meteorological Center. It aims to quickly and efficiently inspect each process in the entire meteorological product production process from numerical models, objective methods, refined grid forecasting to the application of forecast products, promote the sharing of inspection information across processes and departments, and provide technical support for promoting research based operations and improving forecast quality. Aiming at the whole process coverage of the verification algorithm and the comparability of the evaluation results, MetEva adopts a hierarchical architecture including basic layer and functional layer, and designs a modular inspection and calculation process based on a unified data structure. The program library provides over 400 functions around the steps of data reading, data merging and matching, sample selection, sample grouping, inspection calculation and result output for verification. MetEva provides 54 evaluation methods in five categories, which covers most of methods recommended by the World Meteorological Organization and algorithms in domestic specifications. By using matrix calculation in each module and providing parallel scheme for verification algorithms, the operation efficiency is improved.The program library has been released as open source, which can effectively support meteorological departments at all levels to carry out the evaluation of the whole process of weather forecast, so as to promote the development of weather forecast.

详细的说明请参见 https://www.showdoc.cc/meteva

Only Python 3 is supported.

Dependencies

Other required packages:

                  numpy>=1.12.1',
                  'pandas>=1.0.4,<=2.0.3',
                  "netCDF4>=1.4.2,<=1.5.6",
                  'scipy>=0.19.0',
                  'xarray>=0.10.0,<=0.20.0',
                  'scikit-learn>=0.21.2',
                  'matplotlib>=3.2.2,<=3.3.4',
                  "httplib2>=0.12.0",
                  "protobuf<3.20.0",
                  "pyshp>=2.1.0",
                  "tables>=3.4.4",
                  "urllib3>=1.21.1",
                  "pynverse>=0.1.4.6",
                  "shapely>=1.8.0"

Install

Using the fellowing command to install packages:

  pip install meteva

meteva's People

Contributors

1002803832 avatar lianyipython avatar liucouhua avatar longtsing avatar sprite2200 avatar tfonda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meteva's Issues

安装最新版本出错,安装1.75正常

  UPDATING build\lib.win-amd64-cpython-310\matplotlib\_version.py
  set build\lib.win-amd64-cpython-310\matplotlib\_version.py to '3.3.4'
  running build_ext
  Extracting freetype-2.6.1.tar.gz
  Building freetype in build\freetype-2.6.1
  msbuild build\freetype-2.6.1\builds\windows\vc2010\freetype.sln /t:Clean;Build /p:Configuration=Release;Platform=x64
  error: command 'msbuild' failed: None
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for matplotlib
Running setup.py clean for matplotlib
Failed to build matplotlib
ERROR: Could not build wheels for matplotlib, which is required to install pyproject.toml-based projects

使用read_stadata_from_gds时,设置param station中站点数必须大于等于25

当站点数少于25时,报错如下:

Traceback (most recent call last):
  File "D:\Anaconda3\envs\metdig\lib\site-packages\meteva\base\io\read_stadata.py", line 773, in read_stadata_from_gds
    sta.iloc[k,-1] = np.frombuffer(byteArray[ind1:(ind1 + element_len)],dtype=dtype_str)[0]
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\indexing.py", line 723, in __setitem__
    iloc._setitem_with_indexer(indexer, value, self.name)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\indexing.py", line 1730, in _setitem_with_indexer
    self._setitem_with_indexer_split_path(indexer, value, name)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\indexing.py", line 1817, in _setitem_with_indexer_split_path
    self._setitem_single_column(loc, value, pi)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\indexing.py", line 1920, in _setitem_single_column
    ser._mgr = ser._mgr.setitem(indexer=(pi,), value=value)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\internals\managers.py", line 355, in setitem
    return self.apply("setitem", indexer=indexer, value=value)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\internals\managers.py", line 327, in apply
    applied = getattr(b, f)(**kwargs)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\internals\blocks.py", line 925, in setitem
    if not self._can_hold_element(value):
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\internals\blocks.py", line 621, in _can_hold_element
    return can_hold_element(self.values, element)
  File "D:\Anaconda3\envs\metdig\lib\site-packages\pandas\core\dtypes\cast.py", line 2197, in can_hold_element
    if is_float(element) and element.is_integer():
AttributeError: 'numpy.float32' object has no attribute 'is_integer'

散点回归图设置图片尺寸

图片
散点回归图,只看到有设置轴的最大最小值,而且最大最小值会影响图片的尺寸,有没办法固定图片尺寸,比如最小值-7最大值7与最小值0最大值14生成的图片尺寸就不一样

请问如何修改它的尺寸呢,谢谢

meb.xarray_to_griddata函数在xarray为0.19.0版本下出错,0.18.2版本没问题

报错信息如下:


TypeError Traceback (most recent call last)
/tmp/ipykernel_16868/2886223431.py in
----> 1 direction = meb.xarray_to_griddata(direction1, time_dim='forecast_reference_time', dtime_dim='forecast_period')
2 direction

/opt/anaconda3/lib/python3.8/site-packages/meteva/base/basicdata/grid_data.py in xarray_to_griddata(xr0, value_name, member_dim, level_dim, time_dim, dtime_dim, lat_dim, lon_dim)
268 ds.coords["dtime"] = ("dtime", dts)
269 else:
--> 270 ds.coords["dtime"] = ("dtime", dts)
271 attrs_name = list(dts.attrs)
272 for key in attrs_name:

/opt/anaconda3/lib/python3.8/site-packages/xarray/core/coordinates.py in setitem(self, key, value)
39
40 def setitem(self, key: Hashable, value: Any) -> None:
---> 41 self.update({key: value})
42
43 @Property

/opt/anaconda3/lib/python3.8/site-packages/xarray/core/coordinates.py in update(self, other)
161 def update(self, other: Mapping[Hashable, Any]) -> None:
162 other_vars = getattr(other, "variables", other)
--> 163 coords, indexes = merge_coords(
164 [self.variables, other_vars], priority_arg=1, indexes=self.xindexes
165 )

/opt/anaconda3/lib/python3.8/site-packages/xarray/core/merge.py in merge_coords(objects, compat, join, priority_arg, indexes, fill_value)
470 coerced, join=join, copy=False, indexes=indexes, fill_value=fill_value
471 )
--> 472 collected = collect_variables_and_indexes(aligned)
473 prioritized = _get_priority_vars_and_indexes(aligned, priority_arg, compat=compat)
474 variables, out_indexes = merge_collected(collected, prioritized, compat=compat)

/opt/anaconda3/lib/python3.8/site-packages/xarray/core/merge.py in collect_variables_and_indexes(list_of_mappings)
292 append_all(coords, indexes)
293
--> 294 variable = as_variable(variable, name=name)
295 if variable.dims == (name,):
296 variable = variable.to_index_variable()

/opt/anaconda3/lib/python3.8/site-packages/xarray/core/variable.py in as_variable(obj, name)
119 elif isinstance(obj, tuple):
120 if isinstance(obj[1], DataArray):
--> 121 raise TypeError(
122 "Using a DataArray object to construct a variable is"
123 " ambiguous, please extract the data using the .data property."

TypeError: Using a DataArray object to construct a variable is ambiguous, please extract the data using the .data property.

time_list_mesh(多时效预报误差对比图)与time_list_mesh_wind(单站风的多时效对比图)存在的bug

使用版本meteva ==1.3.7
image
发现3处主要bug,望解决,谢谢

1.time_list_mesh_wind传入save_dir参数,保存到路径会失败,这个问题比较简单,我已经自行解决

2.time_list_mesh与time_list_mesh_wind在时效不足的情况下,出图show与savefig的图片不一致

以下提供测试代码和样例数据(csv)

代码:
`import meteva.product as mpd
import pandas as pd

scv_data = pd.read_csv("D:/Test/hdf/contrast_t2m.txt")
print(scv_data)

data_types_dict = {'level': "float64", 'time': "datetime64[ns]", 'dtime': "int64", 'id': "str", 'lon': "float64", 'lat': "float64"}
scv_data = scv_data.astype(data_types_dict)

这里保存到路径,与show出来的图片不一样

mpd.time_list_mesh(scv_data,save_dir="D:/Test/hdf/tdata")

mpd.time_list_mesh(scv_data)`

样例数据
contrast_t2m.txt

执行效果
show的图片
image
保存到路径的图片
bjtm_B1105
可以很明显看出,保存到路径的图片有问题

3.time_list_mesh与time_list_mesh_wind在使用11和17起报时的数据时,会出现报错

这里提供样例数据,使用上面的代码执行即可
contrast_t2m2.txt

报几个兼容性小测试

操作系统centos7
protobuf版本支持到3.12.0(nmc-met-io需要) ,以上不支持
matplotlib版本支持到3.1.3
pyProj=2.1.0
和谐了。

出错表现为
import meteva
Segmentation fault (core dumped)

读取wrfout数据出错

用read_griddata_from_nc读取wrfout文件出错
提示('member', 'level', 'Time', 'dtime', 'lat', 'lon') must be a permuted list of ('lon', 'lat', 'dtime', 'level', 'member', 'Time', 'south_north', 'west_east'), unless ... is included
print(grd)类型为none

降水空间检验线性回归的问题

在用ain_24h_comprehensive_sg和rain_24h_comprehensive_chinaland_sg涉及到线性回归的画图时出现这个错误
Traceback (most recent call last):
File "C:\Users\liupp\miniconda3\envs\meteva\lib\site-packages\IPython\core\interactiveshell.py", line 3331, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
runfile('C:/Users/liupp/PycharmProjects/meteva/meteva_pre.py', wdir='C:/Users/liupp/PycharmProjects/meteva')
File "C:\Program Files\JetBrains\PyCharm 2020.1.1\plugins\python\helpers\pydev_pydev_bundle\pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2020.1.1\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/liupp/PycharmProjects/meteva/meteva_pre.py", line 24, in
mpd.rain_24h_comprehensive_sg(sta_ob, grd_fo_jx, r"D:\rain_24h_comp_c.png")
File "C:\Users\liupp\miniconda3\envs\meteva\lib\site-packages\meteva\product\program\space_compare.py", line 272, in rain_24h_comprehensive_sg
clf = LinearRegression().fit(X, fo)
File "C:\Users\liupp\miniconda3\envs\meteva\lib\site-packages\sklearn\linear_model_base.py", line 547, in fit
linalg.lstsq(X, y)
File "C:\Users\liupp\miniconda3\envs\meteva\lib\site-packages\scipy\linalg\basic.py", line 1226, in lstsq
% (-info, lapack_driver))
ValueError: illegal value in 4-th argument of internal None

background不为None时 出错

为None时正常运行
grid0 = meb.interp_sg_idw(sta,grid0,nearNum = 4,background=0,effectR=20)

C:\ProgramData\Anaconda3\lib\site-packages\meteva\base\fun\interpolating.py in interp_gg_linear(grd, grid, used_coords, outer_value)
460 if (grd is None):
461 return None
--> 462 levels = grd["level"].values
463 times = grd["time"].values
464 dtimes = grd["dtime"].values

TypeError: 'int' object is not subscriptable

另外一个小问题(1)meb.combine_on_level_time_dtime_id(all_test,result,how="outer")
采用这种合并,如果前者有站不在后者里面,则前部分数据会丢失经纬度
(2)mpd.score_id 只有一行数据时会报错

分类、分级检验图的问题

ob = (np.random.rand(20) * 10).astype(np.int8)
fo = (np.random.rand(3,20) * 10).astype(np.int8)
grade_list = [-3,-1,1,3]
mem.performance_multi(ob, fo, grade_list=grade_list)

生成图表的legend最后一个区间是不是应为 >= 3,现在是>=-1

ob = (np.random.rand(20) * 10).astype(np.int8)
fo = (np.random.rand(8,20) * 10).astype(np.int8)
grade_list = [-3,-1,1,3]
mem.performance_multi(ob, fo, grade_list=grade_list)

报错
File "\lib\site-packages\meteva\method\multi_category\plot.py", line 341, in performance_multi
grade_legend_strs.append(">=" + str(grade_list[legend_num - 2]))
IndexError: list index out of range

interp_gg_linear 网格插值网格报错

我用read_griddata_from_nc读取nc文件之后,使用interp_gg_linear 插值,报错信息为,这是什么原因呢?


AttributeError Traceback (most recent call last)
/tmp/ipykernel_2080/2873667710.py in
1 new_grid = meb.grid([112.6,119.89,0.03],[35.8,42.79,0.03])
----> 2 new_data = meb.interp_gg_linear( grd ,new_grid )
3 print(new_data)

~/miniconda3/envs/py37/lib/python3.7/site-packages/meteva/base/fun/interpolating.py in interp_gg_linear(grd, grid, used_coords, outer_value)
461 dtimes = grd["dtime"].values
462 members = grd["member"].values
--> 463 grid0 = meteva.base.basicdata.get_grid_of_data(grd)
464 icycle = int(360/grid0.dlon)
465 iscycle = (grid0.dlon * grid0.nlon >= 360)

~/miniconda3/envs/py37/lib/python3.7/site-packages/meteva/base/basicdata/grid.py in get_grid_of_data(grid_data0)
262 #glat = [lats[0],round(lats[-1],5),round(lats[1]-lats[0],5)]
263 glat = [get_true_value(lats[0]), get_true_value(lats[-1]), dlat]
--> 264 grid01 = grid(glon, glat, gtime, gdt, level_list, member_list)
265 return grid01
266

~/miniconda3/envs/py37/lib/python3.7/site-packages/meteva/base/basicdata/grid.py in init(self, glon, glat, gtime, dtime_list, level_list, member_list)
118 else:
119 self.dtimedelta = gtime[2]
--> 120 seconds = gtime[2].total_seconds()
121 if seconds % 3600 == 0:
122 self.dtime_type = "h"

AttributeError: 'numpy.int32' object has no attribute 'total_seconds'

AttributeError: module 'nmc_verification' has no attribute 'nmc_vf_report'

目前可以安装,不过安装后import nmc_verification 出现错误

`Jupyter QtConsole 4.6.0
Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 14:00:49) [MSC v.1915 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.10.2 -- An enhanced Interactive Python. Type '?' for help.

import nmc_verification

AttributeError Traceback (most recent call last)
in
----> 1 import nmc_verification

D:\ProgramData\Anaconda3\envs\keras\lib\site-packages\nmc_verification_init_.py in
4 from . import nmc_vf_base
5 from . import nmc_vf_method
----> 6 from . import nmc_vf_report
7 from . import nmc_vf_product
8

D:\ProgramData\Anaconda3\envs\keras\lib\site-packages\nmc_verification\nmc_vf_report_init_.py in
1 from . import perspective
----> 2 from .plot import *

D:\ProgramData\Anaconda3\envs\keras\lib\site-packages\nmc_verification\nmc_vf_report\plot.py in
1 import xarray as xr
----> 2 import nmc_verification.nmc_vf_report.perspective.veri_plot_set as veri_plot_set
3
4 def plot(veri_result,para_list,output_dir):
5 dims = []

AttributeError: module 'nmc_verification' has no attribute 'nmc_vf_report'`

ModuleNotFoundError: No module named 'ipywidgets'

import nmc_verification

ModuleNotFoundError Traceback (most recent call last)
in
----> 1 import nmc_verification

D:\ProgramData\Anaconda3\envs\keras\lib\site-packages\nmc_verification_init_.py in
5 from . import nmc_vf_method
6 from . import nmc_vf_report
----> 7 from . import nmc_vf_product
8

D:\ProgramData\Anaconda3\envs\keras\lib\site-packages\nmc_verification\nmc_vf_product_init_.py in
1 from .base import *
2 from .application import *
----> 3 from .presentation import *

D:\ProgramData\Anaconda3\envs\keras\lib\site-packages\nmc_verification\nmc_vf_product\presentation_init_.py in
1 from .gds_data_dict import *
----> 2 from . import winter_olympic
3 from . import wuhan

D:\ProgramData\Anaconda3\envs\keras\lib\site-packages\nmc_verification\nmc_vf_product\presentation\winter_olympic.py in
1 import nmc_verification
2 from nmc_verification.nmc_vf_product.presentation.gds_data_dict import *
----> 3 from ipywidgets import widgets
4
5 id_lon_lat_dict = {

ModuleNotFoundError: No module named 'ipywidgets'

递归依赖 pytables 引起 pip 安装失败

Windows python 3.9,安装期间报错

Collecting tables>=3.4.4
  Downloading https://mirror.sjtu.edu.cn/pypi-packages/2b/32/847ee3f521aae6a0be380d923a736162d698586f444df1ac24b98c65025c/tables-3.6.1.tar.gz (4.6 MB)
     |████████████████████████████████| 4.6 MB 6.4 MB/s
    ERROR: Command errored out with exit status 1:
     command: 'S:\ProgramData\Miniconda3\envs\sci\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-c0kb2rzt\\tables_0ddda4f4fb6548cc915d97e1a8339ed0\\setup.py'"'"'; __file__='"'"'C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-c0kb2rzt\\tables_0ddda4f4fb6548cc915d97e1a8339ed0\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\admin\AppData\Local\Temp\pip-pip-egg-info-osgq2ar6'
         cwd: C:\Users\admin\AppData\Local\Temp\pip-install-c0kb2rzt\tables_0ddda4f4fb6548cc915d97e1a8339ed0\
    Complete output (10 lines):
    H5close16_k8rkh.c
    C:\Users\admin\AppData\Local\Temp\H5close16_k8rkh.c(2): warning C4013: “H5close”未定义;假设外部返回 int
    LINK : fatal error LNK1181: 无法打开输入文件“hdf5.lib”
    * Using Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)]
    * USE_PKGCONFIG: False
    * Found conda env: ``S:\ProgramData\Miniconda3\envs\sci``
    .. ERROR:: Could not find a local HDF5 installation.
       You may need to explicitly state where your local HDF5 headers and
       library can be found by setting the ``HDF5_DIR`` environment
       variable or by using the ``--hdf5`` command-line option.

PyTables/PyTables#885

目前解决方案:pip install tables有问题,先执行conda install pytables,再pip install meteva

read_griddata_from_grib中dtime参数问题

image
如果filename中的step是一个多维,即1,2,3,4...70,71,72,那么read_griddata_from_grib函数中的dtime=12,数据读出来仍然是dtime=1,2,3...71,71,72,即dtime没有起作用

综合评分表1.7.5 版本无法显示legend

image
使用的是文档中的例子,没有显示legend

grade_list = [10,25]
member_list = ["ECMWF","CMA_GFS"]
far_array = np.array([[0.4,0.5],[0.6,0.7]])
mr_array =np.array([[0.2,0.3],[0.4,0.5]])
mem.performance_mr_far(mr_array,far_array,grade_list = grade_list,member_list = member_list,x_y = "far_mr",
               save_path = r"p4.png",show = True)

读取ECMWF_HR CAPE文件时,发生“文件格式不能识别”提示

#######Python读取代码,该文件能在MICAPS4正常读取
import meteva.base as meb
EC_Grid_0125 = meb.grid([90, 121.875, 0.125],[47.875, 16, -0.125])
CAPE_Filename = "19083120.txt" #ECMWF_HR CAPE
#读取数据
grd = meb.read_griddata_from_micaps4(CAPE_Filename, EC_Grid_0125)

#######运行错误提示
[19083120.txt文件格式不能识别。可能原因:文件未按micaps4格式存储]

#######CAPE数据文件
19083120.txt

meteva 为啥要设置绘图字体?

引入 meteva 包后发现 plt.rcParams['font.sans-serif'] 被设置成 simhei ,但是我是 ubuntu 服务器,已经设置好 matplotlib 的字体参数,为什么要重写matplolib字体,是有什么逻辑上的要求么?

read_griddata_from_grib读取grib数据

read_griddata_from_grib读取grib数据时,报错:
ValueError: ('member', 'isobaricInhPa', 'time', 'dtime', 'latitude', 'longitude') must be a permuted list of ('dtime', 'time', 'member', 'step', 'isobaricInhPa', 'latitude', 'longitude'), unless ... is included
请问这个怎么解决?

关于basemap

重新修改打包成whl安装后,按照文档编写程序出现“import _geoslib No module named '_geoslib'”错误

Can not install with pip

ERROR: Could not find a version that satisfies the requirement meteva
ERROR: No matching distribution found for meteva

meb.xarray_to_griddata函数在xarray为0.19.0版本下出错,0.18.2版本没问题

meteva版本:1.5.9.4

报错信息如下:


TypeError Traceback (most recent call last)
/tmp/ipykernel_16868/2886223431.py in
----> 1 direction = meb.xarray_to_griddata(direction1, time_dim='forecast_reference_time', dtime_dim='forecast_period')
2 direction

/opt/anaconda3/lib/python3.8/site-packages/meteva/base/basicdata/grid_data.py in xarray_to_griddata(xr0, value_name, member_dim, level_dim, time_dim, dtime_dim, lat_dim, lon_dim)
268 ds.coords["dtime"] = ("dtime", dts)
269 else:
--> 270 ds.coords["dtime"] = ("dtime", dts)
271 attrs_name = list(dts.attrs)
272 for key in attrs_name:

/opt/anaconda3/lib/python3.8/site-packages/xarray/core/coordinates.py in setitem(self, key, value)
39
40 def setitem(self, key: Hashable, value: Any) -> None:
---> 41 self.update({key: value})
42
43 @Property

/opt/anaconda3/lib/python3.8/site-packages/xarray/core/coordinates.py in update(self, other)
161 def update(self, other: Mapping[Hashable, Any]) -> None:
162 other_vars = getattr(other, "variables", other)
--> 163 coords, indexes = merge_coords(
164 [self.variables, other_vars], priority_arg=1, indexes=self.xindexes
165 )

/opt/anaconda3/lib/python3.8/site-packages/xarray/core/merge.py in merge_coords(objects, compat, join, priority_arg, indexes, fill_value)
470 coerced, join=join, copy=False, indexes=indexes, fill_value=fill_value
471 )
--> 472 collected = collect_variables_and_indexes(aligned)
473 prioritized = _get_priority_vars_and_indexes(aligned, priority_arg, compat=compat)
474 variables, out_indexes = merge_collected(collected, prioritized, compat=compat)

/opt/anaconda3/lib/python3.8/site-packages/xarray/core/merge.py in collect_variables_and_indexes(list_of_mappings)
292 append_all(coords, indexes)
293
--> 294 variable = as_variable(variable, name=name)
295 if variable.dims == (name,):
296 variable = variable.to_index_variable()

/opt/anaconda3/lib/python3.8/site-packages/xarray/core/variable.py in as_variable(obj, name)
119 elif isinstance(obj, tuple):
120 if isinstance(obj[1], DataArray):
--> 121 raise TypeError(
122 "Using a DataArray object to construct a variable is"
123 " ambiguous, please extract the data using the .data property."

TypeError: Using a DataArray object to construct a variable is ambiguous, please extract the data using the .data property.

读取CAPE格式数据时发生错误

#######Python读取代码,该文件能在MICAPS4正常读取
import meteva.base as meb
EC_Grid_0125 = meb.grid([90, 121.875, 0.125],[47.875, 16, -0.125])
CAPE_Filename = "19083120.txt" #ECMWF_HR CAPE
#读取数据
grd = meb.read_griddata_from_micaps4(CAPE_Filename, EC_Grid_0125)

#######运行错误提示
[19083120.txt文件格式不能识别。可能原因:文件未按micaps4格式存储]

#######CAPE数据文件
19083120.txt

格点实况检验

现在格点实况产品已经比较多了,咱们的meteva以后会不会考虑根据格点实况检验数值预报?
还是按照现在的把两种网格数据都插值到站点上再检验?这样感觉没有直接网格对网格数据检验的效果好。
比较期待meteva可以用格点实况检验网格预报。

安装1.8版本出现错误

Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [27 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\abb\AppData\Local\Temp\pip-install-7csg3vg7\netcdf4_fc7c297061b7477f850bf24d35d5c9a4\setup.py", line 425, in
_populate_hdf5_info(dirstosearch, inc_dirs, libs, lib_dirs)
File "C:\Users\abb\AppData\Local\Temp\pip-install-7csg3vg7\netcdf4_fc7c297061b7477f850bf24d35d5c9a4\setup.py", line 366, in _populate_hdf5_info
raise ValueError('did not find HDF5 headers')
ValueError: did not find HDF5 headers
reading from setup.cfg...

      HDF5_DIR environment variable not set, checking some standard locations ..
  checking d:\Users\abb\anaconda3\envs\nmc\include ...
  hdf5 headers not found in d:\Users\abb\anaconda3\envs\nmc\include
  checking d:\Users\abb\anaconda3\envs\nmc\Library\include ...
  hdf5 headers not found in d:\Users\abb\anaconda3\envs\nmc\Library\include
  checking C:\Users\abb\include ...
  hdf5 headers not found in C:\Users\abb\include
  checking /usr/local\include ...
  hdf5 headers not found in /usr/local\include
  checking /sw\include ...
  hdf5 headers not found in /sw\include
  checking /opt\include ...
  hdf5 headers not found in /opt\include
  checking /opt/local\include ...
  hdf5 headers not found in /opt/local\include
  checking /usr\include ...
  hdf5 headers not found in /usr\include
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

whl无法安装的问题

安装whl要求安装pyshap库,导致无法安装,经查应该是pyshp,需要修改setup.py重新生成whl

read_griddata_from_grib内存泄漏的问题

2021-07-30_15-15_1
2021-07-30_15-28

循环读取10次,每次大概要上升1个多G,最高上升到10多G。期间内存占用不会被释放直到程序结束。
我测试了最高、最低温、3小时降水的GRB文件,只有读3小时降水的文件会出现这个问题。
系统win7 64位,python3.8.8,meteva版本1.5.9

对于邻域法检验的一些疑问?

为什么要把预报的网格数据插值到站点再检验呢?
如果预报的强降水网格周围没有站点,插值过后的站点上没有降水,但实际站点上又出现了降水,是否会影响检验效果?

因为我了解的邻域法都是直接在网格上检验。

在python3.12上安装出错

建议安装时可以选择不同的模块,有的时候不需要画图功能,有的不需要一些统计功能,目前改进的需要的类库,限制了升级要求,例如netcdf限制在1.5.6以下,现在基本都用1.6以上了,这种模式有待商榷

分类预报检验示意图中是否有误

2021-06-26_23-07
该图中漏报与空报是否位置错误

举例:
1.实况大雨,预报大暴雨,是否应为空报,图片显示为漏报
2.预报大雨,实况大暴雨,是否应为漏报,图片显示为空报

资料:
mmexport1624721353879
mmexport1624721387719

站点数据中的dtime设置问题

请问站点数据中24小时降水量这类的累积数据应该如何设置time和dtime,如6月1日08时的过去24小时降水量数据,time=6月1日08时,dtime=24,还是time=5月31日08时,dtime=24呢?

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.