<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Le 09/03/11 23:25, Aaron Braeckel a écrit :
    <blockquote cite="mid:4D77FE67.8050902@ucar.edu" type="cite">When I
      retry this resampling operation with identical VerticalCRSs it<br>
      <pre wrap="">results in:

Caused by:
org.opengis.referencing.operation.NoninvertibleTransformException: Transform is not invertible.
  at org.geotoolkit.internal.referencing.MatrixUtilities.invertSquare(MatrixUtilities.java:305)
...
Caused by: javax.vecmath.SingularMatrixException: cannot invert matrix
...

The result of cvg.getGridGeometry().getGridToCRS().toString() is:

PARAM_MT["Affine",
PARAMETER["num_row", 5],
PARAMETER["num_col", 5],
PARAMETER["elt_0_0", 20.318],
PARAMETER["elt_0_4", -3332.314824642418],
PARAMETER["elt_1_1", -20.318],
PARAMETER["elt_1_4", 3983.006785884024],
PARAMETER["elt_2_2", 304.8],
PARAMETER["elt_2_4", 3048.0],
PARAMETER["elt_3_3", �],
PARAMETER["elt_3_4", 1.0]]
</pre>
    </blockquote>
    <br>
    I suspect that the matrix is considered non-invertible because of
    the <tt>Double.NaN</tt> value in the 4th matrix row (the � symbol
    in above WKT). Geotk puts a NaN as the scale factor for dimensions
    for which <a
href="http://www.unidata.ucar.edu/software/netcdf-java/v4.2/javadoc/ucar/nc2/dataset/CoordinateAxis1D.html#isRegular%28%29"><tt>CoordinateSystem1D.isRegular()</tt></a>
    (from the UCAR API) returned <tt>false</tt>. Assuming we are not
    facing a Geotk bug, I would guess that the 4th dimension in your
    dataset is the time dimension and contains non-evenly spaced data.<br>
    <br>
    Tomorrow, I will add some code logic for making matrix inversions
    more tolerant to NaN values. It will hopefully be done by the end of
    the day (I know precisely how to do that).<br>
    <br>
        Regards,<br>
    <br>
            Martin<br>
    <br>
  </body>
</html>