How to use the tonic.models.vic.vic2netcdf.Point function in tonic

To help you get started, we’ve selected a few tonic examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github UW-Hydro / tonic / tonic / models / vic / vic2netcdf.py View on Github external
def get_file_coords(files):
    """
    Get list of Point objects
    """

    points = Plist()

    for i, filename in enumerate(files):
        # fname = path.split(f)[1][-16:] # just look at last 16 characters
        f = filename[-22:]  # just look at last 16 characters
        lat, lon = list(map(float, findall(r"[-+]?\d*\.\d+|\d+", f)))[-2:]
        points.append(Point(lat=lat, lon=lon, filename=filename))

    return points
# -------------------------------------------------------------------- #