Giter Site home page Giter Site logo

Comments (5)

scottthomaswx avatar scottthomaswx commented on July 17, 2024 1

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.

nguy avatar nguy commented on July 17, 2024

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.

nguy avatar nguy commented on July 17, 2024

Just realize you might need the changes I put in the open pull request for this to work properly though... :/

from nexradaws.

scottthomaswx avatar scottthomaswx commented on July 17, 2024

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.

nguy avatar nguy commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.