@Test
public void testGetGeoLocation_handlesNaNs() {

    final double[][] lon = {{179, 181}, {179.5, 181.5}};
    final double[][] lat = {{20.0, 20.0}, {Double.NaN, 21.0}};
    final TestSampleSource lonSource = new TestSampleSource(lon);
    final TestSampleSource latSource = new TestSampleSource(lat);
    final PixelLocator nanLocator = SubscenePixelLocator.create(lonSource, latSource);
    final Point2D.Double geoLocation = new Point2D.Double();
    assertTrue(nanLocator.getGeoLocation(0.0, 0.0, geoLocation));
    assertEquals(179.0, geoLocation.getX(), 1e-8);
    assertEquals(20.0, geoLocation.getY(), 1e-8);
    assertTrue(nanLocator.getGeoLocation(1.0, 1.0, geoLocation));
    assertEquals(-178.5, geoLocation.getX(), 1e-8);
    assertEquals(21.0, geoLocation.getY(), 1e-8);
}