当前位置: 首页>>代码示例>>Golang>>正文


Golang Nc.Variables_2D方法代码示例

本文整理汇总了Golang中github.com/SNguyen29/Oceano2oceansitesTest/lib.Nc.Variables_2D方法的典型用法代码示例。如果您正苦于以下问题:Golang Nc.Variables_2D方法的具体用法?Golang Nc.Variables_2D怎么用?Golang Nc.Variables_2D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/SNguyen29/Oceano2oceansitesTest/lib.Nc的用法示例。


在下文中一共展示了Nc.Variables_2D方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: ReadSeabird

// read cnv files in two pass, the first to get dimensions
// second to get data
func ReadSeabird(nc *lib.Nc, m *config.Map, filestruct analyze.Structfile, cfg toml.Configtoml, files []string, optCfgfile string, optAll *bool, optDebug *bool, prefixAll string) {

	switch {
	case filestruct.Instrument == cfg.Instrument.Type[0]:

		config.GetConfigCTD(nc, m, cfg, optCfgfile, filestruct.TypeInstrument, optAll)

		// first pass, return dimensions fron cnv files
		nc.Dimensions["TIME"], nc.Dimensions["DEPTH"] = firstPassCTD(nc, m, cfg, files)

		// initialize 2D data
		nc.Variables_2D = make(lib.AllData_2D)
		for i, _ := range m.Map_var {
			nc.Variables_2D.NewData_2D(i, nc.Dimensions["TIME"], nc.Dimensions["DEPTH"])
		}

		// second pass, read files again, extract data and fill slices
		secondPassCTD(nc, m, cfg, files, optDebug)
		// write ASCII file
		WriteAscii(nc, cfg, m.Map_format, m.Hdr, filestruct.Instrument, prefixAll)

		// write netcdf file
		//if err := nc.WriteNetcdf(); err != nil {
		//log.Fatal(err)
		//}
		netcdf.WriteNetcdf(nc, m, cfg, filestruct.Instrument, prefixAll)

	case filestruct.Instrument == cfg.Instrument.Type[1]:

		config.GetConfigBTL(nc, m, cfg, optCfgfile, filestruct.TypeInstrument)
		// first pass, return dimensions fron btl files
		nc.Dimensions["TIME"], nc.Dimensions["DEPTH"] = firstPassBTL(nc, m, cfg, files)

		// initialize 2D data
		nc.Variables_2D = make(lib.AllData_2D)
		for i, _ := range m.Map_var {
			nc.Variables_2D.NewData_2D(i, nc.Dimensions["TIME"], nc.Dimensions["DEPTH"])
		}

		// second pass, read files again, extract data and fill slices
		secondPassBTL(nc, m, cfg, files, optDebug)
		// write ASCII file
		WriteAscii(nc, cfg, m.Map_format, m.Hdr, filestruct.Instrument, prefixAll)

		// write netcdf file
		//if err := nc.WriteNetcdf(); err != nil {
		//log.Fatal(err)
		//}
		netcdf.WriteNetcdf(nc, m, cfg, filestruct.Instrument, prefixAll)
	}
}
开发者ID:SNguyen29,项目名称:Oceano2oceansitesTest,代码行数:53,代码来源:Read.go


注:本文中的github.com/SNguyen29/Oceano2oceansitesTest/lib.Nc.Variables_2D方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。