Sample files¶
Sample .xyz files contain spatial input point data for a D-Flow FM model, and are used in various other input files.
A sample data file is described by the classes below.
Model¶
XYZModel (FileModel)
pydantic-model
¶
Sample or forcing file.
Attributes:
Name | Type | Description |
---|---|---|
points |
List[hydrolib.core.io.xyz.models.XYZPoint] |
List of |
dict(self, *args, **kwargs)
¶
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
Source code in hydrolib/core/io/xyz/models.py
def dict(self, *args, **kwargs):
# speed up serializing by not converting these lowest models to dict
return dict(points=self.points)
XYZPoint (BaseModel)
pydantic-model
¶
Single sample or forcing point.
Attributes:
Name | Type | Description |
---|---|---|
x |
float |
x or λ coordinate |
y |
float |
y or φ coordinate |
z |
float |
sample value or group number (forcing) |
comment |
Optional[str] |
keyword for grouping (forcing) |
comment: str
pydantic-field
¶
comment or group name
Parser¶
XYZParser
¶
A parser for .xyz files which are like this:
number number number number number number # comment
Note that the whitespace can vary and the comment left out.