[
https://issues.apache.org/jira/browse/CLIMATE-268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13746168#comment-13746168
]
Cameron Goodale commented on CLIMATE-268:
-----------------------------------------
I committed (in r1516188) the partially completed code I am using to test,
which uncovered this bug. The commit also includes the 2 NetCDF Files that
are used by the code.
To repeat the test:
=====================
Set your $PYTHONPATH to point at the folder one level ABOVE the ocw folder. In
my local machine that is:
/Users/cgoodale/Documents/workspace/apache-climate
cd into /Users/cgoodale/Documents/workspace/apache-climate/examples
run python simple-model-to-model-bias.py
{code}
$ python simple-model-to-model-bias.py
Traceback (most recent call last):
File "simple-model-to-model-bias.py", line 11, in <module>
dataset_1 = local.load_file(FILE_1, "tasmax")
File
"/Users/cgoodale/Documents/workspace/apache-climate/ocw/data_source/local.py",
line 291, in load_file
return Dataset(lats, lons, times, values, value_variable_name)
File "/Users/cgoodale/Documents/workspace/apache-climate/ocw/dataset.py",
line 54, in __init__
raise ValueError(err)
ValueError: Dataset given improperly shaped array during initialization.
{code}
Given the ValueError from Dataset it means we are still getting an array that
isn't 3 Dimensions.
> local.py returns a Dataset Object with a 4-D Array for the Dataset.values
> -------------------------------------------------------------------------
>
> Key: CLIMATE-268
> URL: https://issues.apache.org/jira/browse/CLIMATE-268
> Project: Apache Open Climate Workbench
> Issue Type: Sub-task
> Components: general
> Affects Versions: 0.2-incubating
> Environment: *nix
> Reporter: Cameron Goodale
> Assignee: Cameron Goodale
> Fix For: 0.3-incubating
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> When loading a dataset from local.py the returned OCW Dataset object has a
> value attribute with a 4 dimensional array, when it should be 3 dimensions.
> Current Shape:
> (time, height?, lat, lon)
> Instead it should be:
> :param values: Three dimensional numpy array of parameter values with shape
> [timesLength, latsLength, lonsLength]. Per Dataset class documentation.
> The local.py code needs to be updated to ensure the values are constructed
> and passed into the Dataset constructor.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira