Skip to content

1st draft R code to access met data in Clowder + geostreams #4

Merged
dlebauer merged 8 commits intomasterfrom
geostreams_met
Feb 7, 2017
Merged

1st draft R code to access met data in Clowder + geostreams #4
dlebauer merged 8 commits intomasterfrom
geostreams_met

Conversation

@dlebauer
Copy link
Copy Markdown
Member

@dlebauer dlebauer commented Feb 6, 2017

Submitting draft for feedback, please don't merge until useable

  • @max-zilla please review the clowder API section. I would like to download a netCDF file using the API but not sure how
  • @Zodiase could you review and add content, e.g. from github discussions?

@max-zilla
Copy link
Copy Markdown
Contributor

@dlebauer I made some edits to the file, but I didn't want to merge to your branch blindly so I created my own:
https://github.com/terraref/tutorials/blob/geostreams_met_max/sensors/01-meteorological-data.Rmd

Aside from cleaning up some comments...

  • will automatically download ALL .nc files in the Sample Data directory to specified local directory using for loop (~150 MB total)
  • will aggregate measure (e.g. solar spectrum) across all .nc files for time plot

Note that I had to coerce the time into as.numeric because my R skills are rusty and the ymd format was creating weird Y/M/D/h/m/s matrices I couldn't properly concatenate - I thought you might see an easy way to cast that as user-friendly YMD for plotting.

This is the key snippet for downloading:

print(paste0("Downloading ", sources[i], " to ", outputs[i]))
  f <- CFILE(outputs[i], mode = "wb")
  curlPerform(url = sources[i], writedata = f@ref)
  RCurl::close(f)

@dlebauer dlebauer mentioned this pull request Feb 6, 2017
@dlebauer dlebauer merged commit 4e27de7 into master Feb 7, 2017
@dlebauer dlebauer deleted the geostreams_met branch February 7, 2017 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants