bgcrogo数据质量控制的python库

bgcArgoDMQC的Python项目详细描述


阿尔戈加拿大BGC质量控制

Anaconda-Server BadgeBuild StatusDocumentation Statuscodecov

免责声明

此代码正在very活动开发中。可以使用此代码(甚至鼓励使用),但可能会抛出错误、以不希望的方式行为等。也鼓励提交问题以帮助开发!在

Binder安装前请在活页夹中试用!在

安装

建议通过conda forge频道通过以下命令进行安装:

conda install -c conda-forge bgcArgoDMQC

该包也可以通过python包索引https://pypi.org/project/bgcArgoDMQC/获得,安装时使用:

^{pr2}$

一般说明

溶解氧数据质量控制函数库。 主要基于SOCCOM BGC Argo QC methodsmatlab中的程序使用 NCEPWorld Ocean Atlas数据到 计算氧气增益 (Johnson et al. 2015)。在

bgcArgo依赖项

  • 必须在python3.4或更高版本上运行,python2.x不支持(使用pathlib,在python版本3.4中引入)
  • TEOS-10包gsw,但也将与seawater包一起工作,尽管它被弃用而支持gsw
  • netCDF4模块,用于.nc文件
  • pandas是必需的(强烈推荐您满足所有数据科学需求!)在
  • seaborn是推荐的,但不是必需的,因为会有一些减少的(非必要的)功能
  • cmocean也推荐用于更好的绘图,但不是必需的

基本功能

尽管bgcArgo模块中的函数可能在其他情况下使用,但大多数功能都在两个类中,profiles用于典型的概要文件,sprof用于合成概要文件。在

importbgcArgoasbgc# setup for your system - these directories need to already exist!argo_path='your/argo/data/path'# where to save Argo datancep_path='your/ncep/data/path'# where to save NCEP reanalysis datawoa_path='your/woa18/data/path'# where to save WOA data# download the data - this can take some time depending on connection# Argowmos=[4902481,6902905]forwinwmos:bgc.io.get_argo(w,local_path=argo_path)# NCEPbgc.io.get_ncep('pres',local_path=ncep_path)bgc.io.get_ncep('land',local_path=ncep_path)# WOAbgc.io.get_woa18('O2sat',local_path=woa_path)# tell the package where to look for databgc.set_dirs(argo_path=argo_path,ncep_path=ncep_path,woa_path=woa_path)# load data  for the first 10 profiles for two floatsflts=bgc.profiles(wmos,cycles=list(range(1,11)))df=flts.to_dataframe()>>>print(df)# load a synthetic profilesyn=bgc.sprof(4902481)# plot a time vs. depth section for the top 500mg1=syn.plot('cscatter',varname='DOXY',ylim=(0,500))# plot the first 10 profiles for temperature, practical salinity, oxygeng2=syn.plot('profiles',varlist=['TEMP','PSAL','DOXY'],Ncycle=1,Nprof=10,ylim=(0,500))# calculate gains in-air and using saturation datainair_g=syn.calc_gains()surf_g=syn.calc_gains(ref='WOA')>>>print(f'Mean in-air gain: {np.nanmean(inair_g):.2f}')>>>print(f'Mean in-water gain: {np.nanmean(surf_g):.2f}')

上述代码将生成以下输出和绘图:

       CYCLE           SDN      WMO   LATITUDE  ...  DOXY_ADJUSTED  DOXY_ADJUSTED_QC      O2Sat  O2Sat_QC
0        1.0  17921.627083  6902905 -52.503939  ...            NaN               4.0        NaN       4.0
1        1.0  17921.627083  6902905 -52.503939  ...            NaN               4.0        NaN       4.0
2        1.0  17921.627083  6902905 -52.503939  ...            NaN               4.0        NaN       4.0
3        1.0  17921.627083  6902905 -52.503939  ...            NaN               4.0        NaN       4.0
4        1.0  17921.627083  6902905 -52.503939  ...            NaN               4.0        NaN       4.0
...      ...           ...      ...        ...  ...            ...               ...        ...       ...
30545   10.0  18151.225694  4902481  55.530190  ...            NaN               4.0  82.866123       3.0
30546   10.0  18151.225694  4902481  55.530190  ...            NaN               4.0  82.660113       3.0
30547   10.0  18151.225694  4902481  55.530190  ...            NaN               4.0  82.495289       3.0
30548   10.0  18151.225694  4902481  55.530190  ...            NaN               4.0  82.368619       3.0
30549   10.0  18151.225694  4902481  55.530190  ...            NaN               4.0  82.078116       3.0

Mean in-air gain: 1.31
Mean in-water gain: 1.04

版本历史记录

0.1:2020年4月20日-初始创建

0.2:2020年5月13日-最终用户使用模块的方式发生重大变化,向更面向对象的方向转变,创建argo类

0.2.1:2020年6月23日-现在需要熊猫,这使得全球指数的读取变得更加容易和高效

0.2.2:2020年8月28日-删除pylab依赖项(matplotlib的一部分),构建并上传到PyPI,构建conda forge recipe

0.2.3-0.2.6:2020年9月3日-更新以通过对conda forge请求的所有检查,并在PyPI上更新

0.2.7-0.2.8:2020年9月29日-PyPI和PR重纺至conda原料

0.2.9:2020年11月9日-名称变更为bgcArgoDMQC,过去一个月的其他各种更新

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Spring启动启用HTTPS   actionscript 3 java中的这个[“var”+“name”]   java只匹配给定集合中一个字符的一个匹配项   java Hibernate:防止角色表中出现多个相同的条目   javajersey+Spring注入servlet请求   java HtmlEditor javafx失去焦点   java Apache Wicket AjaxRequestTarget ListView组件未刷新或更新   mysql java。无法将lang.String转换为java。sql。时间戳   java将巨大的整数文件(在一行中)拆分为具有内存限制的已排序块   安卓如何完全关闭proguard?   安装Eclipse和Android SDK后的java“无AVD可用”消息   java动态显示图像视图   java在Spring中还有哪些WebsocketClient实现?   java Glassfish需要很长时间才能重新启动   使用Java简单串行连接器将pc与arduino连接   java如何在camel文件组件配置中结合readLockCheckInterval和maxMessagesPerPoll?   单击Android时的java预览图像   java如何将字节数组转换为ByteArrayOutputStream