Comments (17)
Use creek_pop.sas7bdat file WBID field in tbeptools as list or in one to many join to subset data based on WBIDs within SW FL tidal creeks population
from tbeptools.
@mikewessel is this the only step to distill the entire run 56 database to iwr56_tidalcreeks.sas7bdat
?
from tbeptools.
from tbeptools.
@mikewessel partially there, but running into memory issues on import...
# specify run
run <- 'run60'
# check if url exists
url <- paste0('http://publicfiles.dep.state.fl.us/dear/kristin/', run, '/')
urlexst <- RCurl::url.exists(url)
if(!urlext)
stop('URL for ', url, ' doesnt exist')
# get file list, probably overkill because the file name doesn't change
fls <- RCurl::getURL(url, verbose = T, ftp.use.epsv = F, dirlistonly = T, crlf = T)
zip <- gsub('^.*\\">(.*\\.zip)<.*$', '\\1', fls)
zip <- paste0(url, zip)
# download and unzip to temp directory
tmp1 <- tempfile()
tmp2 <- tempfile()
download.file(zip, destfile = tmp1)
unzip(tmp1, exdir = tmp2)
# attempt to read sas file
dat <- haven::read_sas(list.files(tmp2, full.names = T))
### Error: cannot allocate vector of size 318.8 Mb
from tbeptools.
from tbeptools.
Spent most of the morning trying to get this working, but no luck yet: https://github.com/bnosac/spark.sas7bdat
Even if it does work, it would probably take some effort to make it portable (i.e., automate on different machines). I still think it's worth getting setup though...
from tbeptools.
from tbeptools.
@mikewessel do you think it's feasible for them to upload a text file? Wouldn't that be much larger than the SAS file?
I'd rather not go the Access route. I've done it but it makes the workflow so much more vulnerable.
from tbeptools.
from tbeptools.
from tbeptools.
@mikewessel I think the data.table
package is the way to go for large text files. I can get it manageable using this code. Is the text file something that DEP can host?
library(data.table)
library(tbeptools)
tmp <- fread('~/Desktop/iwr2002_pv.txt', sep = '\t')
tmp2 <- tmp[wbid %in% tidalcreeks$wbid, c('wbid', 'class', 'sta', 'year', 'month', 'day', 'time', 'depth', 'depth2', 'param', 'masterCode', 'result')]
rm(list = 'tmp')
save(tmp2, file = 'data/tmp2.RData', compress = 'xz')
from tbeptools.
This may be possible to query through Water Atlas:
From Adok:
We currently have the Impaired Waters data as a part of the Water Bodies WaterQuality API. It is currently bundled and query-able by Waterbody id within the water atlas.
Here is the API: https://api.wateratlas.usf.edu/sandbox/index#!/Waterbodies/WaterBodyDetails_GetWaterQualityData
Example for Lake Thonotosassa https://api.wateratlas.usf.edu/waterbodies/5383/WaterQuality?s=2
I'll take a stab, sometime in the next couple of weeks, at making this API be a little more user friendly (Query by WBID/county & return a little more detail such as Run numbers etc.)
from tbeptools.
from tbeptools.
Revisiting this again, I think we're almost there: https://tbep-tech.github.io/tidalcreek-stats/Creek_select_tbeptools
Some final questions:
- Is there a corresponding wbid and station file that is released with each IWR run? Run 62 is out now but I can't find a WBID 62 polygon shapefile. Same for stations, but these can be pulled from the
.accdb
files. - What is the importance of the newComment column? I couldn't find this in the imported data using the new workflow.
- Are the files
TidalCreek_ALL_Line.shp
andTidalCreek_ALL_Line_Buff200m
permanent? Guessing yes... if so, I will need to include the former in tbeptools, latter can be recreated withst_buffer
w/ flat ends. - Long-term, how do we want to compare result between runs or as a time series? Ten-year moving windows?
from tbeptools.
from tbeptools.
Adding this here for the record, IWR spatial data are available here: https://geodata.dep.state.fl.us/, geojson download here: https://geodata.dep.state.fl.us/datasets/FDEP::impaired-waters-rule-iwr-stations/about
from tbeptools.
Finally closing this, too tedious to include a function in tbeptools for this. However, this external workfow seems to work well:
https://tbep-tech.github.io/tidalcreek-stats/Creek_select_tbeptools (updated for run 64 in this commit tbep-tech/tidalcreek-stats@6aae2fc).
from tbeptools.
Related Issues (20)
- Seagrass - plotting 1 or 2 species HOT 1
- Site Map Feature Request HOT 2
- Transect dashboard HOT 1
- vignette
- show_transectmatrix needs a neutral color scheme HOT 4
- Include code examples? HOT 1
- Develop function to provide salinity means for bay segments HOT 1
- add tests and vignettes for show_tldcrkradar HOT 2
- Updates to creeks dashboard
- [JOSS Review] Clarify statement of need in README and in paper HOT 1
- [JOSS Review] Widen the scope of literature review in paper
- [JOSS Review] Testing on MacOS? HOT 1
- [JOSS Review] Add brief example usage to the paper
- [JOSS Review] Consider more verbose function names HOT 1
- Add optical parameters to read_formwq.R output HOT 1
- Update any EPC links with new ones
- verify some calcs on `anlz_sedimentpel` HOT 2
- Add options for output of summaries for groups of sediment contaminants
- Add function to calculate Al ratio plot for sediment contaminants
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tbeptools.