@@ -182,10 +182,8 @@ private void process(final OIData oiData) {
182182 final int [] nightIds = oiData .getNightId ();
183183 // StaIndex column:
184184 final short [][] staIndexes = oiData .getStaIndex ();
185- // Get MJDStart column:
186- final double [] mjdStart = oiData .getMJDStart ();
187- // Get MJDStart column:
188- final double [] mjdEnd = oiData .getMJDEnd ();
185+ // Get MJD column:
186+ final double [] mjds = oiData .getMJD ();
189187
190188 // note: if no OITarget table then the target will be Target.UNDEFINED
191189 final Map <Short , Target > targetIdToTarget = (oiTarget != null ) ? oiTarget .getTargetIdToTarget () : null ;
@@ -199,8 +197,6 @@ private void process(final OIData oiData) {
199197 final Set <Short > distinctTargetId = oiData .getDistinctTargetId ();
200198 // Fill distinct Night Id:
201199 final Set <NightId > distinctNightId = oiData .getDistinctNightId ();
202- // Fill distinct MJD ranges:
203- final Map <Range , Range > distinctMjdRanges = oiData .getDistinctMJDRanges ();
204200 // Fill distinct Granule:
205201 final Map <Granule , Granule > distinctGranules = oiData .getOIFitsFile ().getDistinctGranules ();
206202 // Fill oidata tables per (distinct) Granule:
@@ -211,9 +207,6 @@ private void process(final OIData oiData) {
211207 // reused NightId:
212208 NightId n = new NightId ();
213209
214- // reused Range:
215- Range r = new Range ();
216-
217210 // reused Granule:
218211 Granule g = new Granule ();
219212
@@ -239,16 +232,6 @@ private void process(final OIData oiData) {
239232 }
240233 distinctNightId .add (night );
241234
242- // Get MJD Range:
243- r .set (mjdStart [i ], mjdEnd [i ]);
244-
245- Range mjdRange = distinctMjdRanges .get (r );
246- if (mjdRange == null ) {
247- distinctMjdRanges .put (r , r );
248- mjdRange = r ;
249- r = new Range ();
250- }
251-
252235 // Get corresponding StaName:
253236 String staNames = null ;
254237 if (staIndexes != null ) {
@@ -269,6 +252,9 @@ private void process(final OIData oiData) {
269252 }
270253 }
271254
255+ // Get MJD value:
256+ final double mjd = mjds [i ];
257+
272258 // Update / Resolve Granule:
273259 g .set (target , insMode , night );
274260
@@ -279,14 +265,14 @@ private void process(final OIData oiData) {
279265 g = new Granule ();
280266 }
281267
282- // Update distinct MJD Ranges on shared granule:
283- granule .getDistinctMjdRanges ().add (mjdRange );
284-
285268 // Update distinct StaNames on shared granule:
286269 if (staNames != null ) {
287270 granule .getDistinctStaNames ().add (staNames );
288271 }
289272
273+ // Update MJD Ranges on shared granule:
274+ granule .updateMjdRange (mjd );
275+
290276 // Lookup pre-existing Granule (same granule fields):
291277 Set <OIData > oiDataTables = oiDataPerGranule .get (granule );
292278 if (oiDataTables == null ) {
@@ -303,7 +289,6 @@ private void process(final OIData oiData) {
303289 logger .log (Level .FINE , "process: OIData[{0}] nFlagged: {1}" , new Object []{oiData , nFlagged });
304290 logger .log (Level .FINE , "process: OIData[{0}] distinctTargetId {1}" , new Object []{oiData , distinctTargetId });
305291 logger .log (Level .FINE , "process: OIData[{0}] distinctNightId {1}" , new Object []{oiData , distinctNightId });
306- logger .log (Level .FINE , "process: OIData[{0}] distinctMjdRanges {1}" , new Object []{oiData , distinctMjdRanges });
307292 }
308293 }
309294
0 commit comments