My apologies for the top post, but the thread is getting quite long.
Here’s what I found, the issue does not appear to be a problem of aggregating four or more files - I can get the error below to trigger with just one file. The problem is the renaming of the band_1 variable after it has been built up during an aggregation. (I’m very glad you sent all the various tiff and ncml files - I’d have never figured this out w/o them.)
Here’s what will work: If you use NCML to rename the Grid variable ‘band_1’ to ‘SRB’ for each file you intend to aggregate, you can then aggregate on the Grid ‘SRB.’ So, given:
Where the .ncml files rename ‘band_1’ to ‘SRB2’ in each of the matching .tif files, the following NCML will work:
And the resulting 3 dimensional Grid will be named SRB2.
And, if you can live with the Grid being named ‘band_1,’ you can aggregate the .tif files like this:
(note that I commented out the 'variable name="SRB2" orgName=“band_1”’ part).
But, if you add <variable name="SRB2" orgName=“band_1"/> back in, the aggregation will fail. It’s a bug, at least I think it is a bug, but I cannot promise a fix soon. I tried, as a work around, using NCML to change the name of the resulting 3d Grid, like this:
But that does not work, again, that maybe a bug.
So for now: You can aggregate as many TIFF files as you want, but if you want to rename the variable that results from the aggregation, you must do so by renaming all of its components first, then combine those together.
I’m sorry this took so long to sort out and that the outcome is less than satisfactory. What you’re trying seems logically correct, but fails because the NCML implementation is applying the variable rename operation (<variable name="SRB2" orgName="band_1" />) to the DDS of the elements of the aggregation, and not the DDS that results from the previous operations (i.e., the DDS of the aggregation).
Here’s the actual error message from the ASSERT in the code:
[MST Thu Feb 15 10:56:17 2018 id: 34209][ncml] NCMLModule InternalError: [static void agg_util::AggregationUtil::transferArrayConstraints(libdap::Array *, const libdap::Array &, bool, bool, bool, const std::string &)]: ASSERTION FAILED: condition=( fromArrIt->name == toArrIt->name ) GAggregationUtil::transferArrayConstraints: Expected the dimensions to have the same name but they did not: 'easting', 'northing’.
This is not in the code you’re running - that might be an issue as well - because assertions are compiled out for production releases. I’ll change that so we trap these conditions and produce a more informative error message.