def GrabFileToRename(ldir, type, station):
    """
    Grabs our new file(s) and renames them with a timestamp
    ------------------------------------------------------------------------------
    Inputs:
    ldir:        Local directory where images are downloaded to
    type:        Image type (see docstring in FetchRidgeImage)
    station:     Radar station ID (see docstring in FetchRidgeImage)
    ------------------------------------------------------------------------------
    """
    imagelist = [os.path.join(ldir, station + '_' + type + '_0' + '.gif')]
    # Loop thru images we just downloaded (.gif & .gfw), rename them with timestamp
    for imagebase in imagelist:
        imagebase = imagebase[:-13]
        for imgfile in imagelist:
            imgfileonly = imgfile[-13:-4]
            # Set list of extentions
            list = ['gif', 'gfw']
            for imgext in list:
                fullimgname = imgfileonly + '.' + imgext
                # Call rename f(x)
                RenameWithTimeStamp(os.path.join(imagebase, fullimgname),
                    os.path.join(imagebase, imgfileonly + '_' + stamp + '.' + imgext))

    Grabs our new file(s) and renames them with a timestamp
    ------------------------------------------------------------------------------
    Inputs:
    ldir:        Local directory where images are downloaded to
    type:        Image type (see docstring in FetchRidgeImage)
    station:     Radar station ID (see docstring in FetchRidgeImage)
    ------------------------------------------------------------------------------
    
recipes/Python/499352_Download_rename_RIDGE_radar/recipe-499352.py