data_sources.topographic
Topographic data sources and functions
data_sources.topographic.topographic_data_source
Topological DataSource
TopographicDataSource Objects
@dataclass
class TopographicDataSource(ImageDataSource)
Add topographic/elevation map features.
__post_init__
def __post_init__(image_size_pixels: int, meters_per_pixel: int)
Post init
get_example
def get_example(t0_dt: pd.Timestamp, x_meters_center: Number, y_meters_center: Number) -> Topographic
Get a single example
Arguments:
t0_dt
- Current datetime for the example, unusedx_meters_center
- Center of the example in meters in the x direction in OSGB coordinatesy_meters_center
- Center of the example in meters in the y direction in OSGB coordinates
Returns:
Example containing topographic data for the selected area
data_sources.topographic.topographic_model
Model for Topogrpahic features
Topographic Objects
class Topographic(DataSourceOutput)
Class to store topographic data as a xr.Dataset with some validation
TopographicML Objects
class TopographicML(DataSourceOutputML)
Topographic/elevation map features.
height
@property
def height()
The height of the topographic image
width
@property
def width()
The width of the topographic image
x_coordinates_shape
@validator("topo_x_coords")
def x_coordinates_shape(cls, v, values)
Validate 'topo_x_coords'
y_coordinates_shape
@validator("topo_y_coords")
def y_coordinates_shape(cls, v, values)
Validate 'topo_y_coords'
fake
@staticmethod
def fake(batch_size, image_size_pixels)
Create fake data
from_xr_dataset
@staticmethod
def from_xr_dataset(xr_dataset)
Change xr dataset to model. If data does not exist, then return None