Exemplo n.º 1
0
class PVGeoDelimitedTextReader(DelimitedTextReader):
    def __init__(self):
        DelimitedTextReader.__init__(self)

    #### Seters and Geters ####
    @smproperty.xml(
        _helpers.get_file_reader_xml(
            DelimitedTextReader.extensions,
            reader_description=DelimitedTextReader.description,
        )
    )
    def AddFileName(self, filename):
        DelimitedTextReader.AddFileName(self, filename)

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

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

    @smproperty.stringvector(name="Delimiter", default_values=" ")
    def set_delimiter(self, deli):
        DelimitedTextReader.set_delimiter(self, deli)

    @smproperty.xml(
        _helpers.get_property_xml(
            name='Use Split on Whitespace',
            command='set_split_on_white_space',
            default_values=False,
            help='A boolean to override the Delimiter_Field and use whitespace as delimiter.',
        )
    )
    def set_split_on_white_space(self, flag):
        DelimitedTextReader.set_split_on_white_space(self, flag)

    @smproperty.intvector(name="SkipRows", default_values=0)
    def set_skip_rows(self, skip):
        DelimitedTextReader.set_skip_rows(self, skip)

    @smproperty.stringvector(name="Comments", default_values="!")
    def set_comments(self, identifier):
        DelimitedTextReader.set_comments(self, identifier)

    @smproperty.xml(
        _helpers.get_property_xml(
            name='Has Titles',
            command='set_has_titles',
            default_values=False,
            help='A boolean for if the delimited file has header titles for the data arrays.',
        )
    )
    def set_has_titles(self, flag):
        DelimitedTextReader.set_has_titles(self, flag)
Exemplo n.º 2
0
class PVGeoEsriGridReader(EsriGridReader):
    def __init__(self):
        EsriGridReader.__init__(self)

    #### Seters and Geters ####

    @smproperty.xml(
        _helpers.get_file_reader_xml(
            EsriGridReader.extensions,
            reader_description=EsriGridReader.description))
    def AddFileName(self, filename):
        EsriGridReader.AddFileName(self, filename)

    @smproperty.stringvector(name='DataName', default_values='Data')
    def set_data_name(self, data_name):
        EsriGridReader.set_data_name(self, data_name)

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

    @smproperty.doublevector(name="TimestepValues",
                             information_only="1",
                             si_class="vtkSITimeStepsProperty")
    def get_time_step_values(self):
        """This is critical for registering the timesteps"""
        return EsriGridReader.get_time_step_values(self)
Exemplo n.º 3
0
class PVGeoLandsatReader(LandsatReader):
    def __init__(self):
        LandsatReader.__init__(self)

    #### Seters and Geters ####

    @smproperty.xml(_helpers.get_file_reader_xml(LandsatReader.extensions, reader_description=LandsatReader.description))
    def AddFileName(self, filename):
        LandsatReader.AddFileName(self, filename)

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


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


    @smproperty.xml(_helpers.get_drop_down_xml(name='Color Scheme', command='set_color_scheme', labels=LandsatReader.GetColorSchemeNames(), help='Set a color scheme to use.'))
    def set_color_scheme(self, scheme):
        LandsatReader.set_color_scheme(self, scheme)
Exemplo n.º 4
0
class PVGeoGSLibPointSetReader(GSLibPointSetReader):
    def __init__(self):
        GSLibPointSetReader.__init__(self)

    #### Seters and Geters ####

    @smproperty.xml(
        _helpers.get_file_reader_xml(
            GSLibPointSetReader.extensions,
            reader_description=GSLibPointSetReader.description,
        )
    )
    def AddFileName(self, filename):
        GSLibPointSetReader.AddFileName(self, filename)

    @smproperty.stringvector(name="Delimiter", default_values=" ")
    def set_delimiter(self, deli):
        GSLibPointSetReader.set_delimiter(self, deli)

    @smproperty.xml(
        _helpers.get_property_xml(
            name='Use Split on Whitespace',
            command='set_split_on_white_space',
            default_values=True,
            help='A boolean to override the Delimiter_Field and use whitespace as delimiter.',
        )
    )
    def set_split_on_white_space(self, flag):
        GSLibPointSetReader.set_split_on_white_space(self, flag)

    @smproperty.intvector(name="SkipRows", default_values=0)
    def set_skip_rows(self, skip):
        GSLibPointSetReader.set_skip_rows(self, skip)

    @smproperty.stringvector(name="Comments", default_values="!")
    def set_comments(self, identifier):
        GSLibPointSetReader.set_comments(self, identifier)

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

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

    @smproperty.xml(
        """<Property name="Print File Header" command="print_file_header" panel_widget="command_button"/>"""
    )
    def print_file_header(self):
        print(GSLibPointSetReader.get_file_header(self))
        return 1
