Comments (5)
I did not, but I did find a workaround by pulling for the day instead of the last hour and just pulling bottom of the stack/most-recent with exceptions built in to handle crossing 00z.
from nexradaws.
Pretty basic script to grab the latest file if of interest, but would obviously take some mods.
from datetime import datetime, timedelta
import os
import tempfile
import nexradaws
# start connection
conn = nexradaws.NexradAwsInterface()
# get the time and an earlier time
rightnow = datetime.utcnow()
rightthen = rightnow - timedelta(hours=1)
# what radar ya interested in?
radarid = 'KFWS'
# query the scans
thescans = conn.get_avail_scans_in_range(rightthen, rightnow, radarid)
#print(thescans)
if len(thescans) > 0:
# create a temporary directory or replace with path you want
templocation = tempfile.TemporaryDirectory(dir=os.getcwd())
# get the most recent
localfiles = conn.download(thescans[-1],templocation.name)
print(f"file saved to {localfiles.success[0].filepath}")
else:
print(f"Sorry no scans found for query{rightthen} - {rightnow}")
from nexradaws.
Just realize you might need the changes I put in the open pull request for this to work properly though... :/
from nexradaws.
I did try this, including setting the 'now' time to just before the current time and yet I'm still getting none-type errors
from nexradaws.
Just to verify, did you pull the changes mentioned in this merge request #15 ( the stack is in my fork https://github.com/nguy/nexradaws/tree/master).
If so, can you past the error trace to see if it's a different failure mode?
from nexradaws.
Related Issues (8)
- Despite having the module installed fails to import (Ubuntu 16.04.5 LTS) HOT 1
- Function get_avail_scans_in_range fails when attempting to get current UTC day data. HOT 2
- Function get_avail_scans should check for existence of resp['Contents']
- SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed
- OSError: unknown compression record HOT 1
- TypeError: 'NoneType' object is not iterable HOT 1
- TypeError: 'NoneType' object is not iterable when trying to get available scans in range for current day
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nexradaws.