ucar.unidata.data.sounding
Class TrackDataSource

java.lang.Object
  extended by ucar.unidata.collab.SharableImpl
      extended by ucar.unidata.data.DataSourceImpl
          extended by ucar.unidata.data.FilesDataSource
              extended by ucar.unidata.data.sounding.TrackDataSource
All Implemented Interfaces:
Sharable, DataSource, DataSourceFactory, XmlPersistable
Direct Known Subclasses:
SondeDataSource

public class TrackDataSource
extends FilesDataSource

A data source for balloon and aircraft tracks

Version:
$Revision: 1.90 $ $Date: 2007/08/06 17:02:27 $
Author:
IDV Development Team

Field Summary
static String ID_LASTOB
          Last point track type
static String ID_POINTTRACE
          Point track type
static String ID_SOUNDINGOB
          sounding ob id
static String ID_SOUNDINGTRACE
          sounding trace id
static String ID_TIMETRACE
          time trace id
static String ID_WHOLETRACE
          The whole track
static String PROP_TRACKTYPE
          track type identifier
 
Fields inherited from class ucar.unidata.data.FilesDataSource
adapters, oldSourceFromBundles, 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
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
TrackDataSource()
          Default Constructor
TrackDataSource(DataSourceDescriptor descriptor, List sources, Hashtable properties)
          Create a TrackDataSource from the specification given.
TrackDataSource(DataSourceDescriptor descriptor, String source, Hashtable properties)
          Create a TrackDataSource from the specification given.
 
Method Summary
protected  void addActions(List actions)
          _more_
 void addPropertiesTabs(JTabbedPane tabbedPane)
          Add any extra tabs into the properties tab
protected  FieldImpl aggregateTracks(List tracks)
          Aggregate the list of track data
 boolean applyProperties()
          Apply properties components
protected  boolean canDoView()
          _more_
 boolean canSaveDataToLocalDisk()
          Is this data source capable of saving its data to local disk
protected  TrackAdapter doMakeAdapter(String file, Hashtable pointDataFilter, int stride, int lastNMinutes)
          Factory method to make the adapter
protected  void doMakeDataChoices()
          Make the DataChoices associated with this dataset
protected  List doMakeDateTimes()
          Make the list of times associated with this DataSource for DataSelection.
 void doRemove()
          _more_
protected  List getAdapters()
          Create, if needed, and return the list of adapters.
protected  DateTime getBaseTime()
          Get the base time to be used for the track.
protected  String getChoiceId(DataChoice dc)
          Utility to extract the choice id
protected  String getDataChoiceLabel(Object id)
          Get the label for a particular data choice
protected  Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties)
          Get the VisAD Data object that corresponds to the dataChoice category and dataSelection criteria.
 String getFullDescription()
          Get the full description for this data source.
 boolean getHaveAskedToSubset()
          Get the HaveAskedToSubset property.
 int getLastNMinutes()
          Get the LastNMinutes property.
protected  FieldImpl getLastPointOb(DataChoice dc, DataSelection dataSelection)
          Gets the last point ob associated with this track
protected  DateTime[] getMinMaxTime()
          Get the min and max times in the tracks
 Hashtable getPointDataFilter()
          Get the PointDataFilter property.
protected  FieldImpl getPointObTrack(DataChoice dc, DataSelection dataSelection, ucar.ma2.Range range)
          Gets the point ob track associated with this DataChoice
 void getPropertiesComponents(List comps)
          Add the gui components into the list for the properties dialog
protected  List getRaobCategories()
          Get the default categories RAOB sounding choices
protected  List getSoundingCategories()
          Get the default categories sounding choices
protected  Data getSoundingOb(DataChoice dc, DataSelection dataSelection)
          Gets the SoundingOb associated with this DataChoice
protected  Data getSoundingTrace(DataChoice dc, DataSelection dataSelection)
          Gets the sounding trace associated with this DataChoice
 int getStride()
          Get the Stride property.
protected  List getTraceCategories()
          Get the default categories trace choices
protected  FlatField getTrack(DataChoice dc, DataSelection dataSelection, Hashtable requestProperties)
          Gets the track associated with this DataChoice
protected  String getTrackId(DataChoice dc)
          Utility to get the track id
protected  List getTracks(DataChoice dc, DataSelection dataSelection, Hashtable requestProperties)
          Gets the track associated with this DataChoice
protected  void initAfter()
          _more_
 void initAfterCreation()
          _more_
protected  void initCategories()
          Initialize the categories
protected  void initTrack()
          Initialize the track
