Esempio n. 1
0
class PVGeoSliceThroughTime(SliceThroughTime):
    def __init__(self):
        SliceThroughTime.__init__(self)

    @smproperty.intvector(name="Number of Slices", default_values=10)
    @smdomain.intrange(min=2, max=50)
    def SetNumberOfSlices(self, num):
        SliceThroughTime.SetNumberOfSlices(self, num)

    @smproperty.doublevector(name="TimeDelta",
                             default_values=1.0,
                             panel_visibility="advanced")
    def SetTimeDelta(self, dt):
        SliceThroughTime.SetTimeDelta(self, dt)

    @smproperty.xml(
        _helpers.getDropDownXml(name='Axis',
                                command='SetAxis',
                                labels=['X Axis', 'Y Axis', 'Z Axis'],
                                values=[0, 1, 2]))
    def SetAxis(self, axis):
        SliceThroughTime.SetAxis(self, axis)

    @smproperty.doublevector(name="TimestepValues",
                             information_only="1",
                             si_class="vtkSITimeStepsProperty")
    def GetTimestepValues(self):
        """This is critical for registering the timesteps"""
        return SliceThroughTime.GetTimestepValues(self)
Esempio n. 2
0
class PVGeoLandsatReader(LandsatReader):
    def __init__(self):
        LandsatReader.__init__(self)

    #### Seters and Geters ####

    @smproperty.xml(
        _helpers.getFileReaderXml(LandsatReader.extensions,
                                  readerDescription=LandsatReader.description))
    def AddFileName(self, fname):
        LandsatReader.AddFileName(self, fname)

    @smproperty.dataarrayselection(name="Available Bands")
    def GetDataSelection(self):
        return LandsatReader.GetDataSelection(self)

    @smproperty.xml(
        _helpers.getPropertyXml(
            name='Cast Data Type',
            command='CastDataType',
            default_values=True,
            help=
            'A boolean to set whether to cast the data arrays so invalid points are filled nans.',
            panel_visibility='advanced'))
    def CastDataType(self, flag):
        LandsatReader.CastDataType(self, flag)

    @smproperty.xml(
        _helpers.getDropDownXml(name='Color Scheme',
                                command='SetColorScheme',
                                labels=LandsatReader.GetColorSchemeNames(),
                                help='Set a color scheme to use.'))
    def SetColorScheme(self, scheme):
        LandsatReader.SetColorScheme(self, scheme)
Esempio n. 3
0
class PVGeoArrayMath(ArrayMath):
    def __init__(self):
        ArrayMath.__init__(self)

    #### SETTERS AND GETTERS ####

    @smproperty.xml(_helpers.getInputArrayXml(nInputPorts=1, numArrays=2))
    def SetInputArrayToProcess(self, idx, port, connection, field, name):
        return ArrayMath.SetInputArrayToProcess(self, idx, port, connection,
                                                field, name)

    @smproperty.doublevector(name="Multiplier", default_values=1.0)
    def SetMultiplier(self, val):
        ArrayMath.SetMultiplier(self, val)

    @smproperty.stringvector(name="New Array Name", default_values="Mathed Up")
    def SetNewArrayName(self, name):
        ArrayMath.SetNewArrayName(self, name)

    @smproperty.xml(
        _helpers.getDropDownXml(
            name='Operation',
            command='SetOperation',
            labels=ArrayMath.GetOperationNames(),
            help='This is the type of operation to apply to the input arrays.')
    )
    def SetOperation(self, op):
        ArrayMath.SetOperation(self, op)
Esempio n. 4
0
class PVGeoAddCellConnToPoints(AddCellConnToPoints):
    def __init__(self):
        AddCellConnToPoints.__init__(self)

    #### Seters and Geters ####

    @smproperty.xml(
        _helpers.getDropDownXml(name='CellType',
                                command='SetCellType',
                                labels=['Line', 'Poly Line'],
                                values=[3, 4]))
    def SetCellType(self, cellType):
        AddCellConnToPoints.SetCellType(self, cellType)

    @smproperty.xml(
        _helpers.getPropertyXml(
            name='Use Neareast Nbr Approx',
            command='SetUseNearestNbr',
            default_values=False,
            help=
            'A boolean to control whether or not to use SciPy nearest neighbor approximation when build cell connectivity.'
        ))
    def SetUseNearestNbr(self, flag):
        AddCellConnToPoints.SetUseNearestNbr(self, flag)

    @smproperty.xml(
        _helpers.getPropertyXml(
            name='Use Unique Points',
            command='SetUseUniquePoints',
            default_values=False,
            help='Set a flag on whether to only use unique points'))
    def SetUseUniquePoints(self, flag):
        AddCellConnToPoints.SetUseUniquePoints(self, flag)
