필터 지우기
필터 지우기

merging two netcdf files into one

조회 수: 32 (최근 30일)
Poppy
Poppy 2020년 3월 16일
답변: Rashed Mohammed 2020년 3월 19일
Hello, I was wondering if there is a code to merge two cdf files into one? I am working with monthly salinity data however the data has been split into two 15 day periods for the month, so I just want to merge the two together so I can have data for the whole month in one file. The variables are the same and the same dimensions.

답변 (1개)

Rashed Mohammed
Rashed Mohammed 2020년 3월 19일
Hi Poppy,
I understand that you would like to merge two NetCDF files which have same variables and dimensions. You can do this by reading the data from both the files using ncread function, then creating the schema of the new file using ncwriteschema function and finally writing the data to the new file using ncwrite function. You can find example here.
Note: If the files you are trying to merge are .cdf files and not .nc files, then you can use the CDF functions provided by MATLAB to do it yourself as shown here. Alternately you can use the CDFMerge tool provided by NASA as part of their CDF distribution. You can download the binary/zip specific to your OS from here.
Hope this helps!

카테고리

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