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

tests for swdi and changes to isd_stations #239

Merged
merged 5 commits into from Oct 31, 2017

Conversation

kev-ho
Copy link
Contributor

@kev-ho kev-ho commented Oct 26, 2017

Description

isd_stations changed to have consistent variable names "out" instead of "stations"

Radius test fails on my machine. But the logic seems sound. I think the data needs to be investigated

Related Issue

#208

isd_stations changed to have consistent variable names "out" instead of "stations"

Radius test fails on my machine. But the logic seems sound. Data needs to be investigated
I should test before committing next time. Even for small changes.
@sckott sckott merged commit 768fdeb into ropensci:master Oct 31, 2017
@sckott
Copy link
Contributor

sckott commented Nov 7, 2017

@kevin-ht-ho i think you worked on the swdi tests, yes? This one test is failing now https://travis-ci.org/ropensci/rnoaa/builds/296388194#L2108 Looking at it locally, Reduce("&",coordinates$distance < radius * 1.609344) returns FALSE, so the test fails.

Any thoughts?

@kev-ho
Copy link
Contributor Author

kev-ho commented Nov 8, 2017

@sckott When I wrote this test it didn't pass. But from what I can tell its actually a problem with the function itself (or the documentation describing what it should be returning).

The test is for swdi events that occur within a radius of a GPS location.

I just used the example in the documentation as the test case

# Get all 'nx3tvs' within 15 miles of latitude = 32.7 and longitude = -102.0
out <- swdi(dataset='nx3tvs', 
startdate='20060506', 
enddate='20060507', 
radius=15, 
center=c(-102.0,32.7))

If I just look at the "shape" variable of the output I get the following.

> out$shape
                                        shape
1  POINT (-101.126934590189 34.4896389449586)
2  POINT (-98.648742711054 36.4111067927992)
...
... <Truncated for brevity>
...
25 POINT (-101.177025256003 33.0567904388579)

When I measured the distance between the points (using meteo_spherical_distance()) and the center, they're all over 15 miles (24km) with the furthest point being, the second point returned is 514km away.

@sckott
Copy link
Contributor

sckott commented Nov 8, 2017

thanks @kevin-ht-ho - Okay, sounds like something is amiss. Will look into this and see if the fxn needs fixing, or something else

@sckott
Copy link
Contributor

sckott commented Nov 11, 2017

@kevin-ht-ho opened an issue #243

seems like those values from meteo_spherical_distance are in km, not miles, but still those values are too large.

@sckott sckott added this to the v0.8 milestone Dec 1, 2018
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.

None yet

2 participants