lib/numru/gphys/gphys.rb in gphys-1.5.5 vs lib/numru/gphys/gphys.rb in gphys-1.5.6
- old
+ new
@@ -1208,11 +1208,12 @@
#< grid >
grid = Grid.new(*axes)
if gp0.assoc_coords
assoc_coords = gp0.assoccoordnames.collect do |aname|
- GPhys.join( gpnary.collect{|gp| gp.assoc_coord_gphys(aname)}, true )
+ GPhys.join( gpnary.collect{|gp| gp.assoc_coord_gphys(aname)}, true,
+ true )
end
grid.set_assoc_coords(assoc_coords)
end
#< data >
@@ -1220,11 +1221,11 @@
#< new gphys >
GPhys.new(grid, data)
end
- def GPhys.join_md(gpnary)
+ def GPhys.join_md(gpnary, no_sort=false)
#< Check >
if !gpnary.is_a?(NArray)
raise(ArgumentError,"Input must be an NArray of GPhys")
end
@@ -1281,22 +1282,22 @@
end
gpnary = gpnary.transpose(*imap)
end
#< Sort along dimensions to join >
- gpnary = __sort_gpnary(gpnary)
+ gpnary = __sort_gpnary(gpnary) unless no_sort
#< Join! >
self.join_md_nocheck(gpnary)
end
# Join multiple GPhys objects (not need for any pre-ordering).
#
# ARGUMENT
# * gpnarray [Array (or 1D NArray) of GPhys]
#
- def GPhys.join(gpary, ignore_overlap=false)
+ def GPhys.join(gpary, ignore_overlap=false, no_sort=false)
#< initialization with the first GPhys object >
gp = gpary[0]
rank = gp.rank
@@ -1330,10 +1331,10 @@
end
gpnary = gpstore.to_na
#< Sort along dimensions to join >
- gpnary = __sort_gpnary(gpnary)
+ gpnary = __sort_gpnary(gpnary) unless no_sort
#< Join! >
self.join_md_nocheck(gpnary)
end