Exemplo n.º 5
0
class PVGeoMadagascarReader(MadagascarReader):
    def __init__(self):
        MadagascarReader.__init__(self)

    #### Seters and Geters ####

    @smproperty.xml(
        _helpers.get_file_reader_xml(
            MadagascarReader.extensions, reader_description=MadagascarReader.description
        )
    )
    def AddFileName(self, filename):
        MadagascarReader.AddFileName(self, filename)

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

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

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

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

    @smproperty.stringvector(name='DataName', default_values='Data')
    def set_data_name(self, data_name):
        MadagascarReader.set_data_name(self, data_name)
Exemplo n.º 6
0
class PVGeoSGeMSGridReader(SGeMSGridReader):
    def __init__(self):
        SGeMSGridReader.__init__(self)


    #### Seters and Geters ####
    @smproperty.xml(_helpers.get_file_reader_xml(SGeMSGridReader.extensions, reader_description=SGeMSGridReader.description))
    def AddFileName(self, filename):
        SGeMSGridReader.AddFileName(self, filename)

    @smproperty.stringvector(name="Delimiter", default_values=" ")
    def set_delimiter(self, deli):
        SGeMSGridReader.set_delimiter(self, deli)

    @smproperty.xml(_helpers.get_property_xml(name='Use Split on Whitespace', command='set_split_on_white_space', default_values=True, help='A boolean to override the Delimiter_Field and use whitespace as delimiter.'))
    def set_split_on_white_space(self, flag):
        SGeMSGridReader.set_split_on_white_space(self, flag)

    @smproperty.intvector(name="SkipRows", default_values=0)
    def set_skip_rows(self, skip):
        SGeMSGridReader.set_skip_rows(self, skip)

    @smproperty.stringvector(name="Comments", default_values="!")
    def set_comments(self, identifier):
        SGeMSGridReader.set_comments(self, identifier)

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

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

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

    @smproperty.doublevector(name="Origin", default_values=[0.0, 0.0, 0.0],)
    def set_origin(self, ox, oy, oz):
        SGeMSGridReader.set_origin(self, ox, oy, oz)
Exemplo n.º 7
0
class PVGeoOMFReader(OMFReader):
    def __init__(self):
        OMFReader.__init__(self)

    #### Seters and Geters ####

    # TODO: check this to make sure not time varying
    @smproperty.xml(
        _helpers.get_file_reader_xml(OMFReader.extensions,
                                     reader_description=OMFReader.description))
    def AddFileName(self, filename):
        OMFReader.AddFileName(self, filename)

    # Array selection API is typical with readers in VTK
    # This is intended to allow ability for users to choose which arrays to
    # load. To expose that in ParaView, simply use the
    # smproperty.dataarrayselection().
    # This method **must** return a `vtkDataArraySelection` instance.
    @smproperty.dataarrayselection(name="Project Data")
    def GetDataSelection(self):
        return OMFReader.GetDataSelection(self)
Exemplo n.º 8
0
class PVGeoMagObsReader(MagObsReader):
    def __init__(self):
        MagObsReader.__init__(self)

    #### Seters and Geters ####
    @smproperty.xml(
        _helpers.get_file_reader_xml(
            MagObsReader.extensions, reader_description=MagObsReader.description
        )
    )
    def AddFileName(self, filename):
        MagObsReader.AddFileName(self, filename)

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

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

    @smproperty.intvector(
        name="SkipRows", default_values=0, panel_visibility="advanced"
    )
    def set_skip_rows(self, skip):
        MagObsReader.set_skip_rows(self, skip)

    @smproperty.stringvector(
        name="Comments", default_values="!", panel_visibility="advanced"
    )
    def set_comments(self, identifier):
        MagObsReader.set_comments(self, identifier)