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在Eclipse中使用ctrlshiftt而不是ctrlshiftr有什么好处?   java自动装箱概念SCJP   java如何使用JAXR和Resteasy、Angular和Wildfly10处理COR   java如何在整数数组中动态添加元素?   JAVA从继承生成器模式返回父对象继承   java问题调试生产者消费者问题   java MQ:已达到通道的最大实例数   JavaPowerMockMockito:我试图stubb的方法最终被调用   java Hibernate将多个列映射到一个表   在java中,将字符串中的单词大写,但跳过字符串中的数字和多余空格或符号   使用Eclipse将Java项目导出到JAR时出现“重复条目”错误   java使用eclipselink在实体表上指定NullConstraint   <Java>我可以在TCPIP中使用多个服务器socket吗?   带有自定义视图的java AlertDialog:调整大小以包装视图的内容   如何从用C#编写的web服务生成用于java的SOAP API?