edu.wisc.ssec.mcidasv.data.hydra
Class MultiSpectralDataSource

java.lang.Object
  extended by ucar.unidata.collab.SharableImpl
      extended by ucar.unidata.data.DataSourceImpl
          extended by edu.wisc.ssec.mcidasv.data.HydraDataSource
              extended by edu.wisc.ssec.mcidasv.data.hydra.MultiSpectralDataSource
All Implemented Interfaces:
Sharable, DataSource, DataSourceFactory, XmlPersistable

public class MultiSpectralDataSource
extends HydraDataSource

A data source for Multi Dimension Data


Field Summary
private  HashMap<String,MultiSpectralData> adapterMap
           
protected  MultiDimensionAdapter[] adapters
           
private  List categories
           
private  ComboDataChoice comboChoice
           
private static int count
           
private static String DATA_DESCRIPTION
           
private  HashMap defaultSubset
           
private  boolean doAggregation
           
protected  String filename
          Sources file
private  boolean hasChannelSelect
           
private  boolean hasImagePreview
           
private static org.slf4j.Logger logger
           
private  MultiSpectralData multiSpectData
           
private  ArrayList<MultiSpectralData> multiSpectData_s
           
static String paramKey
           
private  FlatField previewImage
           
private  PreviewSelection previewSelection
           
protected  MultiDimensionReader reader
           
private  SpectrumAdapter spectrumAdapter
           
private  SwathAdapter 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_TITLE
 
Constructor Summary
MultiSpectralDataSource()
          Zero-argument constructor for construction via unpersistence.
MultiSpectralDataSource(DataSourceDescriptor descriptor, List newSources, Hashtable properties)
          Construct a new HYDRA hdf data source.
MultiSpectralDataSource(DataSourceDescriptor descriptor, String fileName, Hashtable properties)
          Construct a new HYDRA hdf data source.
MultiSpectralDataSource(String fileName)
           
 
Method Summary
 void addChoice(String name, Data data)
           
protected  Data applyProperties(Data data, Hashtable requestProperties, HashMap subset)
           
private  DataChoice doMakeDataChoice(int idx, MultiSpectralData adapter)
           
 void doMakeDataChoices()
          Make and insert the DataChoice-s for this DataSource.
 boolean equals(Object o)
          Check to see if this HDFHydraDataSource is equal to the object in question.
 ComboDataChoice getComboDataChoice()
           
 Data getData(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties)
           
 Data getData(String name, HashMap subset)
          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()); }
protected  Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties)
          Get the data for the given DataChoice and selection criteria.
 List 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.
static MapProjection getDataProjection(FlatField fltField)
           
 MapProjection getDataProjection(HashMap subset)
           
 String getDatasetName()
           
 MultiSpectralData getMultiSpectralData()
           
 MultiSpectralData getMultiSpectralData(DataChoice choice)
           
 MultiSpectralData getMultiSpectralData(int idx)
           
 MultiSpectralData getMultiSpectralData(String name)
           
static MapProjection getSwathProjection(FlatField image, float[][] corners)
           
 void initAfterUnpersistence()
           
protected  void initDataSelectionComponents(List<DataSelectionComponent> components, DataChoice dataChoice)
           
static 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)
           
static FlatField swathToGrid(Linear2DSet grid, FlatField swath, double mode)
           
static FlatField swathToGridOld(Linear2DSet grid, FlatField swath)
           
static FlatField swathToGridOld(Linear2DSet grid, FlatField[] swaths, double mode)
           
static FlatField swathToGridOld(Linear2DSet grid, FlatField swath, double mode)
           
static boolean validLonLat(float[][] lonlat)
           
 
Methods inherited from class edu.wisc.ssec.mcidasv.data.HydraDataSource
canSaveDataToLocalDisk, clearCachedData, doMakeDateTimes, getAdapters, isFileBased
 
Methods inherited from class ucar.unidata.data.DataSourceImpl
addActions, addDataChangeListener, addDataChoice, addPropertiesTabs, 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 Detail

logger

private static final org.slf4j.Logger logger

filename

protected String filename
Sources file


reader

protected MultiDimensionReader reader

adapters

protected MultiDimensionAdapter[] adapters

DATA_DESCRIPTION

private static final String DATA_DESCRIPTION
See Also:
Constant Field Values

defaultSubset

private HashMap defaultSubset

swathAdapter

private SwathAdapter swathAdapter

spectrumAdapter

private SpectrumAdapter spectrumAdapter

multiSpectData

private MultiSpectralData multiSpectData

multiSpectData_s

private ArrayList<MultiSpectralData> multiSpectData_s

adapterMap

private HashMap<String,MultiSpectralData> adapterMap

categories

private List categories

hasImagePreview

private boolean hasImagePreview

hasChannelSelect

private boolean hasChannelSelect

doAggregation

private boolean doAggregation

comboChoice

private ComboDataChoice comboChoice

previewSelection

private PreviewSelection previewSelection

previewImage

private FlatField previewImage

paramKey

public static final String paramKey
See Also:
Constant Field Values

