Maziyar Boustani created CLIMATE-322:
----------------------------------------

             Summary: dataset_processor._get_subregion_slice_indices cannot 
handle imprecise start and end time input
                 Key: CLIMATE-322
                 URL: https://issues.apache.org/jira/browse/CLIMATE-322
             Project: Apache Open Climate Workbench
          Issue Type: Improvement
          Components: regridding/data processing
    Affects Versions: 0.3-incubating
            Reporter: Maziyar Boustani
            Assignee: Maziyar Boustani
             Fix For: 0.4-incubating


Similar to (https://issues.apache.org/jira/browse/CLIMATE-321), but this issue 
is about not finding start and end time from dataset date list.

Error Massage:
  File 
"/Users/MBoustani/Documents/code/python/program/RCMES_cmd/trunk/ocw/dataset_processor.py",
 line 708, in _get_subregion_slice_indices
    timeStart = np.nonzero(target_dataset.times == subregion.start)[0][0]
IndexError: index 0 is out of bounds for axis 0 with size 0

Problem:
============================
The problem is that code is looking for exact time given from user into dataset 
time list. If the exact time is not matched (found) then we get the error.



Solution:
============================
It is better to find the closest time from available dataset time from user 
given time.
The code will always get closest time after given start time and closest time 
before given end time to always have safe time selection.



Example:
============================
Actual dataset start time: 2000-01-01
Actual dataset end time: 2005-12-01

If user set start time as 2000-01-03, then the current code will break due to 
not finding the exact 2000-01-03 from dataset date list.
Therefore code should find the closest date after user given start time 
(2000-02-01).

Same thing with end time, if the user set end time as 2005-11-20, then code 
should pick closest date before end time (2005-11-01).




--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to