예제 #1
0
        # posted to hydro-c1-web to ingest into hydroInspector.

        # Channel output
        completePath = completeDir + '/nwm.t' + hrStrCycle + \
                       'z.short_range.terrain_rt.tm00.conus_' + dStr1Cycle + \
                       '_f' + fStr + '.COMPLETE'
        fileDPath = 'nwm.t' + hrStrCycle + 'z.short_range.terrain_rt.f' + fStr + '.conus.nc'
        fileCompress = 'nwm.' + dStr2Cycle + '_t' + hrStrCycle + '_f' + fStr + '.short_range.' + \
                       'terrain_rt.conus.COMPRESS.nc'
        httpDir = 'http://para.nomads.ncep.noaa.gov/pub/data/nccf/com/nwm/para/nwm.' + dStr2Cycle + \
                  '/short_range/'
        ftpDir = '/pub/data/nccf/com/nwm/prod/nwm.' + dStr2Cycle + '/short_range'
        if not os.path.isfile(completePath):
            findStatus = inspectorMod.downloadNwmHTTP(httpDir, completeDir,
                                                      fileDPath, fileCompress,
                                                      errTitle, email,
                                                      lockFile)
            if findStatus == 1:
                # Parallel file was found and sucessfully downloade.
                inspectorMod.copyToWeb(completeDir + '/' + fileCompress,
                                       webDirTmp, errTitle, email, lockFile)
                inspectorMod.shuffleFile(fileCompress, webDirFinal, webDirTmp,
                                         errTitle, email, lockFile)
                inspectorMod.genFlag(completePath, errTitle, email, lockFile)
                inspectorMod.checkFile(completePath, errTitle, email, lockFile)
                inspectorMod.deleteFile(completeDir + "/" + fileCompress,
                                        errTitle, email, lockFile)

# Delete lock file
inspectorMod.deleteFile(lockFile, errTitle, email, lockFile)
예제 #2
0
        # Place data into variables
        xVar[:] = idMeta.variables['x'][:]
        yVar[:] = idMeta.variables['y'][:]
        sweVar[0, :, :] = np.flipud(sweData[0, :, :])
        sdVar[0, :, :] = np.flipud(depthData[0, :, :])
        timeVar[:] = dtMin
        refVar[:] = dtMin

        # Close NetCDF files
        idIn.close()
        idOut.close()
        idMeta.close()

        # Move compressed file to hydro-c1-web
        inspectorMod.copyToWeb(fileCompress, webDirTmp, errTitle, email,
                               lockFile)

        # Final atomic move to final directory for hydroInspector
        inspectorMod.shuffleFile(pathCompress, webDirFinal, webDirTmp,
                                 errTitle, email, lockFile)

        # Create complete flag
        inspectorMod.genFlag(completeFlag, errTitle, email, lockFile)

        # Delete compressed file generated on local disk
        inspectorMod.deleteFile(fileCompress, errTitle, email, lockFile)

# Delete lock file
inspectorMod.deleteFile(lockFile, errTitle, email, lockFile)