public class GridCoverageDataSource extends GridDataSource
Modifier and Type | Class and Description |
---|---|
static class |
GridCoverageDataSource.HugeSizeException
Class description
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object |
DOMAIN_SET_MUTEX
Used to synchronize the geogridadapter
|
static java.lang.String |
PREF_LARGE_REMOTE_DATA_WARN
Preference - warn users for large remote data requests
|
static java.lang.String |
PREF_VERTICALCS
Preference
|
static java.lang.String |
PROP_GRIDSIZE
grid size
|
static java.lang.String |
PROP_TIMESIZE
property timesize
|
static java.lang.String |
PROP_TIMEVAR
property time variable
|
protected java.lang.Object |
readLock
This is used to synchronize geogrid read access
|
static boolean |
testMode
for test
|
ATTR_EAST, ATTR_NORTH, ATTR_SOUTH, ATTR_WEST, ATTR_X, ATTR_Y, ATTR_Z, PROP_ENSEMBLEMEMBERS
adapters, oldSourceFromBundles, sources
changeDataPathsCbx, dataCacheKey, dataChoices, geoSelectionPanel, haveBeenUnPersisted, okToContinue, PARAM_SHOW_HIDE, PARAM_SHOW_NO, PARAM_SHOW_YES
DATAPATH_DATE_FORMAT, DATAPATH_DATE_PATTERN, MOST_RECENT, ordinalNames, PROP_AUTOCREATEDISPLAY, PROP_BASEDIRECTORY, PROP_CACHEABLE, PROP_DATACHOICENAME, PROP_DISPLAYPROPERTIES, PROP_DOCUMENTLINKS, PROP_FILEPATTERN, PROP_GEOLOCATION, PROP_ICON, PROP_NAME, PROP_POLLINFO, PROP_RESOLVERURL, PROP_SERVICE_HTTP, PROP_SUBPROPERTIES, PROP_TIMELABELS, PROP_TIMESTRIDE, PROP_TITLE
Constructor and Description |
---|
GridCoverageDataSource()
Default constructor
|
GridCoverageDataSource(DataSourceDescriptor descriptor,
ucar.nc2.ft2.coverage.adapter.DtCoverageDataset gds,
java.lang.String name,
java.lang.String filename)
Construct a GeoGridDataSource
|
GridCoverageDataSource(DataSourceDescriptor descriptor,
java.io.File file,
java.util.Hashtable properties)
Create a GridCoverageDataSource from a File.
|
GridCoverageDataSource(DataSourceDescriptor descriptor,
java.util.List files,
java.util.Hashtable properties)
Create a GeoGridDataSource from the filename.
|
GridCoverageDataSource(DataSourceDescriptor descriptor,
java.lang.String filename,
java.util.Hashtable properties)
Create a GeoGridDataSource from the filename.
|
GridCoverageDataSource(ucar.nc2.ft2.coverage.adapter.DtCoverageDataset gds)
Create a GeoGridDataSource from the GridDataset
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertiesTabs(javax.swing.JTabbedPane tabbedPane)
Add any extra tabs into the properties tab
|
protected void |
applyFieldMask(org.w3c.dom.Element root)
Load any subset info in field mask xml
|
boolean |
applyProperties()
Apply the properties
|
protected java.lang.Object |
beginWritingDataToLocalDisk(java.lang.String msg)
Overwrite this method so we don't show the loading dialog
|
int |
calculateStrideFactor(int dataPoints,
int displayPoints)
_more_
|
boolean |
canCacheDataToDisk()
Can this data source cache its
|
protected boolean |
canDoFieldMask()
Can we mask the data?
|
boolean |
canDoGeoSelection()
We can do geo selection in the properties gui
|
boolean |
canSaveDataToLocalDisk()
Can this DataSource save data to local disk?
|
protected void |
doMakeDataChoices()
This method is called at initialization time and
creates a set of
DirectDataChoice -s
and adds them into the base class managed list of DataChoice-s
with the method addDataChoice. |
protected ucar.nc2.ft2.coverage.adapter.DtCoverageDataset |
doMakeDataSet()
Create the dataset from the name of this DataSource.
|
protected java.util.List |
doMakeDateTimes()
Return the list of DateTime-s associated with this DataSource.
|
protected javax.swing.JComponent |
doMakeGeoSubsetPropertiesComponent()
Add in the spatial dimensions label
|
void |
doRemove()
Called when Datasource is removed.
|
ucar.nc2.ft2.coverage.adapter.DtCoverage |
findGridForDataChoice(ucar.nc2.ft2.coverage.adapter.DtCoverageDataset ds,
DataChoice dc)
Find the grid in the dataset from the DataChoice
|
java.util.List |
getAllDateTimes(DataChoice dataChoice)
Override the base class method to return the times for the data choice
|
java.util.List |
getAllLevels(DataChoice dataChoice,
DataSelection dataSelection)
Get the list of all levels available from this DataSource
|
visad.Data |
getData(java.lang.String parameter)
Get the data for a particular parameter
|
protected visad.Data |
getDataInner(DataChoice dataChoice,
DataCategory category,
DataSelection givenDataSelection,
java.util.Hashtable requestProperties)
Get the Data object specified by the particular selection criteria.
|
java.util.List |
getDataPaths()
What should be changed by the user when in data relative mode
|
ucar.nc2.ft2.coverage.adapter.DtCoverageDataset |
getDataset()
Return the GridDataset associated with this DataSource.
|
protected javax.swing.JComponent |
getExtraGeoSelectionComponent()
Get the extra label that is shown in the geo-subset panel
|
protected javax.swing.JComponent |
getExtraTimesComponent()
Add the reverse times checkbox
|
java.lang.String |
getFullDescription()
Get the full description of the grid
|
protected java.lang.String |
getLocalDirectory(java.lang.String label,
java.lang.String prefix)
Get the local directory
|
java.util.List<ucar.ma2.Range> |
getRangesFromLatLonRect(ucar.nc2.ft2.coverage.adapter.DtCoverageCS dtCoverageCS,
ucar.unidata.geoloc.LatLonRect rect) |
java.util.List<ucar.ma2.Range> |
getRangesFromLonRange(ucar.nc2.ft2.coverage.adapter.DtCoverageCS dtCoverageCS,
double lonMin,
double lonMax) |
boolean |
getReverseTimes()
Get the ReverseTimes property.
|
protected ucar.unidata.geoloc.ProjectionImpl |
getSampleDataProjection()
Return the sample projection
|
protected java.lang.String |
getSaveDataFileLabel()
Get the label for the save data file option
|
int |
getTimeIndexWithBounds(visad.DateTime dateTime,
java.util.List<visad.DateTime> allTimes,
ucar.nc2.ft2.coverage.CoverageCoordAxis1D cca)
Find the time index in the dataset with smallest bound values
|
java.util.List<ucar.nc2.util.NamedObject> |
getTimes(java.util.List<ucar.nc2.time.CalendarDate> cdates) |
int |
indexOf(java.lang.Object o,
java.util.List levels)
Find the index of the given object in the list of levels.
|
void |
initAfterCreation()
Initialize after we have been created.
|
void |
initAfterUnpersistence()
Initialize if being unpersisted.
|
boolean |
isLocalFile()
Are we a local file
|
static boolean |
isNumeric(java.lang.String str)
check if a input is only numeric number
|
protected boolean |
isZAxisOk(ucar.nc2.dataset.CoordinateAxis1D zaxis)
Utility to check if we should ignore the given z axis
|
java.util.List<java.lang.String> |
listParameters()
Get the list of parameters
|
static void |
main(java.lang.String[] args)
Test this class by running
"java ucar.unidata.data.grid.GeoGridDataSource
|
ucar.nc2.util.Optional<ucar.ma2.RangeIterator> |
makeRange(ucar.nc2.ft2.coverage.adapter.DtCoverageCS dtCoverageCS,
double minValue,
double maxValue) |
protected void |
makeSaveLocalActions(java.util.List actions)
Make savel local actions
|
void |
reloadData()
Clear out the data set
|
void |
resetTmpState()
Reset the tmp state
|
protected void |
resolvePath()
Resolve the url if we have to
|
protected java.util.List |
saveDataToLocalDisk(java.lang.String prefix,
java.lang.Object loadId,
boolean changeLinks)
Save the data to local disk.
|
void |
setDefaultSelectionBounds(java.awt.geom.Rectangle2D.Float rect)
Set the default selection bounds
|
void |
setFileNameOrUrl(java.lang.String value)
Set the FileNameOrUrl property.
|
void |
setNewFiles(java.util.List files)
Overwrite setNewFiles so we clear out the resolverurl
|
void |
setReverseTimes(boolean value)
Set the ReverseTimes property.
|
void |
setTmpPaths(java.util.List paths)
Set what the user has changed
|
protected void |
sourcesChanged()
The source has changed
|
void |
updateState(java.lang.Object newObject,
java.util.Hashtable newProperties)
Update the state
|
protected void |
writeFieldMaskFile(org.w3c.dom.Document doc,
org.w3c.dom.Element root)
Write out the field mask file
|
getEnsDCategory, getEnsembleSelection, getThreeDCategories, getThreeDEnsTimeSeriesCategories, getThreeDTimeSeriesCategories, getTwoDCategories, getTwoDEnsTimeSeriesCategories, getTwoDTimeSeriesCategories, initCategories, setEnsembleSelection
equals, getDataFileExtension, getFilePath, getInputStreams, getLocationsForPolling, getPartialDescription, getSource, getSources, haveSources, initWithPollingInfo, isFileBased, newFilesFromPolling, processDataFilename, propertiesChanged, reloadData, setSource, setSources
addActions, addDataChangeListener, addDataChoice, addReloadTab, canAddCurrentName, canChangeData, canDoAllLevels, canDoGeoSelectionMap, canDoGeoSelectionStride, canPoll, canShowParameter, checkForInitAfterUnPersistence, clearCachedData, clearFileCache, clearTimes, convertSourceFile, convertToFilesIfDirectory, createAutoDisplay, createCacheKey, createElement, decrOutstandingGetDataCalls, doDirectory, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, endWritingDataToLocalDisk, expandIfNeeded, findDataChoice, findDataChoices, flushCache, getAbsoluteDateTimes, getActions, getAlias, getAllDateTimes, getAllLevels, getAllTimesForTimeDriver, getCache, getCache, getCacheClearDelay, getCacheDataToDisk, getCompositeDataChoices, getData, getData, getDataCachePath, getDataChangeListeners, getDataChoices, getDataContext, getDataInner, getDataIsEditable, getDataPrefix, getDataSelection, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, getDefaultSave, getDescription, getDescriptor, getErrorMessage, getEverChangedName, getFileFilterForPolling, getid, getIdv, getInError, getLocationForPolling, getMostRecentFiles, getName, getNameForDataSource, getNeedToShowErrorToUser, getNextId, getOutstandingGetDataCalls, getPassword, getPathsThatCanBeRelative, getPollingInfo, getProperties, getPropertiesComponents, getPropertiesHeader, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRelativePaths, getSelectedDateTimes, getSelectedDateTimes, getTimesFromDataSelection, getTmpPaths, getTypeName, getUserName, handlePropertiesAction, hasPollingInfo, holdsDateTimes, holdsIndices, identifiedBy, identifiedByName, incrOutstandingGetDataCalls, initAfter, initDataChoice, initDataSelectionComponents, initFromXml, isPolling, loadFieldMask, loadFieldMask, loadLatestFile, logException, logException, makeDerivedDataChoices, newFileFromPolling, notifyDataChange, putCache, putCache, reloadProperties, removeCache, removeDataChangeListener, removeDataChoice, removeProperty, replaceDataChoice, saveDataToLocalDisk, saveDataToLocalDisk, selectTimesFromList, setAlias, setAskToUpdate, setCacheClearDelay, setCacheDataToDisk, setDataEditableStrings, setDataIsEditable, setDataIsRelative, setDataRelativeStrings, setDataSelection, setDateTimeSelection, setDefaultSave, setDescription, setDescriptor, setDirectory, setEverChangedName, setInError, setInError, setInError, setName, setObjectProperties, setObjectProperty, setPassword, setPollingInfo, setPollLocation, setProperties, setProperty, setProperty, setRelativePaths, setTemplateName, setUserName, shouldCache, shouldCache, showPasswordDialog, showPropertiesDialog, showPropertiesDialog, showPropertiesDialog, showWaitDialog, tick, toString, toStringTruncated, updateDetailsText, writeFieldMaskFile
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getUniqueId
public static final java.lang.String PREF_VERTICALCS
public static final java.lang.String PREF_LARGE_REMOTE_DATA_WARN
public static final java.lang.String PROP_GRIDSIZE
public static final java.lang.String PROP_TIMESIZE
public static final java.lang.String PROP_TIMEVAR
public static boolean testMode
protected final java.lang.Object DOMAIN_SET_MUTEX
protected final java.lang.Object readLock
public GridCoverageDataSource()
public GridCoverageDataSource(DataSourceDescriptor descriptor, ucar.nc2.ft2.coverage.adapter.DtCoverageDataset gds, java.lang.String name, java.lang.String filename)
descriptor
- the data source descriptorgds
- The GridDatasetname
- A namefilename
- the filenamepublic GridCoverageDataSource(ucar.nc2.ft2.coverage.adapter.DtCoverageDataset gds)
gds
- the GridDatasetpublic GridCoverageDataSource(DataSourceDescriptor descriptor, java.io.File file, java.util.Hashtable properties) throws java.io.IOException
descriptor
- Describes this data source, has a label etc.file
- This is the file that points to the actual
data source.properties
- General properties used in the base classjava.io.IOException
- problem opening filepublic GridCoverageDataSource(DataSourceDescriptor descriptor, java.lang.String filename, java.util.Hashtable properties) throws java.io.IOException
descriptor
- Describes this data source, has a label etc.filename
- This is the filename (or url) that points
to the actual data source.properties
- General properties used in the base classjava.io.IOException
- Signals that an I/O exception has occurred.public GridCoverageDataSource(DataSourceDescriptor descriptor, java.util.List files, java.util.Hashtable properties) throws java.io.IOException
descriptor
- Describes this data source, has a label etc.files
- List of files or urlsproperties
- General properties used in the base classjava.io.IOException
- Signals that an I/O exception has occurred.public static boolean isNumeric(java.lang.String str)
str
- is this numericpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- filenamejava.lang.Exception
- some error occurredpublic void setDefaultSelectionBounds(java.awt.geom.Rectangle2D.Float rect)
rect
- rectangleprotected void applyFieldMask(org.w3c.dom.Element root)
applyFieldMask
in class DataSourceImpl
root
- xml rootprotected boolean canDoFieldMask()
canDoFieldMask
in class DataSourceImpl
protected void writeFieldMaskFile(org.w3c.dom.Document doc, org.w3c.dom.Element root)
writeFieldMaskFile
in class DataSourceImpl
doc
- doc to write toroot
- root nodepublic void initAfterUnpersistence()
initAfterUnpersistence
in interface DataSource
initAfterUnpersistence
in class FilesDataSource
protected javax.swing.JComponent doMakeGeoSubsetPropertiesComponent()
doMakeGeoSubsetPropertiesComponent
in class DataSourceImpl
protected javax.swing.JComponent getExtraGeoSelectionComponent()
getExtraGeoSelectionComponent
in class DataSourceImpl
public void addPropertiesTabs(javax.swing.JTabbedPane tabbedPane)
addPropertiesTabs
in class DataSourceImpl
tabbedPane
- The properties tabpublic void initAfterCreation()
initAfterCreation
in interface DataSource
initAfterCreation
in class FilesDataSource
public java.util.List getDataPaths()
getDataPaths
in interface DataSource
getDataPaths
in class FilesDataSource
public void updateState(java.lang.Object newObject, java.util.Hashtable newProperties)
updateState
in interface DataSource
updateState
in class FilesDataSource
newObject
- new objectnewProperties
- propertiespublic void setTmpPaths(java.util.List paths)
setTmpPaths
in interface DataSource
setTmpPaths
in class DataSourceImpl
paths
- new pathsprotected void resolvePath()
protected void sourcesChanged()
sourcesChanged
in class FilesDataSource
public void reloadData()
reloadData
in interface DataSource
reloadData
in class FilesDataSource
public void doRemove()
doRemove
in interface DataSource
doRemove
in class FilesDataSource
public boolean canSaveDataToLocalDisk()
canSaveDataToLocalDisk
in interface DataSource
canSaveDataToLocalDisk
in class DataSourceImpl
protected java.lang.String getSaveDataFileLabel()
getSaveDataFileLabel
in class DataSourceImpl
protected void makeSaveLocalActions(java.util.List actions)
makeSaveLocalActions
in class DataSourceImpl
actions
- list of actionsprotected java.lang.Object beginWritingDataToLocalDisk(java.lang.String msg)
beginWritingDataToLocalDisk
in class DataSourceImpl
msg
- The msg to show in the dialogprotected java.util.List saveDataToLocalDisk(java.lang.String prefix, java.lang.Object loadId, boolean changeLinks) throws java.lang.Exception
saveDataToLocalDisk
in class FilesDataSource
prefix
- the prefix for the local file nameloadId
- the load id (for cancelling)changeLinks
- true to change the linksjava.lang.Exception
- problem saving data.public boolean isLocalFile()
public void setNewFiles(java.util.List files)
setNewFiles
in interface DataSource
setNewFiles
in class FilesDataSource
files
- The list of new files to useprotected java.lang.String getLocalDirectory(java.lang.String label, java.lang.String prefix)
getLocalDirectory
in class DataSourceImpl
label
- a labelprefix
- the prefixpublic java.lang.String getFullDescription()
getFullDescription
in interface DataSource
getFullDescription
in class FilesDataSource
public void resetTmpState()
resetTmpState
in interface DataSource
resetTmpState
in class DataSourceImpl
protected ucar.nc2.ft2.coverage.adapter.DtCoverageDataset doMakeDataSet()
public ucar.nc2.ft2.coverage.adapter.DtCoverageDataset getDataset()
protected ucar.unidata.geoloc.ProjectionImpl getSampleDataProjection()
getSampleDataProjection
in class DataSourceImpl
protected void doMakeDataChoices()
DirectDataChoice
-s
and adds them into the base class managed list of DataChoice-s
with the method addDataChoice.doMakeDataChoices
in class DataSourceImpl
protected visad.Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection givenDataSelection, java.util.Hashtable requestProperties) throws visad.VisADException, java.rmi.RemoteException
getDataInner
in class DataSourceImpl
dataChoice
- DataChoice to select.category
- DataCategory (unused at present)givenDataSelection
- DataSelection criteria for this request.requestProperties
- extra request selection properties (not used
in this class)visad.VisADException
- couldn't create Data objectjava.rmi.RemoteException
- couldn't create remote Data objectpublic java.util.List<java.lang.String> listParameters()
public visad.Data getData(java.lang.String parameter) throws visad.VisADException, java.rmi.RemoteException
parameter
- the parameter namejava.rmi.RemoteException
- Java RMI Errorvisad.VisADException
- VisAD Errorprotected java.util.List doMakeDateTimes()
doMakeDateTimes
in class DataSourceImpl
public java.util.List getAllLevels(DataChoice dataChoice, DataSelection dataSelection)
getAllLevels
in interface DataSource
getAllLevels
in class DataSourceImpl
dataChoice
- The data choice we are getting levels fordataSelection
- the data selectionpublic boolean canDoGeoSelection()
canDoGeoSelection
in interface DataSource
canDoGeoSelection
in class DataSourceImpl
public boolean canCacheDataToDisk()
canCacheDataToDisk
in class DataSourceImpl
public ucar.nc2.util.Optional<ucar.ma2.RangeIterator> makeRange(ucar.nc2.ft2.coverage.adapter.DtCoverageCS dtCoverageCS, double minValue, double maxValue)
public int calculateStrideFactor(int dataPoints, int displayPoints)
dataPoints
- _more_displayPoints
- _more_public int indexOf(java.lang.Object o, java.util.List levels) throws visad.VisADException
o
- Objectlevels
- levelsvisad.VisADException
- On badnesspublic int getTimeIndexWithBounds(visad.DateTime dateTime, java.util.List<visad.DateTime> allTimes, ucar.nc2.ft2.coverage.CoverageCoordAxis1D cca)
dateTime
- the timeallTimes
- the DateTime listcca
- the data CoordinateAxis1DTimepublic ucar.nc2.ft2.coverage.adapter.DtCoverage findGridForDataChoice(ucar.nc2.ft2.coverage.adapter.DtCoverageDataset ds, DataChoice dc)
ds
- the grid datasetdc
- the data choiceprotected boolean isZAxisOk(ucar.nc2.dataset.CoordinateAxis1D zaxis)
zaxis
- given z axispublic java.util.List getAllDateTimes(DataChoice dataChoice)
getAllDateTimes
in interface DataSource
getAllDateTimes
in class DataSourceImpl
dataChoice
- DataChoice in questionpublic void setFileNameOrUrl(java.lang.String value)
value
- The new value for FileNameOrUrlpublic boolean applyProperties()
applyProperties
in class DataSourceImpl
protected javax.swing.JComponent getExtraTimesComponent()
getExtraTimesComponent
in class DataSourceImpl
public boolean getReverseTimes()
public void setReverseTimes(boolean value)
value
- The new value for ReverseTimespublic java.util.List<ucar.ma2.Range> getRangesFromLatLonRect(ucar.nc2.ft2.coverage.adapter.DtCoverageCS dtCoverageCS, ucar.unidata.geoloc.LatLonRect rect) throws ucar.ma2.InvalidRangeException
ucar.ma2.InvalidRangeException
public java.util.List<ucar.ma2.Range> getRangesFromLonRange(ucar.nc2.ft2.coverage.adapter.DtCoverageCS dtCoverageCS, double lonMin, double lonMax) throws ucar.ma2.InvalidRangeException
ucar.ma2.InvalidRangeException
public java.util.List<ucar.nc2.util.NamedObject> getTimes(java.util.List<ucar.nc2.time.CalendarDate> cdates)