AnnieHow / dod

dod package development
https://anniehow.github.io/dod/
3 stars 0 forks source link

request: dod.section() to get section data #28

Closed dankelley closed 1 year ago

dankelley commented 2 years ago

I've been working this afternoon with section data (collections of CTD files) that I got from https://cchdo.ucsd.edu/data/22008/a22_2021_ct1.zip which is a link I got to from https://cchdo.ucsd.edu/products/goship-easyocean

I am not clear if this should be handled in something called dod.section() or dod.ctd(). I think the latter, actually (despite the subject line) but I'm not sure. Anyway if you go to the second link and click on things you'll maybe discover the pattern. I think it is basically like below.

dod.section <- (program...)
{
    if (program="cchdo") {
        server <- "https://cchdo.ucsd.edu/data"
        code <- "22008" # not sure what to call this
        section <- "a22"
        year <- "2021"
        filename <- paste0(section, "_", year, "_ct.zip")
        url <- paste0(server, "/", code, "/", file)
        download.dod() # use url and filename here
    }
}

or something like that.

I don't actually know whether this should be dod.section() or dod.ctd(). Maybe the latter because that's what the data actually are. As for the program name, I don't know a good answer for that. Maybe like I have above.

Pretty much every year at this time I scour the web looking for sources of section data. I think the URLs change quite frequently, which is a pain. Having this handled by dod would be very time-saving because it's boring doing the same search over and over!

dankelley commented 2 years ago

PS: annoyingly, that website doesn't seem to have an index. But, no matter, the docs for our dod code could just tell folks to go to the site to discover the codename etc by clicking around.

dankelley commented 1 year ago

Transferred to https://github.com/dankelley/dod/issues/2