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

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.SuomiNPPDataSource
All Implemented Interfaces:
Sharable, DataSource, DataSourceFactory, XmlPersistable

public class SuomiNPPDataSource
extends HydraDataSource

A data source for NPOESS Preparatory Project (Suomi NPP) data This will probably move, but we are placing it here for now since we are leveraging some existing code used for HYDRA.


Field Summary
protected  MultiDimensionAdapter[] adapters
           
private  List categories
           
private  String crisFilter
           
private static String DATA_DESCRIPTION
           
private  HashMap defaultSubset
           
protected  String filename
          Sources file
private  boolean hasChannelSelect
           
private  boolean hasImagePreview
           
(package private)  ucar.nc2.Attribute instrumentName
           
private  int inTrackDimensionLength
           
private  boolean isCombinedProduct
           
private static org.slf4j.Logger logger
           
private  HashMap<String,MultiSpectralData> msdMap
           
private  ArrayList<MultiSpectralData> multiSpectralData
           
private  boolean nameHasBeenSet
           
protected  MultiDimensionReader nppAggReader
           
private  String ompsFilter
           
private  FlatField previewImage
           
private  String productName
           
(package private)  SimpleDateFormat sdf
           
(package private)  SimpleDateFormat sdfOut
           
private static String SEPARATOR_CHAR
           
 TrackAdapter track_adapter
           
private static int[] XSCAN_POSSIBILITIES
           
private static int[] YSCAN_POSSIBILITIES
           
private static int[] ZSCAN_POSSIBILITIES
           
 
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
SuomiNPPDataSource()
          Zero-argument constructor for construction via unpersistence.
SuomiNPPDataSource(DataSourceDescriptor descriptor, List<String> newSources, Hashtable properties)
          Construct a new Suomi NPP HDF5 data source.
SuomiNPPDataSource(DataSourceDescriptor descriptor, String fileName, Hashtable properties)
          Construct a new Suomi NPP HDF5 data source.
 
Method Summary
protected  Data applyProperties(Data data, Hashtable requestProperties, HashMap subset, int adapterIndex)
           
private  DataChoice doMakeDataChoice(int idx, MultiSpectralData adapter)
           
private  DataChoice doMakeDataChoice(int idx, String var)
           
 void doMakeDataChoices()
          Make and insert the DataChoice-s for this DataSource.
 boolean equals(Object o)
          Check to see if this SuomiNPPDataSource is equal to the object in question.
 Data getData(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties)
           
protected  Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties)
          Get the data for the given DataChoice and selection criteria.
 String getDatasetName()
           
 MultiSpectralData getMultiSpectralData()
           
 MultiSpectralData getMultiSpectralData(DataChoice choice)
           
 HashMap getSubsetFromLonLatRect(MultiDimensionSubset select, GeoSelection geoSelection)
           
 void initAfterUnpersistence()
           
protected  void initDataSelectionComponents(List<DataSelectionComponent> components, DataChoice dataChoice)
           
 void setDatasetName(String name)
           
 void setup()
           
 
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, 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, getDataPaths, getDataPrefix, getDataSelection, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, 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, 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


nppAggReader

protected MultiDimensionReader nppAggReader

adapters

protected MultiDimensionAdapter[] adapters

multiSpectralData

private ArrayList<MultiSpectralData> multiSpectralData

msdMap

private HashMap<String,MultiSpectralData> msdMap

DATA_DESCRIPTION

private static final String DATA_DESCRIPTION
See Also:
Constant Field Values

instrumentName

ucar.nc2.Attribute instrumentName

productName

private String productName

crisFilter

private String crisFilter

ompsFilter

private String ompsFilter

defaultSubset

private HashMap defaultSubset

track_adapter

public TrackAdapter track_adapter

categories

private List categories

hasChannelSelect

private boolean hasChannelSelect

hasImagePreview

private boolean hasImagePreview

isCombinedProduct

private boolean isCombinedProduct

nameHasBeenSet

private boolean nameHasBeenSet

previewImage

private FlatField previewImage

YSCAN_POSSIBILITIES

private static int[] YSCAN_POSSIBILITIES

XSCAN_POSSIBILITIES

private static int[] XSCAN_POSSIBILITIES

ZSCAN_POSSIBILITIES

private static int[] ZSCAN_POSSIBILITIES

inTrackDimensionLength

private int inTrackDimensionLength

SEPARATOR_CHAR

private static final String SEPARATOR_CHAR
See Also:
Constant Field Values

sdf

SimpleDateFormat sdf

sdfOut

SimpleDateFormat sdfOut
Constructor Detail

SuomiNPPDataSource

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


SuomiNPPDataSource

public SuomiNPPDataSource(DataSourceDescriptor descriptor,
                          String fileName,
                          Hashtable properties)
                   throws VisADException
Construct a new Suomi NPP HDF5 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

SuomiNPPDataSource

public SuomiNPPDataSource(DataSourceDescriptor descriptor,
                          List<String> newSources,
                          Hashtable properties)
                   throws VisADException
Construct a new Suomi NPP HDF5 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 VisADException
Throws:
VisADException

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

doMakeDataChoice

private DataChoice doMakeDataChoice(int idx,
                                    String var)
                             throws Exception
Throws:
Exception

doMakeDataChoice

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

equals

public boolean equals(Object o)
Check to see if this SuomiNPPDataSource 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)

getDatasetName

public String getDatasetName()

setDatasetName

public void setDatasetName(String name)

getSubsetFromLonLatRect

public HashMap getSubsetFromLonLatRect(MultiDimensionSubset select,
                                       GeoSelection geoSelection)

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

applyProperties

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

initDataSelectionComponents

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