Method: NumRu::VArrayNetCDF#val=

Defined in:
lib/numru/gphys/varraynetcdf.rb

#val=(narray) ⇒ Object



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/numru/gphys/varraynetcdf.rb', line 269

def val=(narray)
	if narray.is_a?(Numeric)
	  @ary.put( narray )
	else
	  if shape_ul0.include?(0)
	    # has unlimited dimension
	    narray = __check_ary_class(narray)
	    slicer = (0...rank).collect{|i|
 (shape_ul0[i] != 0) ? true : 0...narray.shape[i]
	    }
	    @ary[*slicer] = narray
	  else
	    @ary.put( __check_ary_class(narray) )
	  end
	  narray
	end
end