Example #1
0
 def setUpClass(cls):
     cls.datasetId = 'PODAAC-GHCMC-4FM02'
     cls.variable = 'sea_ice_fraction'
     cls.name = 'PO.DAAC_test_dataset'
     cls.file_path = os.path.dirname(os.path.abspath(__file__))
     cls.format = '.nc'
     cls.dataset = podaac.load_level4_granule(
         cls.variable, cls.datasetId, cls.name)
Example #2
0
 def setUpClass(cls):
     cls.datasetId = 'PODAAC-GHCMC-4FM02'
     cls.variable = 'sea_ice_fraction'
     cls.name = 'PO.DAAC_test_dataset'
     cls.file_path = os.path.dirname(os.path.abspath(__file__))
     cls.format = '.nc'
     cls.dataset = podaac.load_level4_granule(cls.variable, cls.datasetId,
                                              cls.name)
Example #3
0
# specific language governing permissions and limitations
# under the License.

import ocw.data_source.podaac_datasource as podaac
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter

datasetId = 'PODAAC-CCF30-01XXX'
variable = 'uwnd'
name = 'PO.DAAC_test_dataset'
OUTPUT_PLOT = "ccmp_temporal_std"
""" Step 1: Load Local NetCDF Files into OCW Dataset Objects """
print("Loading %s dataset short name into a OCW dataset object." % datasetId)
ccmp_dataset = podaac.load_level4_granule(variable=variable,
                                          datasetId=datasetId,
                                          name=name)
print("CCMP_Dataset.values shape: (times, lats, lons) - %s \n" %
      (ccmp_dataset.values.shape, ))

# Acessing latittudes and longitudes of netCDF file
lats = ccmp_dataset.lats
lons = ccmp_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
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

import ocw.data_source.podaac_datasource as podaac
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter

datasetId = 'PODAAC-CCF30-01XXX'
variable = 'uwnd'
name = 'PO.DAAC_test_dataset'
OUTPUT_PLOT = "ccmp_temporal_std"
""" Step 1: Load Local NetCDF Files into OCW Dataset Objects """
print("Loading %s dataset short name into a OCW dataset object." % datasetId)
ccmp_dataset = podaac.load_level4_granule(
    variable=variable, datasetId=datasetId, name=name)
print("CCMP_Dataset.values shape: (times, lats, lons) - %s \n" %
      (ccmp_dataset.values.shape,))

# Acessing latittudes and longitudes of netCDF file
lats = ccmp_dataset.lats
lons = ccmp_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)