下面是模拟数据生成 public static void main(String args[]) throws Exception { // 1628行 1005列 final int NLVL = 2; // 级别 的数组长度 final int NLAT = 6; // 纬度的 数组 长度 final int NLON = 12;// 经度的 数组 长度 final int NREC = 2; final float SAMPLE_PRESSURE = 900.0f; // 开始气压 final float SAMPLE_TEMP = 9.0f;// 开始温度 final float START_LAT = 25.0f;// 开始 纬度 final float START_LON = -125.0f; // 开始经度 // Create the file. 设置文件名称 String filename = "D:/pres_temp_4D.nc"; NetcdfFileWriter dataFile = null; try { // 使用给定的文件名创建新的netcdf-3文件 dataFile = NetcdfFileWriter.createNew(NetcdfFileWriter.Version.netcdf3, filename); //add dimensions where time dimension is unlimit // 添加时间维度为无限的维度 // 创建级别维度 Dimension lvlDim = dataFile.addDimension(null, "level", NLVL); // 创建纬度维度
Java 根据数据生成带层级的nc数据
于 2024-04-02 10:34:05 首次发布