Author Topic: Question on combining nc  (Read 3015 times)

0 Members and 1 Guest are viewing this topic.

Offline kaypu

  • QuantumATK Guru
  • ****
  • Posts: 135
  • Country: 00
  • Reputation: 1
    • View Profile
Question on combining nc
« on: December 25, 2012, 02:22 »
Dear QuantumWise staff:

     i want to combine four separate NC into one NC, how to do it?

Merry Christmas


Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: Question on combining nc
« Reply #1 on: December 25, 2012, 18:32 »
There is many way to do it - but it would in end be something like.
Code
nc1 = nlread("file_1.nc")
nc2 = nlread("file_2.nc")
nc3 = nlread("file_3.nc")
nc4 = nlread("file_4.nc")

for obj in nc1 + nc2 + nc3 + nc4:
   nlsave("new_file.nc", obj)


Offline kaypu

  • QuantumATK Guru
  • ****
  • Posts: 135
  • Country: 00
  • Reputation: 1
    • View Profile
Re: Question on combining nc
« Reply #2 on: December 26, 2012, 00:52 »
Thank you professor Nordland