Github user lewismc commented on a diff in the pull request: https://github.com/apache/climate/pull/383#discussion_r75452491 --- Diff: examples/podaac_integration_example.py --- @@ -0,0 +1,75 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +import ocw.data_source.podaac as podaac +import ocw.evaluation as evaluation +import ocw.metrics as metrics +import ocw.plotter as plotter + +datasetId = 'PODAAC-CCF30-01XXX' +datasetShortName = 'CCMP_MEASURES_ATLAS_L4_OW_L3_0_WIND_VECTORS_FLK' +variable = 'uwnd' +name = 'PO.DAAC_test_dataset' +OUTPUT_PLOT = "cmc_temporal_std" +""" Step 1: Load Local NetCDF Files into OCW Dataset Objects """ +print("Loading %s dataset into an OCW dataset objects" % datasetShortName) +cmc_dataset = podaac.load_dataset( + variable=variable, datasetId=datasetId, datasetShortName=datasetShortName, name=name) +print "CMC_Dataset.values shape: (times, lats, lons) - %s \n" % (cmc_dataset.values.shape,) + +# Acessing latittudes and longitudes of netCDF file +lats = cmc_dataset.lats +lons = cmc_dataset.lons + +""" Step 2: Build a Metric to use for Evaluation - Temporal STD for this example """ +# You can build your own metrics, but OCW also ships with some common metrics +print "Setting up a Temporal STD metric to use for evaluation" +std = metrics.TemporalStdDev() + +""" Step 3: Create an Evaluation Object using Datasets and our Metric """ +# The Evaluation Class Signature is: +# Evaluation(reference, targets, metrics, subregions=None) +# Evaluation can take in multiple targets and metrics, so we need to convert +# our examples into Python lists. Evaluation will iterate over the lists +print "Making the Evaluation definition" --- End diff -- Please make all function calls Python3 compatible. The call to print.... is not.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---