static void main(String[] args)
          Get the point observartion data Test routine
 FlatField mergeTracks(List datas)
          Merge a List of FieldImpls of point obs into one.
 void resetLastNMinutesFld()
          Reset last N minutes field
 void resetStrideFld()
          reset stride field
 void setHaveAskedToSubset(boolean value)
          Set the HaveAskedToSubset property.
 void setLastNMinutes(int value)
          Set the LastNMinutes property.
 void setName(String value)
          Set the source property (filename or URL).
 void setPointDataFilter(Hashtable value)
          Set the PointDataFilter property.
 void setStride(int value)
          Set the Stride property.
 void showSqlShell()
          _more_
 
Methods inherited from class ucar.unidata.data.FilesDataSource
equals, getDataFileExtension, getDataPaths, getFilePath, getInputStreams, getLocationsForPolling, getPartialDescription, getSource, getSources, haveSources, initAfterUnpersistence, initWithPollingInfo, isFileBased, newFilesFromPolling, processDataFilename, propertiesChanged, reloadData, saveDataToLocalDisk, setNewFiles, setSource, setSources, sourcesChanged, updateState
 
Methods inherited from class ucar.unidata.data.DataSourceImpl
addDataChangeListener, addDataChoice, applyFieldMask, beginWritingDataToLocalDisk, canCacheDataToDisk, canChangeData, canDoFieldMask, canDoGeoSelection, canDoGeoSelectionMap, canDoGeoSelectionStride, canPoll, canShowParameter, checkForInitAfterUnPersistence, clearCachedData, clearFileCache, clearTimes, convertToFilesIfDirectory, createAutoDisplay, createCacheKey, createElement, decrOutstandingGetDataCalls, doDirectory, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSubsetPropertiesComponent, endWritingDataToLocalDisk, expandIfNeeded, findDataChoice, findDataChoices, flushCache, getAbsoluteDateTimes, getActions, getAlias, getAllDateTimes, getAllDateTimes, getAllLevels, getAllLevels, getCache, getCacheClearDelay, getCacheDataToDisk, getCompositeDataChoices, getData, getData, getDataCachePath, getDataChangeListeners, getDataChoices, getDataContext, getDataInner, getDataIsEditable, getDataPrefix, getDataSelection, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, getDescription, getDescriptor, getErrorMessage, getExtraGeoSelectionComponent, getFileFilterForPolling, getid, getInError, getLocalDirectory, getLocationForPolling, getMostRecentFiles, getName, getNameForDataSource, getNeedToShowErrorToUser, getNextId, getOutstandingGetDataCalls, getPassword, getPathsThatCanBeRelative, getPollingInfo, getProperties, getPropertiesHeader, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRelativePaths, getSampleDataProjection, getSaveDataFileLabel, getSelectedDateTimes, getSelectedDateTimes, getTimesFromDataSelection, getTmpPaths, getTypeName, getUserName, handlePropertiesAction, hasPollingInfo, holdsDateTimes, holdsIndices, identifiedBy, identifiedByName, incrOutstandingGetDataCalls, initDataChoice, initDataSelectionComponents, initFromXml, isPolling, loadFieldMask, loadFieldMask, loadLatestFile, logException, logException, makeDerivedDataChoices, makeSaveLocalActions, newFileFromPolling, notifyDataChange, putCache, removeCache, removeDataChangeListener, removeDataChoice, removeProperty, replaceDataChoice, resetTmpState, saveDataToLocalDisk, saveDataToLocalDisk, setAlias, setAskToUpdate, setCacheClearDelay, setCacheDataToDisk, setDataEditableStrings, setDataIsEditable, setDataIsRelative, setDataRelativeStrings, setDataSelection, setDateTimeSelection, setDescription, setDescriptor, setDirectory, setInError, setInError, setInError, setObjectProperties, setObjectProperty, setPassword, setPollingInfo, setPollLocation, setProperties, setProperty, setProperty, setRelativePaths, setTemplateName, setTmpPaths, setUserName, shouldCache, showPasswordDialog, showPropertiesDialog, showPropertiesDialog, showPropertiesDialog, showWaitDialog, tick, toString, toStringTruncated, updateDetailsText, writeFieldMaskFile, writeFieldMaskFile
 
Methods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, 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

ID_SOUNDINGOB

public static final String ID_SOUNDINGOB
sounding ob id

See Also:
Constant Field Values

ID_SOUNDINGTRACE

public static final String ID_SOUNDINGTRACE
sounding trace id

See Also:
Constant Field Values

ID_TIMETRACE

public static final String ID_TIMETRACE
time trace id

See Also:
Constant Field Values

ID_WHOLETRACE

public static final String ID_WHOLETRACE
The whole track

See Also:
Constant Field Values

ID_POINTTRACE

public static final String ID_POINTTRACE
Point track type

See Also:
Constant Field Values

ID_LASTOB

public static final String ID_LASTOB
Last point track type

See Also:
Constant Field Values

PROP_TRACKTYPE

