Skip to content

Commit bf9dc1e

Browse files
committed
1. In the section involving 'allaxesdummy', where a dummy variable is created to ensure the inclusion of all axes,
now only small axes (<100) are forced to be included. 2. In a call of disambig, somehow the parentheses in var.size() had disappeared. I restored them.
1 parent c184be3 commit bf9dc1e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Packages/cdms2/Script/cdscan

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,11 +1058,14 @@ def main(argv):
10581058

10591059
varnames = f.variables.keys()
10601060

1061-
# try to force all axes to be included...
1061+
# Try to force all axes to be included, but only small ones, length<100.
1062+
# This section was motivated by a need to preserve the cloud axes isccp_prs,isccp_tau.
1063+
# If we ever need to preserve longer axes as well, we could create one variable per axis...
10621064
crude_var_axes = [ [ ax[0] for ax in var.getDomain() ] for var in f.variables.values() ]
10631065
var_axes = set().union( *crude_var_axes )
10641066
other_axes = list( set(f.axes.values()) - var_axes )
10651067
if len(other_axes)>0:
1068+
other_axes = [ax for ax in other_axes if len(ax)<100]
10661069
other_axes.sort( key=(lambda ax:ax.id) )
10671070
axisvar = cdms2.createVariable( numpy.ones([len(ax) for ax in other_axes]),
10681071
axes=other_axes, id='allaxesdummy')
@@ -1160,7 +1163,7 @@ def main(argv):
11601163
else:
11611164
currentdomain, attrs, tcode = vardict[var.id]
11621165
if comparedomains(currentdomain, tempdomain):
1163-
sepname = disambig(var.id, vardict, var.size, compareVarDictValues, (tempdomain, None))
1166+
sepname = disambig(var.id, vardict, var.size(), compareVarDictValues, (tempdomain, None))
11641167
saveid = var.id
11651168
varname = var.id = sepname
11661169
varattrs = copyDict(var.attributes)

0 commit comments

Comments
 (0)