Unidata/ncWMS — pull request #8 by joanpau (2014-10-02 11:19:15+00:00)
Title: Remove broken legacy code for time axes.

Ncwms produces an error when handling variables with a time coordinate when
the reference date in the `units` attribute includes the valid time zone specifications
`Z` or `UTC`. This can be checked in the example dataset [1].
The removal of some legacy code fixes the issue.

Ncwms uses `org.joda.time.DateTime` as the type of time instants.
The conversion from numeric values of time variable coordinates (time axes)
in NetCDF datasets is done by the function `CdmUtils.getTimesteps` as follows:

1. When a time axis uses the standard (gregorian) calendar the conversion
is based on the `CoordinateAxis1DTime.getCalendarDates` method.

2. Otherwise, the conversion falls back to some legacy code which does not
parse correctly the units attribute. It fails when the time zone of the
reference date is not specified exacty as `HH`, `-HH`, `HH:MM` or `-HH:MM`
(for example `UTC`, or `Z`, or `+HH:MM`).

It seems that the reasons for this are historical. Probably the netcdf-java
classes did not handle non-standard calendars properly when that code was
written, and custom code based on the `org.joda.time.Chronology` type
was developed for that cases.

However, it seems that this code has been already included in the netcdf-java
classes, so the non-standard calendars are properly handled by the
`CoordinateAxis1DTime.getCalendarDates` method, which does not suffer
from the error parsing the reference date.

The proposal consists solely on the removal of that legacy code.

[1]: http://thredds.socib.es/thredds/catalog/test_data/ncwms_timezone_bug/catalog.html?dataset=test_data/ncwms_timezone_bug/break_ncwms.nc