public static final String PROP_TRACKTYPE
track type identifier

See Also:
Constant Field Values
Constructor Detail

TrackDataSource

public TrackDataSource()
Default Constructor


TrackDataSource

public TrackDataSource(DataSourceDescriptor descriptor,
                       String source,
                       Hashtable properties)
                throws VisADException
Create a TrackDataSource from the specification given.

Parameters:
descriptor - descriptor for the DataSource
source - file location or URL
properties - extra properties
Throws:
VisADException

TrackDataSource

public TrackDataSource(DataSourceDescriptor descriptor,
                       List sources,
                       Hashtable properties)
                throws VisADException
Create a TrackDataSource from the specification given.

Parameters:
descriptor - data source descriptor
sources - List of sources of data (filename/URL)
properties - extra properties for initialization
Throws:
VisADException - problem creating the data
Method Detail

doRemove

public void doRemove()
_more_

Specified by:
doRemove in interface DataSource
Overrides:
doRemove in class FilesDataSource

addActions

protected void addActions(List actions)
_more_

Overrides:
addActions in class DataSourceImpl
Parameters:
actions - _more_

showSqlShell

public void showSqlShell()
_more_


initAfter

protected void initAfter()
_more_

Overrides:
initAfter in class DataSourceImpl

initAfterCreation

public void initAfterCreation()
_more_

Specified by:
initAfterCreation in interface DataSource
Overrides:
initAfterCreation in class FilesDataSource

initCategories

protected void initCategories()
Initialize the categories


canSaveDataToLocalDisk

public boolean canSaveDataToLocalDisk()
Is this data source capable of saving its data to local disk

Specified by:
canSaveDataToLocalDisk in interface DataSource
Overrides:
canSaveDataToLocalDisk in class DataSourceImpl
Returns:
Can save to local disk

getFullDescription

public String getFullDescription()
Get the full description for this data source. Subclasses should override if they want something other than the default. This is what gets displayed in the details.

Specified by:
getFullDescription in interface DataSource
Overrides:
getFullDescription in class FilesDataSource
Returns:
the full description of this data source (description + name)

getTraceCategories

protected List getTraceCategories()
Get the default categories trace choices

Returns:
list of categories

getSoundingCategories

protected List getSoundingCategories()
Get the default categories sounding choices

Returns:
list of categories

getRaobCategories

protected List getRaobCategories()
Get the default categories RAOB sounding choices

Returns:
list of categories

initTrack

protected void initTrack()
Initialize the track


doMakeAdapter

protected TrackAdapter doMakeAdapter(String file,
                                     Hashtable pointDataFilter,
                                     int stride,
                                     int lastNMinutes)
                              throws Exception
Factory method to make the adapter

Parameters:
file - file or url
pointDataFilter - When creating point data this holds the map of variables to use
stride - string
lastNMinutes - clipping
Returns:
The adapter
Throws:
Exception - On badness

getAdapters

protected List getAdapters()
Create, if needed, and return the list of adapters. Will return null if there are no valid adapters.

Returns:
List of adapters or null

doMakeDataChoices

protected void doMakeDataChoices()
Make the DataChoices associated with this dataset

Overrides:
doMakeDataChoices in class DataSourceImpl

canDoView

protected boolean canDoView()
_more_

Returns:
_more_

getDataChoiceLabel

protected String getDataChoiceLabel(Object id)
Get the label for a particular data choice

Parameters:
id - id for the choice
Returns:
the appropriate label

getDataInner

protected Data getDataInner(DataChoice dataChoice,
                            DataCategory category,
                            DataSelection dataSelection,
                            Hashtable requestProperties)
                     throws VisADException,
                            RemoteException
Get the VisAD Data object that corresponds to the dataChoice category and dataSelection criteria.

