As we see the size of lat lon dimensions is different. Also some of the lat and lon values are repeated between the two files(not the lat-lon combination but individual lat or lon values). How can I concatenate files in this scenario. I have written a python script to concatenate the files but the execution time becomese too long as the size of the files to concatenate increases.
Please let me know how to handle this type of concatenation efficiently. I had tried nco operators but I think they do not handle this scenario(I hope I am wrong here).
Last edit: lal 2016-02-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I have two files and the metadata for them is:
1) File1:
dimensions:
time = 20089;
lat = 5;
lon = 38;
variables:
double time(time=20089);
:units = "days since 1960-01-01 00:00:00.0 +0545";
:time_origin = "1960-01-01 00:00:00";
2) File2:
dimensions:
time = 20089;
lat = 3;
lon = 47;
variables:
double time(time=20089);
:units = "days since 1960-01-01 00:00:00.0 +0545";
:time_origin = "1960-01-01 00:00:00";
As we see the size of lat lon dimensions is different. Also some of the lat and lon values are repeated between the two files(not the lat-lon combination but individual lat or lon values). How can I concatenate files in this scenario. I have written a python script to concatenate the files but the execution time becomese too long as the size of the files to concatenate increases.
Please let me know how to handle this type of concatenation efficiently. I had tried nco operators but I think they do not handle this scenario(I hope I am wrong here).
Last edit: lal 2016-02-02
Interesting question. I can't think of any elegant solutions. Anyone else?
cz
I visualize the spatial overlap to be something like this:
where x is file 1, and o is file 2. I would divide each file into 2 files, resulting in 4 files that lie like this:
a) Concat 2 with 3;
b) extend the dimensions of 1 and 4; then
c) concat 1, the result of (a), and 4.
Not elegant (rather, painful), but should work?
Last edit: John 2016-02-03
Thanks John and Charlie.
John: I did not quite understand.
I have found a similar question asked on this forum: http://sourceforge.net/p/nco/discussion/9830/thread/2782cde1/
The recommendation on that thread was also an custom script to do the merging.
I have meanwhile made my script faster by writting it in c and using openmp to parallelize. So it is not bothering me anymore.