Skip to content

Commit

Permalink
fix issue #48
Browse files Browse the repository at this point in the history
  • Loading branch information
Torminator committed Aug 3, 2017
1 parent 4b3a2b5 commit 74a6be9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DAT/DAT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ either an Axis type or a tuple of axis types. Keyword arguments are passed to `m
It is assumed that `f` takes an array input and returns a single value.
"""
reduceCube{T<:CubeAxis}(f::Function,c::CABLAB.Cubes.AbstractCubeData,dim::Type{T};kwargs...)=reduceCube(f,c,(dim,);kwargs...)
function reduceCube(f::Function,c::CABLAB.Cubes.AbstractCubeData,dim::Tuple,no_ocean=any(i->isa(i,LonAxis) || isa(i,LatAxis),axes(c)) ? 0 : 1;kwargs...)
function reduceCube(f::Function,c::CABLAB.Cubes.AbstractCubeData,dim::Tuple,addargs,no_ocean=any(i->isa(i,LonAxis) || isa(i,LatAxis),axes(c)) ? 0 : 1;kwargs...)
if in(LatAxis,dim)
axlist=axes(c)
inAxes=map(i->getAxis(i,axlist),dim)
Expand All @@ -202,9 +202,9 @@ function reduceCube(f::Function,c::CABLAB.Cubes.AbstractCubeData,dim::Tuple,no_o
wone=reshape(cosd(latAxis.values),ssmall)
ww=zeros(sfull).+wone
wv=Weights(reshape(ww,length(ww)))
return mapCube(f,c,wv,indims=dim,outdims=((),),inmissing=(:nullable,),outmissing=(:nullable,),inplace=false;kwargs...)
return mapCube(f,c,wv,indims=dim,outdims=((),), addargs,inmissing=(:nullable,),outmissing=(:nullable,),inplace=false;kwargs...)
else
return mapCube(f,c,indims=dim,outdims=((),),inmissing=(:nullable,),outmissing=(:nullable,),inplace=false;kwargs...)
return mapCube(f,c,indims=dim,outdims=((),), addargs,inmissing=(:nullable,),outmissing=(:nullable,),inplace=false;kwargs...)
end
end

Expand Down

0 comments on commit 74a6be9

Please sign in to comment.