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

swdi distances seem broken #243

Closed
sckott opened this issue Nov 11, 2017 · 3 comments
Closed

swdi distances seem broken #243

sckott opened this issue Nov 11, 2017 · 3 comments
Labels
Milestone

Comments

@sckott
Copy link
Contributor

sckott commented Nov 11, 2017

via #239

get_cordinates_df <- function(swdi_output) {
  swdi_output$shape %>%
    dplyr::mutate(shape = sub(".*POINT.*\\(","",shape)) %>%
    dplyr::mutate(shape = sub(")","",shape)) %>%
    tidyr::separate(shape, c("lon", "lat"), sep = " ") %>%
    dplyr::mutate(lat = as.numeric(lat), lon = as.numeric(lon))
}

center <- c(-102.0, 32.7)
out <- swdi(dataset='nx3tvs', startdate='20060506', enddate='20060507', 
    radius = 5, center = center, verbose = TRUE)

coordinates <- get_cordinates_df(out)
coordinates$distance <- meteo_spherical_distance(lat1=center[2], long1=center[1], 
	lat2=coordinates[2][[1]], long2=coordinates[1][[1]]) 
head(coordinates)
lon lat distance
-101.12693 34.48964 214.79856
-98.64874 36.41111 514.18312
-102.72588 33.20819 88.20470
-101.41145 32.89070 58.95814
-101.96767 33.13551 48.52061
-101.38741 32.88153 60.71622

distance values are in km, but still converting to miles means they are all much greater than 15 miles away from the focal point.

@sckott
Copy link
Contributor Author

sckott commented Nov 11, 2017

have emailed NOAA folks

@sckott sckott added the bug label Nov 11, 2017
@sckott
Copy link
Contributor Author

sckott commented Nov 14, 2017

heard back. radius/etc. stuff is not operational - they'll update docs soon, ideally wait till those are updated to update here.

@sckott
Copy link
Contributor Author

sckott commented Nov 14, 2017

docs at https://www.ncdc.noaa.gov/swdiws/

@sckott sckott added this to the v0.8 milestone Jan 21, 2018
@sckott sckott closed this as completed in 14580ef Oct 8, 2018
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

1 participant