Class PointDataSource

All Implemented Interfaces:
Sharable, DataSource, DataSourceFactory, XmlPersistable
Direct Known Subclasses:
AddePointDataSource, CDMProfileDataSource, DbPointDataSource, DbTrajectoryDataSource, NetcdfPointDataSource, TextPointDataSource, WaterMLDataSource

public abstract class PointDataSource extends FilesDataSource
A data source for point data
Version:
$Revision: 1.33 $ $Date: 2007/06/21 14:44:59 $
Author:
Don Murray
  • Field Details

    • PROP_FIRSTGUESS

      public static final String PROP_FIRSTGUESS
      property id for the first guess field
      See Also:
    • PROP_GRID_X

      public static final String PROP_GRID_X
      dataselection property for grid x spacing
      See Also:
    • PROP_GRID_Y

      public static final String PROP_GRID_Y
      dataselection property for grid x spacing
      See Also:
    • PROP_GRID_UNIT

      public static final String PROP_GRID_UNIT
      dataselection property for grid y spacing
      See Also:
    • PROP_GRID_NUMPASSES

      public static final String PROP_GRID_NUMPASSES
      dataselection property for grid passes
      See Also:
    • PROP_GRID_GAIN

      public static final String PROP_GRID_GAIN
      dataselection property for grid gain
      See Also:
    • PROP_GRID_SEARCH_RADIUS

      public static final String PROP_GRID_SEARCH_RADIUS
      dataselection property for grid search radius
      See Also:
    • PROP_GRID_PARAM

      public static final String PROP_GRID_PARAM
      This gets set on the data choice when we are creating a point ob field intended to be used for making a grid
      See Also:
    • PROP_STATIONMODELNAME

      public static final String PROP_STATIONMODELNAME
      station model name property
      See Also:
    • PROP_STATIONMODELSCALE

      public static final String PROP_STATIONMODELSCALE
      See Also:
    • STATION_DATA

      public static final String STATION_DATA
      Identifier for station data
      See Also:
    • POINT_DATA

      public static final String POINT_DATA
      Identifier for point data
      See Also:
    • STATION_PLOT

      public static final String STATION_PLOT
      Identifier for a station plot
      See Also:
    • fieldsDescription

      protected String fieldsDescription
      A cached version of the html description of the fields.
  • Constructor Details

    • PointDataSource

      public PointDataSource() throws VisADException
      Default constructor
      Throws:
      VisADException - problem creating VisAD data object
    • PointDataSource

      public PointDataSource(DataSourceDescriptor descriptor, String source, String description, Hashtable properties) throws VisADException
      Create a PointDataSource
      Parameters:
      descriptor - descriptor for the DataSource
      source - file location or URL
      description - description of data
      properties - extra properties
      Throws:
      VisADException
    • PointDataSource

      public PointDataSource(DataSourceDescriptor descriptor, List sources, String name, Hashtable properties) throws VisADException
      Create a new PointDataSource
      Parameters:
      descriptor - data source descriptor
      sources - List of sources of data (filename/URL)
      name - The name to use
      properties - extra properties for initialization
      Throws:
      VisADException - problem creating the data
  • Method Details

    • init

      protected void init() throws VisADException
      Initialize this object
      Throws:
      VisADException - problem during initialization
    • initDataSelectionComponents

      protected void initDataSelectionComponents(List<DataSelectionComponent> components, DataChoice dataChoice)
      Add the GridParameters for the field selector
      Overrides:
      initDataSelectionComponents in class DataSourceImpl
      Parameters:
      components - comps
      dataChoice - for this data
    • initGridParameters

      protected ucar.unidata.data.point.PointDataSource.GridParameters initGridParameters()
      Allow subclasses to initialize a GridParameters
      Returns:
      a GridParameters instance
    • canAddCurrentName

      public boolean canAddCurrentName(DataChoice dataChoice)
      not sure what this does
      Specified by:
      canAddCurrentName in interface DataSource
      Overrides:
      canAddCurrentName in class DataSourceImpl
      Parameters:
      dataChoice - datachoice
      Returns:
      false
    • getPropertiesComponents

      public void getPropertiesComponents(List comps)
      add to properties
      Overrides:
      getPropertiesComponents in class DataSourceImpl
      Parameters:
      comps - comps
    • addPropertiesTabs

      public void addPropertiesTabs(JTabbedPane tabbedPane)
      Add the Grid Fields component to the properties tab
      Overrides:
      addPropertiesTabs in class DataSourceImpl
      Parameters:
      tabbedPane - properties tab
    • setRoundToFromComboBox

      public void setRoundToFromComboBox(TwoFacedObject tfo)
      Set the property
      Parameters:
      tfo - value from combo box_
    • setWidthFromComboBox

      public void setWidthFromComboBox(TwoFacedObject tfo)
      set the property
      Parameters:
      tfo - value_
    • applyProperties

      public boolean applyProperties()
      apply the properties
      Overrides:
      applyProperties in class DataSourceImpl
      Returns:
      success
    • canCreateGrid

      protected boolean canCreateGrid(RealType type)
      Is it ok to create a grid field for the parameter with the given real type
      Parameters:
      type - the type
      Returns:
      ok to create grid
    • getSample

      protected FieldImpl getSample(DataChoice dataChoice) throws Exception
      Read a sample of the data. e.g., just the first ob
      Parameters:
      dataChoice - The data choice
      Returns:
      The first ob
      Throws:
      Exception - On badness
    • reloadData

      public void reloadData()
      Reload the data
      Specified by:
      reloadData in interface DataSource
      Overrides:
      reloadData in class FilesDataSource
    • doMakeDataChoices

      public void doMakeDataChoices()
      Make the DataChoices for this DataSource.
      Overrides:
      doMakeDataChoices in class DataSourceImpl
    • getSource

      protected String getSource(DataChoice dataChoice)
      Get the file or url source path from the given data choice. The new version uses an Integer index into the sources list as the id of the data choice. However, this method does handle
      Parameters:
      dataChoice - The data choice
      Returns:
      The file or url the data choice refers to
    • getPointCategories

      protected List getPointCategories()
      Get the default categories for data from PointDataSource-s
      Returns:
      list of categories
    • getDataName

      public String getDataName()
      Get the name of this data.
      Returns:
      name of data
    • shouldCache

      protected boolean shouldCache(DataChoice dataChoice, Data data)
      See if this DataSource should cache or not
      Overrides:
      shouldCache in class DataSourceImpl
      Parameters:
      dataChoice - The data choice we got this data from
      data - Data to cache
      Returns:
      true
    • getDataInner

      protected Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties) throws VisADException, RemoteException
      Get the data represented by this class. Calls makeObs, real work needs to be implemented there.
      Overrides:
      getDataInner in class DataSourceImpl
      Parameters:
      dataChoice - choice for data
      category - category of data
      dataSelection - subselection properties
      requestProperties - additional selection properties (not used here)
      Returns:
      Data object representative of the choice
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • makeDerivedDataChoices

      protected void makeDerivedDataChoices(List dataChoices)
      Override this method so we don't make any derived data choices from the grid fields
      Overrides:
      makeDerivedDataChoices in class DataSourceImpl
      Parameters:
      dataChoices - base list of choices
    • getFullDescription

      public String getFullDescription()
      Override the base class method to add on the listing of the param names in the point tuple.
      Specified by:
      getFullDescription in interface DataSource
      Overrides:
      getFullDescription in class FilesDataSource
      Returns:
      full description of this datasource for help
    • getDescriptionDataChoice

      protected DataChoice getDescriptionDataChoice()
      Get the data choice to use for the description
      Returns:
      the data choice
    • makeFieldDescription

      protected void makeFieldDescription(FieldImpl fi)
      Create e field description from the field
      Parameters:
      fi - field to use
    • doRemove

      public void doRemove()
      Gets called by the DataManager when this DataSource has been removed.
      Specified by:
      doRemove in interface DataSource
      Overrides:
      doRemove in class FilesDataSource
    • makeObs

      protected abstract FieldImpl makeObs(DataChoice dataChoice, DataSelection subset, ucar.unidata.geoloc.LatLonRect bbox) throws Exception
      Make the observation data
      Parameters:
      dataChoice - choice describing the data
      subset - subselection (not used)
      bbox - The bounding box
      Returns:
      FieldImpl of PointObs
      Throws:
      Exception - problem (VisAD or IO)
    • getDefaultLevels

      protected List getDefaultLevels()
      Get a list of selected levels. Subclasses should override if they have levels.
      Returns:
      list of levels (may be empty)
    • setSource

      public void setSource(String value)
      Set the source property (filename or URL). Used by persistence
      Overrides:
      setSource in class FilesDataSource
      Parameters:
      value - data source
    • setBinWidth

      public void setBinWidth(double value)
      Set the BinWidth property.
      Parameters:
      value - The new value for BinWidth
    • getBinWidth

      public double getBinWidth()
      Get the BinWidth property.
      Returns:
      The BinWidth
    • setBinRoundTo

      public void setBinRoundTo(double value)
      Set the BinRoundTo property.
      Parameters:
      value - The new value for BinRoundTo
    • getBinRoundTo

      public double getBinRoundTo()
      Get the BinRoundTo property.
      Returns:
      The BinRoundTo
    • setGridX

      public void setGridX(float value)
      Set the GridX property.
      Parameters:
      value - The new value for GridX
    • getGridX

      public float getGridX()
      Get the GridX property.
      Returns:
      The GridX
    • setGridY

      public void setGridY(float value)
      Set the GridY property.
      Parameters:
      value - The new value for GridY
    • getGridY

      public float getGridY()
      Get the GridY property.
      Returns:
      The GridY
    • setGridUnit

      public void setGridUnit(String value)
      Set the GridY property.
      Parameters:
      value - The new value for GridY
    • getGridUnit

      public String getGridUnit()
      Get the GridUnit property.
      Returns:
      The GridUnit property
    • setNumGridPasses

      public void setNumGridPasses(int value)
      Set the NumGridPasses property.
      Parameters:
      value - The new value for NumGridPasses
    • getNumGridPasses

      public int getNumGridPasses()
      Get the NumGridPasses property.
      Returns:
      The NumGridPasses
    • setGridGain

      public void setGridGain(float value)
      Set the grid gain property.
      Parameters:
      value - The new value for gain
    • getGridGain

      public float getGridGain()
      Get the grid gain property.
      Returns:
      The gain
    • setGridSearchRadius

      public void setGridSearchRadius(float value)
      Set the grid search radius
      Parameters:
      value - The new value for search radius
    • getGridSearchRadius

      public float getGridSearchRadius()
      Get the search radius property
      Returns:
      The search radius
    • setMakeGridFields

      public void setMakeGridFields(boolean value)
      Set the MakeGridFields property.
      Parameters:
      value - The new value for MakeGridFields
    • getMakeGridFields

      public boolean getMakeGridFields()
      Get the MakeGridFields property.
      Returns:
      The MakeGridFields
    • canDoAllLevels

      public boolean canDoAllLevels()
      Cannot do all levels!
      Specified by:
      canDoAllLevels in interface DataSource
      Overrides:
      canDoAllLevels in class DataSourceImpl
      Returns:
      false