Overrides:
getDataInner in class DataSourceImpl
Parameters:
dataChoice - choice for data
category - specific category of data (not used currently)
dataSelection - additional selection criteria
requestProperties - extra request properties
Returns:
corresponding Data object
Throws:
VisADException - unable to create Data object
RemoteException - (some kind of remote error.

getBaseTime

protected DateTime getBaseTime()
Get the base time to be used for the track. This is the largest of the end times

Returns:
Base time.

getMinMaxTime

protected DateTime[] getMinMaxTime()
Get the min and max times in the tracks

Returns:
man/max times of the tracks

aggregateTracks

protected FieldImpl aggregateTracks(List tracks)
                             throws VisADException,
                                    RemoteException
Aggregate the list of track data

Parameters:
tracks - list of track data
Returns:
Aggregation
Throws:
RemoteException - On badness
VisADException - On badness

doMakeDateTimes

protected List doMakeDateTimes()
Make the list of times associated with this DataSource for DataSelection.

Overrides:
doMakeDateTimes in class DataSourceImpl
Returns:
DateTimes as a list.

getTracks

protected List getTracks(DataChoice dc,
                         DataSelection dataSelection,
                         Hashtable requestProperties)
                  throws VisADException,
                         RemoteException
Gets the track associated with this DataChoice

Parameters:
dc - DataChoice for selection
dataSelection - sub selection criteria
requestProperties - selection properties
Returns:
associated track
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

getTrack

protected FlatField getTrack(DataChoice dc,
                             DataSelection dataSelection,
                             Hashtable requestProperties)
                      throws VisADException,
                             RemoteException
Gets the track associated with this DataChoice

Parameters:
dc - DataChoice for selection
dataSelection - sub selection criteria
requestProperties - selection properties
Returns:
associated track
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

getLastPointOb

protected FieldImpl getLastPointOb(DataChoice dc,
                                   DataSelection dataSelection)
                            throws Exception
Gets the last point ob associated with this track

Parameters:
dc - DataChoice for selection
dataSelection - sub selection criteria
Returns:
associated track
Throws:
Exception - On badness

getPointObTrack

protected FieldImpl getPointObTrack(DataChoice dc,
                                    DataSelection dataSelection,
                                    ucar.ma2.Range range)
                             throws VisADException,
                                    RemoteException
Gets the point ob track associated with this DataChoice

Parameters:
dc - DataChoice for selection
dataSelection - sub selection criteria
range - The data range
Returns:
associated track
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

getSoundingTrace

protected Data getSoundingTrace(DataChoice dc,
                                DataSelection dataSelection)
                         throws Exception
Gets the sounding trace associated with this DataChoice

Parameters:
dc - DataChoice for selection
dataSelection - sub selection criteria
Returns:
associated track
Throws:
Exception - On badness

getChoiceId

protected String getChoiceId(DataChoice dc)
Utility to extract the choice id

Parameters:
dc - the data choice
Returns:
The id. eg: parameter name

getTrackId

protected String getTrackId(DataChoice dc)
Utility to get the track id

Parameters:
dc - data choice
Returns:
track id

getSoundingOb

protected Data getSoundingOb(DataChoice dc,
                             DataSelection dataSelection)
                      throws VisADException,
                             RemoteException
Gets the SoundingOb associated with this DataChoice

Parameters:
dc - DataChoice for selection
dataSelection - sub selection criteria
Returns:
SoundingOb
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

setName

public void setName(String value)
Set the source property (filename or URL). Used by persistence

Overrides:
setName in class DataSourceImpl
Parameters:
value - data source

main

public static void main(String[] args)
                 throws Exception
Get the point observartion data Test routine

Parameters:
args - filename
Throws:
Exception - problem

mergeTracks

public FlatField mergeTracks(List datas)
                      throws VisADException
Merge a List of FieldImpls of point obs into one.

Parameters:
datas - List of FieldImpls of point obs
Returns:
merged FieldImpl
Throws:
VisADException - problem getting the data

setPointDataFilter

public void setPointDataFilter(Hashtable value)
Set the PointDataFilter property.

Parameters:
value - The new value for PointDataFilter

getPointDataFilter

public Hashtable getPointDataFilter()
Get the PointDataFilter property.

Returns:
The PointDataFilter

getPropertiesComponents

public void getPropertiesComponents(List comps)
Add the gui components into the list for the properties dialog

Overrides:
getPropertiesComponents in class DataSourceImpl
Parameters:
comps - List of components

resetLastNMinutesFld

public void resetLastNMinutesFld()
Reset last N minutes field


resetStrideFld

public void resetStrideFld()
reset stride field


applyProperties

public boolean applyProperties()
Apply properties components

Overrides:
applyProperties in class DataSourceImpl
Returns:
false if something failed and we need to keep showing the dialog

addPropertiesTabs

public void addPropertiesTabs(JTabbedPane tabbedPane)
Add any extra tabs into the properties tab

Overrides:
addPropertiesTabs in class DataSourceImpl
Parameters:
tabbedPane - The properties tab

setStride

public void setStride(int value)
Set the Stride property.

Parameters:
value - The new value for Stride

getStride

public int getStride()
Get the Stride property.

Returns:
The Stride

setHaveAskedToSubset

public void setHaveAskedToSubset(boolean value)
Set the HaveAskedToSubset property.

Parameters:
value - The new value for HaveAskedToSubset

getHaveAskedToSubset

public boolean getHaveAskedToSubset()
Get the HaveAskedToSubset property.

Returns:
The HaveAskedToSubset

setLastNMinutes

public void setLastNMinutes(int value)
Set the LastNMinutes property.

Parameters:
value - The new value for LastNMinutes

getLastNMinutes

public int getLastNMinutes()
Get the LastNMinutes property.

Returns:
The LastNMinutes