-3

I have hundreds of daily netcdf containing geographic lat/long and parameters. I want to merge them into one file. So the time will only vary. I downloaded NCO but it is not very friendly for window users. I use GrADS to visualize. But to use GrADS, I need to merge the netcdfs first.

I would like to do this in R.

EDIT:

This is the screenshot of my folder. The issue is I want these 6-hourly netcdfs to become daily then combine the daily into single netcdf file.

Is this possible?

  • 2
    In which way is NCO not friendly for Windows? I'm a Linux user, so I genuinely don't know. Because NCO would be perfect for this job... – Janina Jul 25 '18 at 6:23
  • @Janina: I do not have good background in unix environment – user2543 Jul 26 '18 at 1:32
  • Please use the edit button beneath your question to revise it with any requested clarifications. Are you using ArcGIS Pro or ArcGIS Desktop (ArcMap)? – PolyGeo Jul 26 '18 at 1:36
  • 1
    @user2543 "Then I got lost in afterwardsm" what exactly went wrong? – Mateusz Konieczny Jul 28 '18 at 13:11
  • 2
    Where are we starting from with you? Have you used R before? Do you know how to read the data into R? Have you used the raster package? Do all your NetCDF files have the same grid size and extent? – Spacedman Jul 29 '18 at 11:55
6
+25

I'd suggest trying NCO again, as it's well suited for this type of operation, and can be done with one command. The tool to concatenate several files along the record dimension (e.g. time) is ncrcat. For example, to combine all the files for May 2018:

ncrcat gdaps_anal_201805????.nc gdaps_anal_201805.nc

The resulting file gdaps_anal_201805.nc should contain all 4x31=124 files worth of data, with a longer time dimension. Expect this to be a big file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.