File I/Oο
This module contains general grid readers and writers for programs like Surfer.
Esri Grid Readerο
- class PVGeo.grids.fileio.EsriGridReader(outputType='vtkImageData', **kwargs)[source]ο
Bases:
DelimitedTextReader
See details: https://en.wikipedia.org/wiki/Esri_grid
- RequestData(request, inInfo, outInfo)[source]ο
Used by pipeline to get data for current timestep and populate the output data object.
- _file_contents_to_data_frame(contents)[source]ο
Creates a dataframe with a single array for the file data.
- _get_raw_data(idx=0)[source]ο
This will return the proper data for the given timestep. This method handles Surferβs NaN data values and checks the value range
- description = 'PVGeo: Esri Grid'ο
- extensions = 'asc dem txt'ο
Landsat XML Readerο
- class PVGeo.grids.fileio.LandsatReader(**kwargs)[source]ο
Bases:
ReaderBaseBase
A reader that will handle ESPA XML files for Landsat Imagery. This reader uses the
espatools
package to read Landsat rasters (band sets) and creates vtkImageData with each band as point data- Modified(read_again=False)[source]ο
Ensure default is overridden to be false so array selector can call.
- description = 'PVGeo: Landsat ESPA XML Metadata'ο
- extensions = 'xml'ο
- get_file_name()[source]ο
Super class has file names as a list but we will only handle a single project file. This provides a conveinant way of making sure we only access that single file. A user could still access the list of file names using
get_file_names()
.
Surfer Grid Readerο
- class PVGeo.grids.fileio.SurferGridReader(outputType='vtkImageData', **kwargs)[source]ο
Bases:
ReaderBase
Read 2D ASCII/Binary Surfer grid files. The IO code was adopted from Seequentβs steno3d_surfer
Note
MIT License
Copyright (c) 2018 Seequent
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the βSoftwareβ), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED βAS ISβ, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- RequestData(request, inInfo, outInfo)[source]ο
Used by pipeline to get data for current timestep and populate the output data object.
- _read_grids(idx=None)[source]ο
This parses the first file to determine grid file type then reads all files set.
- description = 'PVGeo: Surfer Grid'ο
- extensions = 'grd GRD'ο
Write Cell Centers To CSVο
- class PVGeo.grids.fileio.WriteCellCenterData[source]ο
Bases:
WriterBase
This writer will save a file of the XYZ points for an input datasetβs cell centers and its cell data. Use in tandom with ParaViewβs native CSV writer which saves the PointData.
Write vtkImageData
to Surfer Formatο
- class PVGeo.grids.fileio.WriteImageDataToSurfer[source]ο
Bases:
WriterBase
Write a 2D
vtkImageData
object to the Surfer grid format- SetInputArrayToProcess(idx, port, connection, field, name)[source]ο
Used to the inpput array / the data value (z-value) to write for the Surfer format.
- Parameters:
idx (int) β the index of the array to process
port (int) β input port (use 0 if unsure)
connection (int) β the connection on the port (use 0 if unsure)
field (int) β the array field (0 for points, 1 for cells, 2 for field, and 6 for row)
name (int) β the name of the array
- apply(input_data_object, array_name)[source]ο
Run the algorithm on an input data object, specifying one data array to save out.