Git Product home page Git Product logo

Comments (3)

jameshalgren avatar jameshalgren commented on September 6, 2024

Good catch. @RohanSunkarapalli Can you address?

from nwmurl.

RohanSunkarapalli avatar RohanSunkarapalli commented on September 6, 2024

Yes @jameshalgren , that's right. I gave that condition because when I observed the bucket we saw that the files from year 2007 doesn't have "00" appended to the date format whereas the files from 90's to 2006 has "00" at the tail of the date format.

I gave this condition -

if "forcing" in file_type and date.year < 2007:

But if you think it's not needed anymore it could be corrected by modifying the code to this way -

def generate_url_retro(date, file_type, urlbase_prefix, retrospective_var_types=None):
year_txt = date.strftime("%Y")
date_txt = date.strftime("%Y%m%d%H%M") # Updated to include minutes

if "forcing" in file_type and date.year < 2007:
    url = f"{urlbase_prefix}{file_type}{year_txt}/{date_txt}.LDASIN_DOMAIN1"
elif "forcing" in file_type and date.year >= 2007:
    url = f"{urlbase_prefix}{file_type}{year_txt}/{date_txt}.LDASIN_DOMAIN1"
elif "model_output" in file_type:
    url = [
        f"{urlbase_prefix}{file_type}{year_txt}/{date_txt}{type}"
        for type in retrospective_var_types
    ]

if urlbase_prefix == "https://ciroh-nwm-zarr-retrospective-data-copy.s3.amazonaws.com/noaa-nwm-retrospective-2-1-zarr-pds/":
    for url in url: 
        url = url + ".json"
        url = url.replace('.comp', '')
return url

from nwmurl.

jameshalgren avatar jameshalgren commented on September 6, 2024

Addressed by #57

from nwmurl.

Related Issues (20)

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.