ucar.nc2.dt.fmrc
Class FmrcImpl

java.lang.Object
  extended by ucar.nc2.dt.fmrc.FmrcImpl
All Implemented Interfaces:
ForecastModelRunCollection

public class FmrcImpl
extends Object
implements ForecastModelRunCollection

ForecastModelRunCollection implementation. Uses a GridDataset that has two time dimensions. Assume all grids have the same runTime dimension.

Author:
caron

Constructor Summary
FmrcImpl(NetcdfDataset ncd)
           
FmrcImpl(String filename)
           
 
Method Summary
 void close()
           
 void dump(Formatter f)
           
 NetcdfDataset getBestTimeSeries()
          Get a NetcdfDataset that has the "best" time series, across model runs.
 NetcdfDataset getFmrcDataset()
          Get a NetcdfDataset that is the underlying datasets with the "2d time"
 List<Date> getForecastDates()
          Get the list of possible forecast dates, to be used in getForecastTimeDataset().
 NetcdfDataset getForecastOffsetDataset(double hours)
          Get a NetcdfDataset that has all the data for a fixed forecast offset, across model runs.
 List<Double> getForecastOffsets()
          Get the list of possible forecast offsets, to be used in getForecastOffsetDataset().
 NetcdfDataset getForecastTimeDataset(Date forecastTime)
          Get a NetcdfDataset that has all the data for a fixed forecast time, across model runs.
 GridDataset getGridDataset()
          Get the underlying GridDataset.
 List<Date> getRunDates()
          Get the list of possible run dates, to be used in getRunTimeDataset().
 NetcdfDataset getRunTimeDataset(Date wantRuntime)
          Get a NetcdfDataset that has all the data for a model run.
static void main(String[] args)
           
 boolean sync()
          Check if file has changed, and reread metadata if needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FmrcImpl

public FmrcImpl(String filename)
         throws IOException
Throws:
IOException

FmrcImpl

public FmrcImpl(NetcdfDataset ncd)
         throws IOException
Throws:
IOException
Method Detail

sync

public boolean sync()
             throws IOException
Check if file has changed, and reread metadata if needed. All previous object references (variables, dimensions, etc) may become invalid - you must re-obtain.

Specified by:
sync in interface ForecastModelRunCollection
Returns:
true if file was changed.
Throws:
IOException

getGridDataset

public GridDataset getGridDataset()
Description copied from interface: ForecastModelRunCollection
Get the underlying GridDataset.

Specified by:
getGridDataset in interface ForecastModelRunCollection
Returns:
the GridDataset containing that data.

close

public void close()
           throws IOException
Specified by:
close in interface ForecastModelRunCollection
Throws:
IOException

getRunDates

public List<Date> getRunDates()
Description copied from interface: ForecastModelRunCollection
Get the list of possible run dates, to be used in getRunTimeDataset().

Specified by:
getRunDates in interface ForecastModelRunCollection
Returns:
List of Date

getRunTimeDataset

public NetcdfDataset getRunTimeDataset(Date wantRuntime)
                                throws IOException
Description copied from interface: ForecastModelRunCollection
Get a NetcdfDataset that has all the data for a model run. The time coordinate will be the forecast time. The runtime will be a global attribute called "_runTime" containing an ISO date string.

Specified by:
getRunTimeDataset in interface ForecastModelRunCollection
Parameters:
wantRuntime - names the run
Returns:
the NetcdfDataset for that data.
Throws:
IOException - on read error

getForecastDates

public List<Date> getForecastDates()
Description copied from interface: ForecastModelRunCollection
Get the list of possible forecast dates, to be used in getForecastTimeDataset().

Specified by:
getForecastDates in interface ForecastModelRunCollection
Returns:
List of Date

getForecastTimeDataset

public NetcdfDataset getForecastTimeDataset(Date forecastTime)
                                     throws IOException
Description copied from interface: ForecastModelRunCollection
Get a NetcdfDataset that has all the data for a fixed forecast time, across model runs. The time coordinate will be the run time. The forecast time will be a global attribute called "_forecastTime" containing an ISO date string.

Specified by:
getForecastTimeDataset in interface ForecastModelRunCollection
Parameters:
forecastTime - the forecast time to fix.
Returns:
the NetcdfDataset for that data.
Throws:
IOException - on read error

getForecastOffsets

public List<Double> getForecastOffsets()
Description copied from interface: ForecastModelRunCollection
Get the list of possible forecast offsets, to be used in getForecastOffsetDataset().

Specified by:
getForecastOffsets in interface ForecastModelRunCollection
Returns:
List of Double

getForecastOffsetDataset

public NetcdfDataset getForecastOffsetDataset(double hours)
                                       throws IOException
Description copied from interface: ForecastModelRunCollection
Get a NetcdfDataset that has all the data for a fixed forecast offset, across model runs. The time coordinate will be the forecast time. There will be a String-valued variable called "RunTime(time)" containing an array of ISO date strings.

Specified by:
getForecastOffsetDataset in interface ForecastModelRunCollection
Parameters:
hours - the forecast offset time to fix, in hours.
Returns:
the NetcdfDataset containing that data.
Throws:
IOException - on read error

getBestTimeSeries

public NetcdfDataset getBestTimeSeries()
                                throws IOException
Description copied from interface: ForecastModelRunCollection
Get a NetcdfDataset that has the "best" time series, across model runs. The time coordinate will be the forecast time. There will be a String-valued variable called "RunTime(time)" containing an array of ISO date strings.

Specified by:
getBestTimeSeries in interface ForecastModelRunCollection
Returns:
the NetcdfDataset containing that data.
Throws:
IOException - on read error

getFmrcDataset

public NetcdfDataset getFmrcDataset()
Description copied from interface: ForecastModelRunCollection
Get a NetcdfDataset that is the underlying datasets with the "2d time"

Specified by:
getFmrcDataset in interface ForecastModelRunCollection
Returns:
the NetcdfDataset containing that data.

dump

public void dump(Formatter f)
          throws IOException
Throws:
IOException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.