@@ -93,6 +93,31 @@ public void testReadSubset_2D_antiMeridianOverlap_right() throws IOException, In
9393 }
9494 }
9595
96+ @ Test
97+ public void testReadSubset_2D_antiMeridianOverlap_right_JasminCrash () throws IOException , InvalidRangeException {
98+ final File anMlFile = TestUtil .getTestDataFileAsserted ("era-5/v1/an_ml/2008/06/02/ecmwf-era5_oper_an_ml_200806021000.lnsp.nc" );
99+
100+ try (NetcdfFile netcdfFile = NetcdfFile .open (anMlFile .getAbsolutePath ())) {
101+ final Variable lnsp = netcdfFile .findVariable ("lnsp" );
102+ assertNotNull (lnsp );
103+
104+ final Rectangle era5Positions = new Rectangle (1438 , 66 , 2 , 2 );
105+
106+ final Array lnspArray = SatelliteFields .readSubset (1 , era5Positions , lnsp );
107+ assertNotNull (lnspArray );
108+
109+ final int [] shape = lnspArray .getShape ();
110+ assertEquals (2 , shape .length );
111+ assertEquals (2 , shape [0 ]);
112+ assertEquals (2 , shape [1 ]);
113+
114+ assertEquals (11.532238960266113f , lnspArray .getFloat (0 ), 1e-8 );
115+ assertEquals (11.532217025756836f , lnspArray .getFloat (1 ), 1e-8 );
116+ assertEquals (11.532645225524902f , lnspArray .getFloat (2 ), 1e-8 );
117+ assertEquals (11.532743453979492f , lnspArray .getFloat (3 ), 1e-8 );
118+ }
119+ }
120+
96121 @ Test
97122 public void testReadSubset_2D_antiMeridianOverlap_left () throws IOException , InvalidRangeException {
98123 final File anMlFile = TestUtil .getTestDataFileAsserted ("era-5/v1/an_sfc/2000/05/28/ecmwf-era5_oper_an_sfc_200005281700.10u.nc" );
0 commit comments