NOAA-OWP / t-route

Tree based hydrologic and hydraulic routing
Other
44 stars 50 forks source link

Re-add network_dl autodownload of primary data file for routing v02 #87

Open jameshalgren opened 4 years ago

jameshalgren commented 4 years ago

The following code in nhd_network_utilities.py used to automatically download the main RouteLink file for executing the routing simulations. The code was removed for several good reasons, but could be brought back...


        filename = os.path.basename(geo_file_path)
        msg = ""
        msg = msg + f"\nTarget input file not found on file system here:"
        msg = msg + f"\n{geo_file_path}"
        msg = msg + f"\n"
        msg = msg + f"\nThis routine will attempt to download the file from here:"
        msg = msg + f"\n{data_link}"
        msg = (
            msg
            + f"\nYou should not need to repeat this step once the file is downloaded."
        )
        msg = msg + f"\n"
        msg = (
            msg
            + f"\nIf you wish to manually download the file (and compress it), please use the following commands:"
        )
        msg = msg + f'\n# export ROUTELINK="{filename}"'
        msg = (
            msg
            + f"\n# wget -c https://www.nco.ncep.noaa.gov/pmb/codes/nwprod/nwm.v2.0.2/parm/domain/$ROUTELINK"
        )
        msg = (
            msg
            + f"\n# export $ROUTELINK_UNCOMPRESSED=${{ROUTELINK/\.nc/_uncompressed.nc}}"
        )
        msg = msg + f"\n# mv $ROUTELINK $ROUTELINK_UNCOMPRESSED"
        msg = msg + f"\n# nccopy -d1 -s $ROUTELINK_UNCOMPRESSED $ROUTELINK"

        """
        Full CONUS route-link file not found on file system.
        This routine will attempt to download the file.

        If you wish to manually download the file, please use the following commands:

        > export ROUTELINK="RouteLink_NHDPLUS.nc"
        > wget -c https://www.nco.ncep.noaa.gov/pmb/codes/nwprod/nwm.v2.0.2/parm/domain/$ROUTELINK
        > nccopy -d1 -s $ROUTELINK ${ROUTELINK/\.nc/_compressed.nc}
        """
        print(msg)

        network_dl.download(geo_file_path, data_link)```
jameshalgren commented 3 years ago

ping @jhrehanoaa related to #39