Skip to content

Commit

Permalink
Fixing thunder 1.1.2 release
Browse files Browse the repository at this point in the history
Fixing thunder 1.1.2 release
  • Loading branch information
mtaszarek authored Sep 7, 2023
1 parent ae123b3 commit 5d08ba2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# thundeR 1.1.2

* Allowing to keep NA values in `get_sounding()` which might be not harmful if missing data occur on higher altitudes
* Allowing to keep NA values in `get_sounding()` which might be not harmful if missing data occur on higher altitudes for dew point temperatures

# thundeR 1.1.1

Expand Down
6 changes: 5 additions & 1 deletion R/get_sounding.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ get_sounding = function(wmo_id, yy, mm, dd, hh, metadata = FALSE) {
colnames(sounding_data[[1]]) = c("pressure", "altitude", "temp", "dpt",
"rh", "mixr", "wd", "ws", "thta", "thte", "thtv")
sounding_data[[1]] = sounding_data[[1]][, c("pressure", "altitude", "temp", "dpt","wd", "ws")]


# extra correction for missing entries in the dew oint temperature (only for proper display of the profile):
sounding_data[[1]]$dpt[is.na(sounding_data[[1]]$dpt) & !is.na(sounding_data[[1]]$temp)] = -273
sounding_data[[1]] = na.omit(sounding_data[[1]])

if (!metadata) {
sounding_data = sounding_data[[1]]
}
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-get_sounding.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_that("Downloading sounding profile", {
dd = 20,
hh = 12)

expect_equal(nrow(profile), 73)
expect_equal(nrow(profile), 72)
expect_true(is.data.frame(profile))
})

Expand All @@ -19,4 +19,4 @@ test_that("Sounding profile error", {
hh = 12)
)

})
})

0 comments on commit 5d08ba2

Please sign in to comment.