Package edu.wisc.ssec.mcidasv.data.hydra
Class MultiSpectralDataSource
java.lang.Object
ucar.unidata.collab.SharableImpl
ucar.unidata.data.DataSourceImpl
edu.wisc.ssec.mcidasv.data.HydraDataSource
edu.wisc.ssec.mcidasv.data.hydra.MultiSpectralDataSource
- All Implemented Interfaces:
Sharable
,DataSource
,DataSourceFactory
,XmlPersistable
A data source for Multi Dimension Data
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map
<String, MultiSpectralData> protected MultiDimensionAdapter[]
private List
private ComboDataChoice
private static int
private static final String
private boolean
protected String
Sources fileprivate boolean
private boolean
private static final org.slf4j.Logger
private MultiSpectralData
private List
<MultiSpectralData> static final String
private FlatField
private PreviewSelection
protected MultiDimensionReader
private SpectrumAdapter
private SwathAdapter
Fields inherited from class edu.wisc.ssec.mcidasv.data.HydraDataSource
oldSourceFromBundles, request, sources
Fields inherited from class ucar.unidata.data.DataSourceImpl
changeDataPathsCbx, dataCacheKey, dataChoices, geoSelectionPanel, haveBeenUnPersisted, okToContinue, PARAM_SHOW_HIDE, PARAM_SHOW_NO, PARAM_SHOW_YES
Fields inherited from interface ucar.unidata.data.DataSource
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 Summary
ConstructorsConstructorDescriptionZero-argument constructor for construction via unpersistence.MultiSpectralDataSource
(String fileName) MultiSpectralDataSource
(DataSourceDescriptor descriptor, String fileName, Hashtable properties) Construct a new HYDRA hdf data source.MultiSpectralDataSource
(DataSourceDescriptor descriptor, List newSources, Hashtable properties) Construct a new HYDRA hdf data source. -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected Data
applyProperties
(Data data, Hashtable requestProperties, Map<String, double[]> subset) private DataChoice
doMakeDataChoice
(int idx, MultiSpectralData adapter) void
Make and insert theDataChoices
for thisDataSource
.boolean
Check to see if thisHDFHydraDataSource
is equal to the object in question.public HashMap getSubsetFromLonLatRect(MultiDimensionSubset select, GeoSelection geoSelection) { GeoLocationInfo ginfo = geoSelection.getBoundingBox(); return adapters[0].getSubsetFromLonLatRect(select.getSubset(), ginfo.getMinLat(), ginfo.getMaxLat(), ginfo.getMinLon(), ginfo.getMaxLon()); }getData
(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties) Get the data applicable to the DataChoice and selection criteria.protected Data
getDataInner
(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties) Get the data for the given DataChoice and selection criteria.Called by the IDV's persistence manager in an effort to collect all of the files that should be included in a zipped bundle.getDataProjection
(Map<String, double[]> subset) static MapProjection
getDataProjection
(FlatField fltField) getMultiSpectralData
(int idx) getMultiSpectralData
(String name) getMultiSpectralData
(DataChoice choice) static MapProjection
getSwathProjection
(FlatField image, float[][] corners) void
Implement the XmlPersistable interface method that is called after this object has been fully created and initialized after being unpersisted by the XmlEncoder.protected void
initDataSelectionComponents
(List<DataSelectionComponent> components, DataChoice dataChoice) Add any data selection componentsstatic Linear2DSet
makeGrid
(MapProjection mp, double res) static Linear2DSet
makeGrid
(MapProjection mp, float[][] corners, float res) void
setDatasetName
(String name) void
setup()
static FlatField
swathToGrid
(Linear2DSet grid, FlatField[] swaths, double mode) Resolution of grid should match the loweset of swaths.static FlatField
swathToGrid
(Linear2DSet grid, FlatField[] swaths, RealTupleType newRangeType, double mode) Resolution of grid should match the loweset of swaths.static FlatField
swathToGrid
(Linear2DSet grid, FlatField swath, double mode) Grid and swath must both have a CoordinateSystem with an Earth Reference.static boolean
validLonLat
(float[][] lonlat) Methods inherited from class edu.wisc.ssec.mcidasv.data.HydraDataSource
addPropertiesTabs, canSaveDataToLocalDisk, clearCachedData, doMakeDateTimes, getAdapters, isFileBased
Methods inherited from class ucar.unidata.data.DataSourceImpl
addActions, addDataChangeListener, addDataChoice, addReloadTab, applyFieldMask, applyProperties, beginWritingDataToLocalDisk, canAddCurrentName, canCacheDataToDisk, canChangeData, canDoAllLevels, canDoFieldMask, canDoGeoSelection, canDoGeoSelectionMap, canDoGeoSelectionStride, canPoll, canShowParameter, checkForInitAfterUnPersistence, clearFileCache, clearTimes, convertSourceFile, convertToFilesIfDirectory, createAutoDisplay, createCacheKey, createElement, decrOutstandingGetDataCalls, doDirectory, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSubsetPropertiesComponent, doRemove, endWritingDataToLocalDisk, expandIfNeeded, findDataChoice, findDataChoices, flushCache, getAbsoluteDateTimes, getActions, getAlias, getAllDateTimes, getAllDateTimes, getAllLevels, getAllLevels, getAllTimesForTimeDriver, getCache, getCache, getCacheClearDelay, getCacheDataToDisk, getCompositeDataChoices, getData, getDataCachePath, getDataChangeListeners, getDataChoices, getDataContext, getDataInner, getDataIsEditable, getDataPrefix, getDataSelection, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, getDefaultSave, getDescription, getDescriptor, getErrorMessage, getEverChangedName, getExtraGeoSelectionComponent, getExtraTimesComponent, getFileFilterForPolling, getFullDescription, getid, getIdv, getInError, getLocalDirectory, getLocationForPolling, getLocationsForPolling, getMostRecentFiles, getName, getNameForDataSource, getNeedToShowErrorToUser, getNextId, getOutstandingGetDataCalls, getPartialDescription, getPassword, getPathsThatCanBeRelative, getPollingInfo, getProperties, getPropertiesComponents, getPropertiesHeader, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRelativePaths, getSampleDataProjection, getSaveDataFileLabel, getSelectedDateTimes, getSelectedDateTimes, getTimesFromDataSelection, getTmpPaths, getTypeName, getUserName, handlePropertiesAction, hasPollingInfo, holdsDateTimes, holdsIndices, identifiedBy, identifiedByName, incrOutstandingGetDataCalls, initAfter, initAfterCreation, initDataChoice, initFromXml, isPolling, loadFieldMask, loadFieldMask, loadLatestFile, logException, logException, makeDerivedDataChoices, makeSaveLocalActions, newFileFromPolling, newFilesFromPolling, notifyDataChange, propertiesChanged, putCache, putCache, reloadData, reloadData, reloadProperties, removeCache, removeDataChangeListener, removeDataChoice, removeProperty, replaceDataChoice, resetTmpState, saveDataToLocalDisk, saveDataToLocalDisk, saveDataToLocalDisk, selectTimesFromList, setAlias, setAskToUpdate, setCacheClearDelay, setCacheDataToDisk, setDataEditableStrings, setDataIsEditable, setDataIsRelative, setDataRelativeStrings, setDataSelection, setDateTimeSelection, setDefaultSave, setDescription, setDescriptor, setDirectory, setEverChangedName, setInError, setInError, setInError, setName, setNewFiles, setObjectProperties, setObjectProperty, setPassword, setPollingInfo, setPollLocation, setProperties, setProperty, setProperty, setRelativePaths, setTemplateName, setTmpPaths, setUserName, shouldCache, shouldCache, showPasswordDialog, showPropertiesDialog, showPropertiesDialog, showPropertiesDialog, showWaitDialog, tick, toString, toStringTruncated, updateDetailsText, updateState, writeFieldMaskFile, writeFieldMaskFile
Methods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ucar.unidata.data.DataSource
getUniqueId
-
Field Details
-
logger
-
filename
Sources file -
reader
-
adapters
-
DATA_DESCRIPTION
- See Also:
-
defaultSubset
-
swathAdapter
-
spectrumAdapter
-
multiSpectData
-
multiSpectData_s
-
adapterMap
-
categories
-
hasImagePreview
-
hasChannelSelect
-
doAggregation
-
comboChoice
-
previewSelection
-
previewImage
-
paramKey
- See Also:
-
count
-
-
Constructor Details
-
MultiSpectralDataSource
public MultiSpectralDataSource()Zero-argument constructor for construction via unpersistence. -
MultiSpectralDataSource
- Throws:
VisADException
-
MultiSpectralDataSource
public MultiSpectralDataSource(DataSourceDescriptor descriptor, String fileName, Hashtable properties) throws VisADException Construct a new HYDRA hdf data source.- Parameters:
descriptor
- descriptor for thisDataSource
fileName
- name of the hdf file to readproperties
- hashtable of properties- Throws:
VisADException
- problem creating data
-
MultiSpectralDataSource
public MultiSpectralDataSource(DataSourceDescriptor descriptor, List newSources, Hashtable properties) throws VisADException Construct a new HYDRA hdf data source.- Parameters:
descriptor
- descriptor for thisDataSource
newSources
- List of filenamesproperties
- hashtable of properties- Throws:
VisADException
- problem creating data
-
-
Method Details
-
setup
- Throws:
Exception
-
initAfterUnpersistence
Description copied from class:ucar.unidata.data.DataSourceImpl
Implement the XmlPersistable interface method that is called after this object has been fully created and initialized after being unpersisted by the XmlEncoder.- Specified by:
initAfterUnpersistence
in interfaceDataSource
- Overrides:
initAfterUnpersistence
in classDataSourceImpl
-
doMakeDataChoices
Make and insert theDataChoices
for thisDataSource
.- Overrides:
doMakeDataChoices
in classDataSourceImpl
-
addChoice
-
doMakeDataChoice
- Throws:
Exception
-
equals
Check to see if thisHDFHydraDataSource
is equal to the object in question.- Overrides:
equals
in classDataSourceImpl
- Parameters:
o
- object in question- Returns:
- true if they are the same or equivalent objects
-
getMultiSpectralData
-
getMultiSpectralData
-
getMultiSpectralData
-
getMultiSpectralData
-
getDatasetName
-
setDatasetName
-
getComboDataChoice
-
getDataPaths
Called by the IDV's persistence manager in an effort to collect all of the files that should be included in a zipped bundle.- Specified by:
getDataPaths
in interfaceDataSource
- Overrides:
getDataPaths
in classDataSourceImpl
- Returns:
- Singleton list containing the file that this data source came from.
-
getData
public Data getData(String name, Map<String, double[]> subset) throws VisADException, RemoteExceptionpublic HashMap getSubsetFromLonLatRect(MultiDimensionSubset select, GeoSelection geoSelection) { GeoLocationInfo ginfo = geoSelection.getBoundingBox(); return adapters[0].getSubsetFromLonLatRect(select.getSubset(), ginfo.getMinLat(), ginfo.getMaxLat(), ginfo.getMinLon(), ginfo.getMaxLon()); }- Throws:
VisADException
RemoteException
-
getData
public Data getData(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties) throws VisADException, RemoteException Description copied from class:ucar.unidata.data.DataSourceImpl
Get the data applicable to the DataChoice and selection criteria.- Specified by:
getData
in interfaceDataSource
- Overrides:
getData
in classDataSourceImpl
- Parameters:
dataChoice
- choice that defines the datacategory
- the data categorydataSelection
- DataSelection for subsettingrequestProperties
- extra request properties- Returns:
- the associated data
- Throws:
VisADException
- VisAD problemRemoteException
- Java RMI problem
-
getDataInner
protected Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties) throws VisADException, RemoteException Description copied from class:HydraDataSource
Get the data for the given DataChoice and selection criteria.- Overrides:
getDataInner
in classHydraDataSource
- Parameters:
dataChoice
- DataChoice for selectioncategory
- DataCategory for the DataChoice (not used)dataSelection
- subsetting criteriarequestProperties
- extra request properties- Returns:
- the Data object for the request
- Throws:
VisADException
- couldn't create the dataRemoteException
- couldn't create a remote data object
-
getDataProjection
-
applyProperties
protected Data applyProperties(Data data, Hashtable requestProperties, Map<String, double[]> subset) throws VisADException, RemoteException- Throws:
VisADException
RemoteException
-
initDataSelectionComponents
protected void initDataSelectionComponents(List<DataSelectionComponent> components, DataChoice dataChoice) Description copied from class:ucar.unidata.data.DataSourceImpl
Add any data selection components- Overrides:
initDataSelectionComponents
in classDataSourceImpl
- Parameters:
components
- list of componentsdataChoice
- the data choice
-
getDataProjection
- Throws:
Exception
-
getSwathProjection
public static MapProjection getSwathProjection(FlatField image, float[][] corners) throws VisADException, RemoteException - Throws:
VisADException
RemoteException
-
makeGrid
- Throws:
Exception
-
makeGrid
- Throws:
Exception
-
swathToGrid
public static FlatField swathToGrid(Linear2DSet grid, FlatField[] swaths, double mode) throws Exception Resolution of grid should match the loweset of swaths.- Parameters:
grid
- the new domain (target of reproject).swaths
- one or more swaths to be reprojected.mode
- See ReprojectSwath for details.- Throws:
Exception
-
swathToGrid
public static FlatField swathToGrid(Linear2DSet grid, FlatField[] swaths, RealTupleType newRangeType, double mode) throws Exception Resolution of grid should match the loweset of swaths.- Parameters:
grid
- the new domain (target of reproject).swaths
- one or more swaths to be reprojected.newRangeType
- user must supply.mode
- See ReprojectSwath for details.- Throws:
Exception
-
swathToGrid
public static FlatField swathToGrid(Linear2DSet grid, FlatField swath, double mode) throws Exception Grid and swath must both have a CoordinateSystem with an Earth Reference.- Parameters:
grid
- the new domain (target of reproject).swath
- swath to be reprojected.mode
- See ReprojectSwath for details.- Throws:
Exception
-
validLonLat
-