Xns11
Xns11(self, file_path=None)
A class to read and write xns11 files.
Parameters
Name | Type | Description | Default |
---|---|---|---|
file_path |
str | Path | full path and file name to the xns11 file. | None |
Examples
# Open an existing file
>>> xns = Xns11("file.xns11")
# Overview of the cross sections
>>> xns.xsections.to_dataframe()
# Read a specific cross section
>>> xs = xns.xsections.sel(location_id='basin_left1', chainage='122.042', topo_id='1')
# Plot a cross section
>>> xs.plot()
# Access cross section raw data
>>> xs.raw_data
# Access cross section processed data
>>> xs.processed_data
Attributes
Name | Description |
---|---|
file | Alias for CrossSectionData objected stored on the member ’_cross_section_data’. |
interpolation_type | Defines how an interpolated cross section are interpolated. |
reach_names | A list of the reach names. |
topoid_names | A list of the topo-id names. |
xsections | A collection of CrossSection objects. |
Methods
Name | Description |
---|---|
add_xsection | Add a cross section to the file. |
close | Close the file handle. |
from_cross_section_collection | Create a Xns11 object from a CrossSectionCollection. |
get_supported_file_extensions | Get supported file extensions for Xns11. |
info | Print information about the result file. |
read | Read the requested data from the xns11 file and return a Pandas DataFrame. |
write | Write data to the file. |
add_xsection
Xns11.add_xsection(cross_section)
Add a cross section to the file.
close
Xns11.close()
Close the file handle.
from_cross_section_collection
Xns11.from_cross_section_collection(xsections)
Create a Xns11 object from a CrossSectionCollection.
get_supported_file_extensions
Xns11.get_supported_file_extensions()
Get supported file extensions for Xns11.
info
Xns11.info()
Print information about the result file.
read
Xns11.read(queries)
Read the requested data from the xns11 file and return a Pandas DataFrame.
Parameters
Name | Type | Description | Default |
---|---|---|---|
queries |
QueryData objects that define the requested data. |
required |
Returns
Type | Description |
---|---|
pd.DataFrame |
write
Xns11.write(file_path=None)
Write data to the file.