Closed corviday closed 7 years ago
ncWMS is able to serve maps of this file without difficulty
This does not seem to be strictly true. ncWMS is able to serve most maps of this file, but not indivdual requests which cross the longitude discontinuity (180 / -180 degrees) and require a bounding box whose minimum is larger than its maximum. However, since climate explorer serves only maps of Canada, away from the prime meridian or the antimeridian, this should not be an issue for anticipated use.
It does affect some of ncWMS's debug features, and could come up in a future project, if we are ever doing world-wide imagery with odd tiling patterns.
ncWMS2 automatically converts ncWMS version 1 config files into ncWMS version 2 config files, which have a slightly different format. It fills in all necessarily details either by reading the original config file or by directly querying the netCDF files.
This process seems to be error-prone in cases where grid longitudes go from -180 to 180 but "break" somewhere other than between -180 and 180. In our case, some files break at 0 longitude, and go from 0 to 180, followed by -180 to -1.
ncWMS is able to serve maps of this file without difficulty, but during the config file conversion process, it is unable to guess the maximum and minimum values of tasmax by random sampling, presumably because the grid sampling algorithm does not properly handle the "wrapped" longitude (there is no trouble with files with monotonic longitudes). ncWMS then assigns a default range of [0, 100] to tasmax, ignoring the (correct) minimum and maximum specified in the to-be-converted config file.
When the map is served, it is initially missing or all-black, because both the minimum and maximum color scale range [0,100] are outside the actual range of the variable (217-315 Kelvin). One the user autoscales the map, the correct colours are shown, and recorded in the config file, so the map loads correctly in the future.
Adding a flag to allow ncwms-configurator to output a version 2 config file will let us skip the automated v1-to-v2 config conversion process and use minmax from the pcic_meta database, which is both faster and more correct than having ncWMS guess the minmax by random sampling, and won't result in unusable black maps.