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
protected  List<String> geoSources
           
private  boolean hasChannelSelect
           
private  boolean hasImagePreview
           
(package private)  ucar.nc2.Attribute instrumentName
           
private  boolean isCombinedProduct
           
(package private)  boolean isEDR
           
private static org.slf4j.Logger logger
           
private  ArrayList<MultiSpectralData> msd_CrIS
           
private  HashMap<String,MultiSpectralData> msdMap
           
private  ArrayList<MultiSpectralData> multiSpectralData
           
private  boolean nameHasBeenSet
           
protected  MultiDimensionReader nppAggReader
           
protected  List<String> oldSources
           
private  String ompsFilter
           
private  FlatField previewImage
           
private  String productName
           
private  HashMap<String,QualityFlag> qfMap
           
(package private)  SimpleDateFormat sdf
           
(package private)  SimpleDateFormat sdfOut
           
private static String SEPARATOR_CHAR
           
 TrackAdapter track_adapter
           
 
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.
SuomiNPPDataSource(String fileName)
           
 
Method Summary
protected  Data applyProperties(Data data, Hashtable requestProperties, HashMap subset, int adapterIndex)
           
 boolean canSaveDataToLocalDisk()
          Can this data source save its dat to local disk
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)
           
 List<String> getOldSources()
           
 HashMap<String,QualityFlag> getQfMap()
           
 HashMap getSubsetFromLonLatRect(MultiDimensionSubset select, GeoSelection geoSelection)
           
 void initAfterUnpersistence()
           
protected  void initDataSelectionComponents(List<DataSelectionComponent> components, DataChoice dataChoice)
           
protected  List saveDataToLocalDisk(String filePrefix, Object loadId, boolean changeLinks)
           
 void setDatasetName(String name)
           
 void setOldSources(List<String> oldSources)
           
 void setup()
           
 
Methods inherited from class edu.wisc.ssec.mcidasv.data.HydraDataSource
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, getDataPaths, 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, 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


oldSources

protected List<String> oldSources

geoSources

protected List<String> geoSources

nppAggReader

protected MultiDimensionReader nppAggReader

adapters

protected MultiDimensionAdapter[] adapters

msd_CrIS

private ArrayList<MultiSpectralData> msd_CrIS

multiSpectralData

private ArrayList<MultiSpectralData> multiSpectralData

msdMap

private HashMap<String,MultiSpectralData> msdMap

qfMap

private HashMap<String,QualityFlag> qfMap

DATA_DESCRIPTION

private static final String DATA_DESCRIPTION
See Also:
Constant Field Values

instrumentName

ucar.nc2.Attribute instrumentName

productName

private String productName

isEDR

boolean isEDR

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

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(String fileName)
                   throws VisADException
Throws:
VisADException

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

canSaveDataToLocalDisk

public boolean canSaveDataToLocalDisk()
Description copied from class: HydraDataSource
Can this data source save its dat to local disk

Specified by:
canSaveDataToLocalDisk in interface DataSource
Overrides:
canSaveDataToLocalDisk in class HydraDataSource
Returns:
can save to local disk

saveDataToLocalDisk

protected List saveDataToLocalDisk(String filePrefix,
                                   Object loadId,
                                   boolean changeLinks)
                            throws Exception
Overrides:
saveDataToLocalDisk in class DataSourceImpl
Throws:
Exception

getOldSources

public List<String> getOldSources()

setOldSources

public void setOldSources(List<String> oldSources)

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()

getQfMap

public HashMap<String,QualityFlag> getQfMap()
Returns:
the qfMap

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