Coder Social home page Coder Social logo

Comments (6)

lilyclements avatar lilyclements commented on September 10, 2024

The ‘export_cdt’ function works the same for dekadal as for daily etc so there won’t be any parameter changes, just calling the export_cdt function directly.
However am happy to do this still, and adding an additional check the data type is dekadal. Can do the same with daily data?

from cdms.products.

dannyparsons avatar dannyparsons commented on September 10, 2024

That's good they will work the same!

I think the difference will just be that for daily data the date column will be the date for each day whereas for dekadal data this column will need to be in the format: 1999011, 1999012, 1999013, 1999021 etc. which is like the number of each dekad.

In the way that our dekad function works currently this would need to be paste0(year, month, dekad) to get this format since dekad returns 1, 2, 3....

So I think we would just need to do this bit of pre-processing in the function. I think we keep it as one function with these options.

from cdms.products.

lilyclements avatar lilyclements commented on September 10, 2024

Sure. I assumed that the data in this function would have had the dekad function already applied.
So shall I change the “date” parameter to “type” (or whichever the parameter name is in the other _export function) and then it can read in a “date” variable for daily data, and the dekadal column for the dekad data.

from cdms.products.

lilyclements avatar lilyclements commented on September 10, 2024

Should it have a check in? If it works for any date format at the moment then a check might lose the functionality if, say, someone used pentad

from cdms.products.

dannyparsons avatar dannyparsons commented on September 10, 2024

Yes, a type = c("daily", "dekad") argument would be good. The optional parameters date, year, month, dekad.
If type = "daily" then only date is required. The others are ignored. This is used for the output.
If type = "dekad" then we need date or year, month, dekad. We make a new column paste0(year, month, dekad) for use in the output. If only date is provided we can create year, month, dekad from it.

from cdms.products.

dannyparsons avatar dannyparsons commented on September 10, 2024

I'm not sure if CDT accepts formats other than daily and dekad, which is what Climsoft exports to. If other formats are possible, we can always add those later.

from cdms.products.

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.