필터 지우기
필터 지우기

merging two NETCDF files into one

조회 수: 7 (최근 30일)
Gordon Jones
Gordon Jones 2011년 4월 6일
답변: Faisal Qureshi 2017년 11월 13일
For a modelling project I have two (and more) NETCDF files with identical structures, same dimensions, variables and attributes for a single month. However, for simplicities sake I want to create a single NETCDF file going over the entire period. I've created a section of code that creates a new netcdf file and copies over the dimensions and variables but it keeps failing at the stage of trying to copy the data in using the code; netcdf.putVar(ncid,varname,varid) Does anyone have any idea what I might be doing wrong? or any suggestions for how to do this?
  댓글 수: 2
Ashish Uthama
Ashish Uthama 2011년 4월 12일
Gordon, you might be interested in a new feature |ncwriteschema|: http://www.mathworks.com/help/techdoc/ref/ncwriteschema.html which would help simplify creating the merged file.
Gordon Jones
Gordon Jones 2011년 4월 14일
You're quite right, that would have streamlined the issue significantly, thanks for that.

댓글을 달려면 로그인하십시오.

채택된 답변

Gordon Jones
Gordon Jones 2011년 4월 14일
I have found what part of my problem was, which was the format of one of my variable titles in the NETCF file which was making it incompatible. However, I have now solved this problem by using the SNCTOOLS collection. I'd also like to thank John Evans who runs that collection for his help sorting out the issue with the variable title.

추가 답변 (2개)

John
John 2011년 4월 7일
Gordon, check the syntax for netcdf.putVar. The varid should be the second parameter, not the third.
If you are concatenating files, you probably want to look at the "netcdf.putVar(ncid,varid,start,count,data)" syntax.
  댓글 수: 1
Gordon Jones
Gordon Jones 2011년 4월 14일
Thanks, you were quite right that I had my syntax incorrect. This didn't actually solve the problem though, but the reason is below.

댓글을 달려면 로그인하십시오.


Faisal Qureshi
Faisal Qureshi 2017년 11월 13일
Is there any syntax by which thousands of nc files can merged to single file?
As I am a final year student of B.Sc. Mechanical Engineering at University of Engineering and Technology Lahore, Pakistan and conducting a research on Wind Resource Assessment for Pakistan to meet country's Energy Crisis and to help Pakistan move towards sustainable energy resource instead of Conventional Energy resources.
For which I have thousands of netcdf for 5 variables and I want to combine them in one single netcdf file.How do that as I am a beginner in Matlab, but really want to get over this problem. Any help?
I will be highly obliged by your assistance
Faisal Iqbal Qureshi B.Sc. Mechanical Engr. University of Engineering and Technology Lahore, Pakistan Mobile: +92304-8870190 Email: 2014me3@student.uet.edu.pk

카테고리

Help CenterFile Exchange에서 NetCDF에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by