Package ucar.nc2.dt.radial
Class AbstractRadialAdapter
- java.lang.Object
-
- ucar.nc2.dt.radial.AbstractRadialAdapter
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,RadialDatasetSweep
,FeatureDataset
,FeatureDatasetFactory
,FileCacheable
- Direct Known Subclasses:
CFRadialAdapter
,Dorade2RadialAdapter
,Nexrad2RadialAdapter
,NidsRadialAdapter
,NsslRadialAdapter
,UF2RadialAdapter
public abstract class AbstractRadialAdapter extends Object implements RadialDatasetSweep, FeatureDatasetFactory
Make a NetcdfDataset into a RadialDatasetSweep.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractRadialAdapter.MyRadialVariableAdapter
-
Nested classes/interfaces inherited from interface ucar.nc2.dt.RadialDatasetSweep
RadialDatasetSweep.RadialVariable, RadialDatasetSweep.Sweep, RadialDatasetSweep.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected LatLonRect
boundingBox
protected CalendarDateUnit
calDateUnits
protected HashMap
csHash
protected List<VariableSimpleIF>
dataVariables
protected DateUnit
dateUnits
protected String
desc
protected Date
endDate
protected FileCacheIF
fileCache
protected String
location
protected NetcdfDataset
netcdfDataset
protected EarthLocation
origin
protected StringBuffer
parseInfo
protected Date
startDate
protected String
title
-
Constructor Summary
Constructors Constructor Description AbstractRadialAdapter()
AbstractRadialAdapter(NetcdfDataset ds)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected abstract void
addRadialVariable(NetcdfDataset ds, Variable var)
AttributeContainer
attributes()
Get the global attributes.void
calcBounds()
void
close()
Close all resources associated with this dataset.Attribute
findGlobalAttributeIgnoreCase(String name)
Deprecated.use attributes()LatLonRect
getBoundingBox()
The lat/lon boundingBox for the entire dataset.CalendarDate
getCalendarDateEnd()
Ending Calendar date for the entire dataset.CalendarDateRange
getCalendarDateRange()
Calendar Date range for the entire dataset.CalendarDate
getCalendarDateStart()
Starting Calendar date for the entire dataset.CalendarDateUnit
getCalendarDateUnit()
RadialDatasetSweep.Type
getCommonType()
If all the sweeps are the same type, return it here, else NONEVariableSimpleIF
getDataVariable(String shortName)
Get the named data Variable.List<VariableSimpleIF>
getDataVariables()
The radial data variables available in the dataset.DateRange
getDateRange()
String
getDescription()
Text information about this dataset.String
getDetailInfo()
void
getDetailInfo(Formatter sf)
Show debug / underlying implementation detailsEarthLocation
getEarthLocation()
Date
getEndDate()
FeatureType
getFeatureType()
Contains collections of this FeatureType.FeatureType[]
getFeatureTypes()
This Factory can open these types of Feature datasets.List<Attribute>
getGlobalAttributes()
Deprecated.use attributes()String
getImplementationName()
Show who is implementinglong
getLastModified()
Returns the time that the underlying file(s) were last modified.String
getLocation()
The URI location of the datasetString
getLocationURI()
NetcdfFile
getNetcdfFile()
Return underlying NetcdfFile, or null if none.Date
getStartDate()
DateUnit
getTimeUnits()
Get the units of Calendar time.String
getTitle()
Title of the dataset.protected abstract RadialDatasetSweep.RadialVariable
makeRadialVariable(NetcdfDataset nds, Variable v0)
void
reacquire()
Deprecated.do not usevoid
release()
Deprecated.do not useprotected void
removeDataVariable(String varName)
protected void
setBoundingBox()
void
setDescription(String desc)
protected abstract void
setEarthLocation()
protected abstract void
setEndDate()
void
setFileCache(FileCacheIF fileCache)
Deprecated.do not usevoid
setLocationURI(String location)
protected abstract void
setStartDate()
protected abstract void
setTimeUnits()
void
setTitle(String title)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ucar.nc2.ft.FeatureDatasetFactory
isMine, open
-
Methods inherited from interface ucar.nc2.dt.RadialDatasetSweep
clearDatasetMemory, getCommonOrigin, getDataFormat, getRadarID, getRadarName, isStationary, isVolume
-
-
-
-
Field Detail
-
netcdfDataset
protected NetcdfDataset netcdfDataset
-
title
protected String title
-
desc
protected String desc
-
location
protected String location
-
startDate
protected Date startDate
-
endDate
protected Date endDate
-
boundingBox
protected LatLonRect boundingBox
-
dataVariables
protected List<VariableSimpleIF> dataVariables
-
parseInfo
protected StringBuffer parseInfo
-
origin
protected EarthLocation origin
-
csHash
protected HashMap csHash
-
dateUnits
protected DateUnit dateUnits
-
calDateUnits
protected CalendarDateUnit calDateUnits
-
fileCache
protected FileCacheIF fileCache
-
-
Constructor Detail
-
AbstractRadialAdapter
public AbstractRadialAdapter()
-
AbstractRadialAdapter
public AbstractRadialAdapter(NetcdfDataset ds)
-
-
Method Detail
-
addRadialVariable
protected abstract void addRadialVariable(NetcdfDataset ds, Variable var)
-
makeRadialVariable
protected abstract RadialDatasetSweep.RadialVariable makeRadialVariable(NetcdfDataset nds, Variable v0)
-
setEarthLocation
protected abstract void setEarthLocation()
-
setStartDate
protected abstract void setStartDate()
-
setEndDate
protected abstract void setEndDate()
-
setTitle
public void setTitle(String title)
-
setDescription
public void setDescription(String desc)
-
setLocationURI
public void setLocationURI(String location)
-
removeDataVariable
protected void removeDataVariable(String varName)
-
setBoundingBox
protected void setBoundingBox()
-
calcBounds
public void calcBounds() throws IOException
- Throws:
IOException
-
getStartDate
public Date getStartDate()
-
getEndDate
public Date getEndDate()
-
getBoundingBox
public LatLonRect getBoundingBox()
Description copied from interface:FeatureDataset
The lat/lon boundingBox for the entire dataset.- Specified by:
getBoundingBox
in interfaceFeatureDataset
- Returns:
- the lat/lon boundingBox for the entire dataset, or null if unknown.
-
getDataVariables
public List<VariableSimpleIF> getDataVariables()
Description copied from interface:RadialDatasetSweep
The radial data variables available in the dataset.- Specified by:
getDataVariables
in interfaceFeatureDataset
- Specified by:
getDataVariables
in interfaceRadialDatasetSweep
- Returns:
- List of type RadialDatasetSweep.RadialVariable
-
getDataVariable
public VariableSimpleIF getDataVariable(String shortName)
Description copied from interface:FeatureDataset
Get the named data Variable.- Specified by:
getDataVariable
in interfaceFeatureDataset
- Parameters:
shortName
- of data Variable.- Returns:
- VariableSimpleIF or null if not found
-
getCommonType
public RadialDatasetSweep.Type getCommonType()
Description copied from interface:RadialDatasetSweep
If all the sweeps are the same type, return it here, else NONE- Specified by:
getCommonType
in interfaceRadialDatasetSweep
- Returns:
- type of sweep, or NONE
-
getTimeUnits
public DateUnit getTimeUnits()
Description copied from interface:RadialDatasetSweep
Get the units of Calendar time. To get a Date, from a time value, call DateUnit.getStandardDate(double value). To get units as a String, call DateUnit.getUnitsString().- Specified by:
getTimeUnits
in interfaceRadialDatasetSweep
- Returns:
- units of Calendar time
-
getCalendarDateUnit
public CalendarDateUnit getCalendarDateUnit()
-
getEarthLocation
public EarthLocation getEarthLocation()
-
getFeatureTypes
public FeatureType[] getFeatureTypes()
Description copied from interface:FeatureDatasetFactory
This Factory can open these types of Feature datasets.- Specified by:
getFeatureTypes
in interfaceFeatureDatasetFactory
- Returns:
- array of FeatureType
-
getFeatureType
public FeatureType getFeatureType()
Description copied from interface:FeatureDataset
Contains collections of this FeatureType.- Specified by:
getFeatureType
in interfaceFeatureDataset
- Returns:
- FeatureType of data
-
getDateRange
public DateRange getDateRange()
-
getCalendarDateRange
public CalendarDateRange getCalendarDateRange()
Description copied from interface:FeatureDataset
Calendar Date range for the entire dataset.- Specified by:
getCalendarDateRange
in interfaceFeatureDataset
- Returns:
- the date range for the entire dataset, or null if unknown
-
getCalendarDateStart
public CalendarDate getCalendarDateStart()
Description copied from interface:FeatureDataset
Starting Calendar date for the entire dataset.- Specified by:
getCalendarDateStart
in interfaceFeatureDataset
- Returns:
- the starting date for the entire dataset, or null if unknown
-
getCalendarDateEnd
public CalendarDate getCalendarDateEnd()
Description copied from interface:FeatureDataset
Ending Calendar date for the entire dataset.- Specified by:
getCalendarDateEnd
in interfaceFeatureDataset
- Returns:
- the ending date for the entire dataset, or null if unknown
-
getDetailInfo
public void getDetailInfo(Formatter sf)
Description copied from interface:FeatureDataset
Show debug / underlying implementation details- Specified by:
getDetailInfo
in interfaceFeatureDataset
- Parameters:
sf
- append info here
-
getImplementationName
public String getImplementationName()
Description copied from interface:FeatureDataset
Show who is implementing- Specified by:
getImplementationName
in interfaceFeatureDataset
- Returns:
- name of implementor
-
setFileCache
@Deprecated public void setFileCache(FileCacheIF fileCache)
Deprecated.do not useDescription copied from interface:FileCacheable
If the FileCache is not null, FileCacheable.close() must call FileCache.release()public synchronized void close() throws java.io.IOException { if (cache != null) { if (cache.release(this)) return; } reallyClose(); }
- Specified by:
setFileCache
in interfaceFileCacheable
- Parameters:
fileCache
- must store this, use it on close as above.
-
close
public void close() throws IOException
Description copied from interface:FeatureDataset
Close all resources associated with this dataset.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceFeatureDataset
- Specified by:
close
in interfaceFileCacheable
- Throws:
IOException
- on i/o error
-
release
@Deprecated public void release() throws IOException
Deprecated.do not useDescription copied from interface:FileCacheable
Release any system resources like file handles. Optional, implement only if you are able to reacquire. Used when object is made inactive in cache.- Specified by:
release
in interfaceFileCacheable
- Throws:
IOException
-
reacquire
@Deprecated public void reacquire() throws IOException
Deprecated.do not useDescription copied from interface:FileCacheable
Reacquire any resources like file handles Used when reactivating in cache.- Specified by:
reacquire
in interfaceFileCacheable
- Throws:
IOException
-
getLastModified
public long getLastModified()
Description copied from interface:FileCacheable
Returns the time that the underlying file(s) were last modified. If they've changed since they were stored in the cache, they will be closed and reopened withFileFactory
.- Specified by:
getLastModified
in interfaceFileCacheable
- Returns:
- a
long
value representing the time the file(s) were last modified or0L
if the last-modified time couldn't be determined for any reason.
-
getNetcdfFile
public NetcdfFile getNetcdfFile()
Description copied from interface:FeatureDataset
Return underlying NetcdfFile, or null if none.- Specified by:
getNetcdfFile
in interfaceFeatureDataset
- Returns:
- the underlying NetcdfFile, or null if none.
-
getTitle
public String getTitle()
Description copied from interface:FeatureDataset
Title of the dataset.- Specified by:
getTitle
in interfaceFeatureDataset
- Returns:
- the title of the dataset, or null
-
getDescription
public String getDescription()
Description copied from interface:FeatureDataset
Text information about this dataset.- Specified by:
getDescription
in interfaceFeatureDataset
- Returns:
- any text information about this dataset, or null.
-
getLocationURI
public String getLocationURI()
-
getLocation
public String getLocation()
Description copied from interface:FeatureDataset
The URI location of the dataset- Specified by:
getLocation
in interfaceFeatureDataset
- Specified by:
getLocation
in interfaceFileCacheable
- Returns:
- the URI location of the dataset, or null
-
attributes
public AttributeContainer attributes()
Description copied from interface:FeatureDataset
Get the global attributes.- Specified by:
attributes
in interfaceFeatureDataset
-
getGlobalAttributes
@Deprecated public List<Attribute> getGlobalAttributes()
Deprecated.use attributes()Description copied from interface:FeatureDataset
List of global attributes.- Specified by:
getGlobalAttributes
in interfaceFeatureDataset
- Returns:
- List of type ucar.nc2.Attribute, may be empty but not null
-
findGlobalAttributeIgnoreCase
@Deprecated public Attribute findGlobalAttributeIgnoreCase(String name)
Deprecated.use attributes()Description copied from interface:FeatureDataset
Return the global attribute with the given name, ignoring case.- Specified by:
findGlobalAttributeIgnoreCase
in interfaceFeatureDataset
- Parameters:
name
- attribute name- Returns:
- the global attribute, or null
-
getDetailInfo
public String getDetailInfo()
-
-