lib/numru/ganalysis/eof.rb in gphys-1.5.5 vs lib/numru/ganalysis/eof.rb in gphys-1.5.6
- old
+ new
@@ -90,11 +90,11 @@
unless w.shape == new_grid.shape
raise "shape of weight is invalid"
end
w /= w.mean
w.reshape!(n)
- else
+ elsif new_grid.rank >= 2
nc0 = new_grid.coord(0)
nc1 = new_grid.coord(1)
if !(opts[:disable_weight]||opts["disable_weight"]) &&
( /^lon/ =~ nc0.name || /^degree.*_east/ =~ nc0.units.to_s ) &&
( /^lat/ =~ nc1.name || /^degree.*_north/ =~ nc1.units.to_s )
@@ -105,9 +105,11 @@
w /= w.mean
w.reshape!(n)
else
w = nil
end
+ else
+ w = nil
end
ary = NArrayMiss.new(gphys.typecode, n_lost, n)
ind_rank = dims1.length
ind = Array.new(ind_rank,0)