Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADCP2 data download #303

Closed
kjschaudt opened this issue Mar 29, 2019 · 5 comments
Closed

ADCP2 data download #303

kjschaudt opened this issue Mar 29, 2019 · 5 comments
Labels
Milestone

Comments

@kjschaudt
Copy link

Trying to use Rnoaa to obtain the ADCP2 data at the NDBC using the buoy vignette. For any adcp2 dataset (year and buoy combination), I get the following error.

buoy(dataset='adcp2',buoyid=42881,year=2010)
Using a2010.nc
Error in data.frame(time, lat, lon, stringsAsFactors = FALSE) :
arguments imply differing number of rows: 15755, 0

Works great for wind. Any ideas?

buoy(dataset = 'cwind', buoyid = 45005, year = 2008, datatype = "c")
Dimensions (rows/cols): [29688 X 5]
2 variables: [wind_dir, wind_spd]

               time    lat     lon wind_dir wind_spd

1 2008-04-29T09:00:00Z 41.677 -82.398 10 9.0
2 2008-04-29T09:10:00Z 41.677 -82.398 8 9.0

@sckott
Copy link
Contributor

sckott commented Mar 29, 2019

thanks for your question. please share your R session info as requested

@kjschaudt
Copy link
Author

Hopefully, this is what you are requesting. Any time I reference an ADCP2 dataset, I get the data frame error listed in the output below. No problem with CWIND as the example shows.

Input script is as follows.

library('rnoaa')
buoy_stations(refresh=TRUE)
A2_res <- buoys(dataset = "adcp2")
head(A2_res)
tail(A2_res)
browseURL(A2_res[6,2])
buoy(dataset='adcp2', buoyid=42363)
buoy(dataset = 'cwind', buoyid = 45005, year = 2008, datatype = "c
```")
Output below.
> library('rnoaa')
> buoy_stations(refresh=TRUE)
# A tibble: 1,834 x 12
   station    lat    lon viewport DC.title DC.description description DC.subject
   <chr>    <dbl>  <dbl> <chr>    <chr>    <chr>          <chr>       <chr>     
 1 21413    30.5   152.  width=d… NDBC St… National Data… National D… weather, …
 2 21414    49.0   178.  width=d… NDBC St… National Data… National D… weather, …
 3 21415    50.2   172.  width=d… NDBC St… National Data… National D… weather, …
 4 21416    48.1   163.  width=d… NDBC St… National Data… National D… weather, …
 5 21417    43.2   157.  width=d… NDBC St… National Data… National D… weather, …
 6 21418    38.7   149.  width=d… NDBC St… National Data… National D… weather, …
 7 21419    44.4   156.  width=d… NDBC St… National Data… National D… weather, …
 8 32301    -9.9  -105.  width=d… NDBC St… National Data… National D… weather, …
 9 32302   -18     -85.1 width=d… NDBC St… National Data… National D… weather, …
10 32411     4.95  -90.9 width=d… NDBC St… National Data… National D… weather, …
# … with 1,824 more rows, and 4 more variables: DC.creator <chr>, DC.language <chr>,
#   DC.format <chr>, DC.date.created <chr>
> A2_res <- buoys(dataset = "adcp2")
> head(A2_res)
     id                                                                      url
1 15319 https://dods.ndbc.noaa.gov/thredds/catalog/data/adcp2/15319/catalog.html
2 41008 https://dods.ndbc.noaa.gov/thredds/catalog/data/adcp2/41008/catalog.html
3 41012 https://dods.ndbc.noaa.gov/thredds/catalog/data/adcp2/41012/catalog.html
4 42361 https://dods.ndbc.noaa.gov/thredds/catalog/data/adcp2/42361/catalog.html
5 42362 https://dods.ndbc.noaa.gov/thredds/catalog/data/adcp2/42362/catalog.html
6 42363 https://dods.ndbc.noaa.gov/thredds/catalog/data/adcp2/42363/catalog.html
> tail(A2_res)
       id                                                                      url
121 42936 https://dods.ndbc.noaa.gov/thredds/catalog/data/adcp2/42936/catalog.html
122 42937 https://dods.ndbc.noaa.gov/thredds/catalog/data/adcp2/42937/catalog.html
123 42940 https://dods.ndbc.noaa.gov/thredds/catalog/data/adcp2/42940/catalog.html
124 46044 https://dods.ndbc.noaa.gov/thredds/catalog/data/adcp2/46044/catalog.html
125 46081 https://dods.ndbc.noaa.gov/thredds/catalog/data/adcp2/46081/catalog.html
126 46089 https://dods.ndbc.noaa.gov/thredds/catalog/data/adcp2/46089/catalog.html
> browseURL(A2_res[6,2])
> buoy(dataset='adcp2', buoyid=42363)
Using a2005.nc
Error in data.frame(time, lat, lon, stringsAsFactors = FALSE) : 
  arguments imply differing number of rows: 13692, 0
> buoy(dataset = 'cwind', buoyid = 45005, year = 2008, datatype = "c")
Dimensions (rows/cols): [29688 X 5] 
2 variables: [wind_dir, wind_spd] 

                   time    lat     lon wind_dir wind_spd
1  2008-04-29T09:00:00Z 41.677 -82.398       10      9.0
2  2008-04-29T09:10:00Z 41.677 -82.398        8      9.0
3  2008-04-29T09:20:00Z 41.677 -82.398        5      9.3
4  2008-04-29T09:30:00Z 41.677 -82.398       13      9.5
5  2008-04-29T09:40:00Z 41.677 -82.398       14      9.4
6  2008-04-29T09:50:00Z 41.677 -82.398       12      9.4
7  2008-04-29T14:00:00Z 41.677 -82.398      341      6.5
8  2008-04-29T14:10:00Z 41.677 -82.398      332      6.8
9  2008-04-29T14:20:00Z 41.677 -82.398      335      6.4
10 2008-04-29T14:30:00Z 41.677 -82.398      332     

@sckott sckott reopened this Mar 29, 2019
@sckott
Copy link
Contributor

sckott commented Mar 29, 2019

I meant the output of sessionInfo() - requested when you open a new issue https://github.com/ropensci/rnoaa/issues/new

@kjschaudt
Copy link
Author

kjschaudt commented Mar 29, 2019 via email

@sckott
Copy link
Contributor

sckott commented Mar 30, 2019

thanks, i'll close this one in favor of #304

@sckott sckott closed this as completed Mar 30, 2019
@sckott sckott added this to the v0.9 milestone Apr 8, 2019
@sckott sckott added the bug label Apr 8, 2019
sckott added a commit that referenced this issue Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants