本文整理汇总了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)
}
}