Esempio n. 5
0
class PVGeoReshapeTable(ReshapeTable):
    def __init__(self):
        ReshapeTable.__init__(self)

    #### Seters and Geters ####

    @smproperty.stringvector(name="Names", default_values='Field 0')
    def SetNames(self, names):
        """Set names using a semicolon (;) seperated list"""
        # parse the names (a semicolon seperated list of names)
        ReshapeTable.SetNames(self, names)

    @smproperty.intvector(name="Number of Columns", default_values=6)
    def SetNumberOfColumns(self, ncols):
        ReshapeTable.SetNumberOfColumns(self, ncols)

    @smproperty.intvector(name="Number of Rows", default_values=126)
    def SetNumberOfRows(self, nrows):
        ReshapeTable.SetNumberOfRows(self, nrows)

    @smproperty.xml(
        _helpers.getDropDownXml(name='Order',
                                command='SetOrder',
                                labels=[
                                    'Fortran-style: column-major order',
                                    'C-style: Row-major order'
                                ],
                                values=[0, 1]))
    def SetOrder(self, order):
        o = ['F', 'C']
        ReshapeTable.SetOrder(self, o[order])
Esempio n. 6
0
class PVGeoExtractTopography(ExtractTopography):
    def __init__(self):
        ExtractTopography.__init__(self)

    #### Seters and Geters ####

    @smproperty.doublevector(name="Tolerance", default_values=1.0)
    def SetTolerance(self, tol):
        ExtractTopography.SetTolerance(self, tol)

    @smproperty.doublevector(name="Offset", default_values=0.0)
    def SetOffset(self, offset):
        ExtractTopography.SetOffset(self, offset)

    @smproperty.xml(
        _helpers.getDropDownXml(
            name='Operation',
            command='SetOperation',
            labels=ExtractTopography.GetOperationNames(),
            help='This is the type of extraction operation to apply'))
    def SetOperation(self, op):
        ExtractTopography.SetOperation(self, op)

    @smproperty.xml(
        _helpers.getPropertyXml(
            name='Invert',
            command='SetInvert',
            default_values=False,
            help='A boolean to set whether on whether to invert the extraction.'
        ))
    def SetInvert(self, flag):
        ExtractTopography.SetInvert(self, flag)
Esempio n. 7
0
class PVGeoTableToTimeGrid(TableToTimeGrid):
    def __init__(self):
        TableToTimeGrid.__init__(self)

    #### Setters / Getters ####

    @smproperty.intvector(name="Extent", default_values=[10, 10, 10, 1])
    def SetExtent(self, nx, ny, nz, nt):
        TableToTimeGrid.SetExtent(self, nx, ny, nz, nt)

    @smproperty.intvector(name="Dimensions", default_values=[0, 1, 2, 3])
    def SetDimensions(self, x, y, z, t):
        TableToTimeGrid.SetDimensions(self, x, y, z, t)

    @smproperty.doublevector(name="Spacing", default_values=[1.0, 1.0, 1.0])
    def SetSpacing(self, dx, dy, dz):
        TableToTimeGrid.SetSpacing(self, dx, dy, dz)

    @smproperty.doublevector(name="Origin", default_values=[0.0, 0.0, 0.0])
    def SetOrigin(self, x0, y0, z0):
        TableToTimeGrid.SetOrigin(self, x0, y0, z0)

    @smproperty.xml(
        _helpers.getDropDownXml(name='Order',
                                command='SetOrder',
                                labels=[
                                    'C-style: Row-major order',
                                    'Fortran-style: column-major order'
                                ],
                                values=[0, 1]))
    def SetOrder(self, order):
        o = ['C', 'F']
        TableToTimeGrid.SetOrder(self, o[order])

    @smproperty.doublevector(name="TimeDelta",
                             default_values=1.0,
                             panel_visibility="advanced")
    def SetTimeDelta(self, dt):
        TableToTimeGrid.SetTimeDelta(self, dt)

    @smproperty.doublevector(name="TimestepValues",
                             information_only="1",
                             si_class="vtkSITimeStepsProperty")
    def GetTimestepValues(self):
        """This is critical for registering the timesteps"""
        return TableToTimeGrid.GetTimestepValues(self)

    @smproperty.xml(
        _helpers.getPropertyXml(
            name='Use Point Data',
            command='SetUsePoints',
            default_values=False,
            panel_visibility='advanced',
            help=
            'Set whether or not to place the data on the nodes/cells of the grid. In ParaView, switching can be a bit buggy: be sure to turn the visibility of this data object OFF on the pipeline when changing bewteen nodes/cells.'
        ))
    def SetUsePoints(self, flag):
        TableToTimeGrid.SetUsePoints(self, flag)