count

private static int count
Constructor Detail

MultiSpectralDataSource

public MultiSpectralDataSource()
Zero-argument constructor for construction via unpersistence.


MultiSpectralDataSource

public MultiSpectralDataSource(String fileName)
                        throws VisADException
Throws:
VisADException

MultiSpectralDataSource

public MultiSpectralDataSource(DataSourceDescriptor descriptor,
                               String fileName,
                               Hashtable properties)
                        throws VisADException
Construct a new HYDRA hdf data source.

Parameters:
descriptor - descriptor for this DataSource
fileName - name of the hdf file to read
properties - 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 this DataSource
sources - List of filenames
properties - hashtable of properties
Throws:
VisADException - problem creating data
Method Detail

setup

public void setup()
           throws Exception
Throws:
Exception

initAfterUnpersistence

public void initAfterUnpersistence()
Specified by:
initAfterUnpersistence in interface DataSource
Overrides:
initAfterUnpersistence in class DataSourceImpl

doMakeDataChoices

public void doMakeDataChoices()
Make and insert the DataChoice-s for this DataSource.

Overrides:
doMakeDataChoices in class DataSourceImpl

addChoice

public void addChoice(String name,
                      Data data)

doMakeDataChoice

private DataChoice doMakeDataChoice(int idx,
                                    MultiSpectralData adapter)
                             throws Exception
Throws:
Exception

equals

public boolean equals(Object o)
Check to see if this HDFHydraDataSource is equal to the object in question.

Overrides:
equals in class DataSourceImpl
Parameters:
o - object in question
Returns:
true if they are the same or equivalent objects

getMultiSpectralData

public MultiSpectralData getMultiSpectralData()

getMultiSpectralData

public MultiSpectralData getMultiSpectralData(DataChoice choice)

getMultiSpectralData

public MultiSpectralData getMultiSpectralData(String name)

getMultiSpectralData

public MultiSpectralData getMultiSpectralData(int idx)

getDatasetName

public String getDatasetName()

setDatasetName

public void setDatasetName(String name)

getComboDataChoice

public ComboDataChoice getComboDataChoice()

getDataPaths

public List 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 interface DataSource
Overrides:
getDataPaths in class DataSourceImpl
Returns:
Singleton list containing the file that this data source came from.

getData

public Data getData(String name,
                    HashMap subset)
             throws VisADException,
                    RemoteException
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()); }

Throws:
VisADException
RemoteException

getData

public Data getData(DataChoice dataChoice,
                    DataCategory category,
                    DataSelection dataSelection,
                    Hashtable requestProperties)
             throws VisADException,
                    RemoteException
Specified by:
getData in interface DataSource
Overrides:
getData in class DataSourceImpl
Throws:
VisADException
RemoteException

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 class HydraDataSource
Parameters:
dataChoice - DataChoice for selection
category - DataCategory for the DataChoice (not used)
dataSelection - subsetting criteria
requestProperties - extra request properties
Returns:
the Data object for the request
Throws:
VisADException - couldn't create the data
RemoteException - couldn't create a remote data object

getDataProjection

public MapProjection getDataProjection(HashMap subset)

applyProperties

protected Data applyProperties(Data data,
                               Hashtable requestProperties,
                               HashMap subset)
                        throws VisADException,
                               RemoteException
Throws:
VisADException
RemoteException

initDataSelectionComponents

protected void initDataSelectionComponents(List<DataSelectionComponent> components,
                                           DataChoice dataChoice)
Overrides:
initDataSelectionComponents in class DataSourceImpl

getDataProjection

public static MapProjection getDataProjection(FlatField fltField)
                                       throws Exception
Throws:
Exception

getSwathProjection

public static MapProjection getSwathProjection(FlatField image,
                                               float[][] corners)
                                        throws VisADException,
                                               RemoteException
Throws:
VisADException
RemoteException

makeGrid

public static Linear2DSet makeGrid(MapProjection mp,
                                   double res)
                            throws Exception
Throws:
Exception

makeGrid

public static Linear2DSet makeGrid(MapProjection mp,
                                   float[][] corners,
                                   float res)
                            throws Exception
Throws:
Exception

swathToGridOld

public static FlatField swathToGridOld(Linear2DSet grid,
                                       FlatField swath)
                                throws Exception
Throws:
Exception

swathToGridOld

public static FlatField swathToGridOld(Linear2DSet grid,
                                       FlatField[] swaths,
                                       double mode)
                                throws Exception
Throws:
Exception

swathToGrid

public static FlatField swathToGrid(Linear2DSet grid,
                                    FlatField[] swaths,
                                    double mode)
                             throws Exception
Throws:
Exception

swathToGridOld

public static FlatField swathToGridOld(Linear2DSet grid,
                                       FlatField swath,
                                       double mode)
                                throws Exception
Throws:
Exception

swathToGrid

public static FlatField swathToGrid(Linear2DSet grid,
                                    FlatField swath,
                                    double mode)
                             throws Exception
Throws:
Exception

validLonLat

public static boolean validLonLat(float[][] lonlat)