Esempio n. 8
0
class PVGeoMadagascarReader(MadagascarReader):
    def __init__(self):
        MadagascarReader.__init__(self)

    #### Seters and Geters ####

    @smproperty.xml(
        _helpers.getFileReaderXml(
            MadagascarReader.extensions,
            readerDescription=MadagascarReader.description))
    def AddFileName(self, fname):
        MadagascarReader.AddFileName(self, fname)

    @smproperty.doublevector(name="TimeDelta",
                             default_values=1.0,
                             panel_visibility="advanced")
    def SetTimeDelta(self, dt):
        MadagascarReader.SetTimeDelta(self, dt)

    @smproperty.doublevector(name="TimestepValues",
                             information_only="1",
                             si_class="vtkSITimeStepsProperty")
    def GetTimestepValues(self):
        """This is critical for registering the timesteps"""
        return MadagascarReader.GetTimestepValues(self)

    @smproperty.xml(
        _helpers.getDropDownXml('Endian',
                                'SetEndian',
                                ['Native', 'Little-Endian', 'Big-Endian'],
                                help='This is the type memory endianness.'))
    def SetEndian(self, endian):
        MadagascarReader.SetEndian(self, endian)

    @smproperty.xml(
        _helpers.getDropDownXml('DataType',
                                'SetDataType',
                                ['Float64', 'Float32', 'Integer4'],
                                help='This is data type to read.'))
    def SetDataType(self, dtype):
        MadagascarReader.SetDataType(self, dtype)

    @smproperty.stringvector(name='DataName', default_values='Data')
    def SetDataName(self, dataName):
        MadagascarReader.SetDataName(self, dataName)
Esempio n. 9
0
class PVGeoPointsToTube(PointsToTube):
    def __init__(self):
        PointsToTube.__init__(self)

    #### Seters and Geters ####

    # NOTE: Not givign the use the choice of cell type for this...
    # It is still accesible to change though...

    @smproperty.doublevector(name="Radius", default_values=10.0)
    def SetRadius(self, radius):
        PointsToTube.SetRadius(self, radius)

    @smproperty.intvector(name="Number of Sides", default_values=20)
    def SetNumberOfSides(self, num):
        PointsToTube.SetNumberOfSides(self, num)

    @smproperty.xml(
        _helpers.getPropertyXml(
            name='Use Nearest Neighbor',
            command='SetUseNearestNbr',
            default_values=False,
            help=
            'A boolean to set whether to use a nearest neighbor approxiamtion when building path from input points.'
        ))
    def SetUseNearestNbr(self, flag):
        PointsToTube.SetUseNearestNbr(self, flag)

    @smproperty.xml(
        _helpers.getPropertyXml(
            name='Capping',
            command='SetCapping',
            default_values=False,
            help='A boolean to set whether to cap the ends of the tube.'))
    def SetCapping(self, flag):
        PointsToTube.SetCapping(self, flag)

    @smproperty.xml(
        _helpers.getDropDownXml(name='CellType',
                                command='SetCellType',
                                labels=['Line', 'Poly Line'],
                                values=[3, 4]))
    def SetCellType(self, cellType):
        PointsToTube.SetCellType(self, cellType)

    @smproperty.xml(
        _helpers.getPropertyXml(
            name='Use Unique Points',
            command='SetUseUniquePoints',
            default_values=False,
            help='Set a flag on whether to only use unique points'))
    def SetUseUniquePoints(self, flag):
        PointsToTube.SetUseUniquePoints(self, flag)
Esempio n. 10
0
class PVGeoConvertUnits(ConvertUnits):
    def __init__(self):
        ConvertUnits.__init__(self)

    #### SETTERS AND GETTERS ####

    @smproperty.xml(
        _helpers.getDropDownXml(name='Conversion',
                                command='SetConversion',
                                labels=ConvertUnits.LookupConversions(True),
                                help='This will set the spatial conversion.'))
    def SetConversion(self, key):
        ConvertUnits.SetConversion(self, key)
Esempio n. 11
0
    class PVGeoLonLatToUTM(LonLatToUTM):
        def __init__(self):
            LonLatToUTM.__init__(self)

        @smproperty.intvector(name="Zone", default_values=11)
        @smdomain.intrange(min=1, max=60)
        def SetZone(self, zone):
            LonLatToUTM.SetZone(self, zone)

        @smproperty.xml(
            _helpers.getDropDownXml(name='Ellps',
                                    command='SetEllps',
                                    labels=LonLatToUTM.GetAvailableEllps(),
                                    help='This will set the ellps.'))
        def SetEllps(self, ellps):
            LonLatToUTM.SetEllps(self, ellps)
Esempio n. 12
0
class PVGeoManySlicesAlongAxis(ManySlicesAlongAxis):
    def __init__(self):
        ManySlicesAlongAxis.__init__(self)

    @smproperty.intvector(name="Number of Slices", default_values=5)
    @smdomain.intrange(min=2, max=25)
    def SetNumberOfSlices(self, num):
        ManySlicesAlongAxis.SetNumberOfSlices(self, num)

    @smproperty.xml(
        _helpers.getDropDownXml(name='Axis',
                                command='SetAxis',
                                labels=['X Axis', 'Y Axis', 'Z Axis'],
                                values=[0, 1, 2]))
    def SetAxis(self, axis):
        ManySlicesAlongAxis.SetAxis(self, axis)
Esempio n. 13
0
class PVGeoTableToGrid(TableToGrid):
    def __init__(self):
        TableToGrid.__init__(self)

    #### Setters / Getters ####

    @smproperty.intvector(name="Extent", default_values=[10, 10, 10])
    def SetExtent(self, nx, ny, nz):
        TableToGrid.SetExtent(self, nx, ny, nz)

    @smproperty.doublevector(name="Spacing", default_values=[1.0, 1.0, 1.0])
    def SetSpacing(self, dx, dy, dz):
        TableToGrid.SetSpacing(self, dx, dy, dz)

    @smproperty.doublevector(name="Origin", default_values=[0.0, 0.0, 0.0])
    def SetOrigin(self, x0, y0, z0):
        TableToGrid.SetOrigin(self, x0, y0, z0)

    @smproperty.xml(
        _helpers.getPropertyXml(
            name='SEPlib',
            command='SetSEPlib',
            default_values=False,
            help=
            'Use the Stanford Exploration Project\'s axial conventions (d1=z, d2=x, d3=y). Parameters would be entered [z,x,y].'
        ))
    def SetSEPlib(self, flag):
        TableToGrid.SetSEPlib(self, flag)

    @smproperty.xml(
        _helpers.getDropDownXml(name='Order',
                                command='SetOrder',
                                labels=[
                                    'Fortran-style: column-major order',
                                    'C-style: Row-major order'
                                ],
                                values=[0, 1]))
    def SetOrder(self, order):
        o = ['F', 'C']
        TableToGrid.SetOrder(self, o[order])

    @smproperty.xml(
        _helpers.getPropertyXml(name='Swap XY',
                                command='SetSwapXY',
                                default_values=False))
    def SetSwapXY(self, flag):
        TableToGrid.SetSwapXY(self, flag)
Esempio n. 14
0
class PVGeoTranslateGridOrigin(TranslateGridOrigin):
    def __init__(self):
        TranslateGridOrigin.__init__(self)

    #### Seters and Geters ####

    @smproperty.xml(
        _helpers.getDropDownXml(name='Corner',
                                command='SetCorner',
                                labels=[
                                    'South East Bottom', 'North West Bottom',
                                    'North East Bottom', 'South West Top',
                                    'South East Top', 'North West Top',
                                    'North East Top'
                                ],
                                values=[1, 2, 3, 4, 5, 6, 7]))
    def SetCorner(self, corner):
        TranslateGridOrigin.SetCorner(self, corner)
Esempio n. 15
0
class PVGeoNormalizeArray(NormalizeArray):
    def __init__(self):
        NormalizeArray.__init__(self)

    #### SETTERS AND GETTERS ####

    @smproperty.xml(_helpers.getInputArrayXml(nInputPorts=1, numArrays=1))
    def SetInputArrayToProcess(self, idx, port, connection, field, name):
        return NormalizeArray.SetInputArrayToProcess(self, idx, port,
                                                     connection, field, name)

    @smproperty.doublevector(name="Multiplier", default_values=1.0)
    def SetMultiplier(self, val):
        NormalizeArray.SetMultiplier(self, val)

    @smproperty.stringvector(name="New Array Name",
                             default_values="Normalized")
    def SetNewArrayName(self, name):
        NormalizeArray.SetNewArrayName(self, name)

    @smproperty.xml(
        _helpers.getDropDownXml(
            name='Normalization',
            command='SetNormalization',
            labels=NormalizeArray.GetNormalizationNames(),
            help=
            'This is the type of normalization to apply to the input array.'))
    def SetNormalization(self, norm):
        NormalizeArray.SetNormalization(self, norm)

    @smproperty.xml(
        _helpers.getPropertyXml(
            name='Absolute Value',
            command='SetTakeAbsoluteValue',
            default_values=False,
            help=
            'This will take the absolute value of the array before normalization.'
        ))
    def SetTakeAbsoluteValue(self, flag):
        NormalizeArray.SetTakeAbsoluteValue(self, flag)

    @smproperty.doublevector(name="Shifter", default_values=0.0)
    def SetShift(self, sft):
        NormalizeArray.SetShift(self, sft)