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

plot: annual estimates vs year #138

Open
aappling-usgs opened this issue Jan 9, 2017 · 7 comments
Open

plot: annual estimates vs year #138

aappling-usgs opened this issue Jan 9, 2017 · 7 comments

Comments

@aappling-usgs
Copy link
Collaborator

these plots are not among Rich's requested plots, but they're available through EGRET. two issues regarding the current implementation:

  1. can we take out the flow normalized concentrations with plotFlowNorm=FALSE? normalization isn't currently available through loadflex, though i hope we might eventually get there.

  2. loadflex also does the load aggregation required to come up with annual estimates, and it may make slightly different assumptions than EGRET does. Would there be a way to make it so that we pass in the aggregated values from loadflex rather than relying on EGRET to do it? see aggregateSolute

@lindsayplatt
Copy link

@aappling-usgs which plot has flow normalized concentrations? Laura mentioned in a comment that the flow normalized lines won't show up with the current implementation.

Her comment on #131 Jan 5 at 3:28 pm: "Flow-normalized lines don't show up, I'm not sure if we want to figure out a generalized way to do flow normalized for non-EGRET stuff, but maybe...."

@lindsayplatt
Copy link

Nevermind, I see the email says plotFluxHist and plotConcHist. But, the flow normalized lines aren't actually added. Just the mean values as points. Do you want to try and get rid of the title that mentions flow normalized entirely?

image

image

@lindsayplatt
Copy link

Again, just piecing all of this together. You can pass in that stuff yourself, too. Did you want to make plotFlowNorm a default? It might be confusing to change what the default EGRET settings are. Especially since we want them to rely on those for everything else. You can accomplish what you're saying by adding it to our existing function:

plotEGRET("plotFluxHist", intdat, estdat, preds, meta, plotFlowNorm=FALSE)

@lindsayplatt
Copy link

I bet we could alter EGRET's aggregating function for our own use. Laura is gone this week, but I can make a PR with suggested changes. (1) we just need to make the data.frames compatible. (2) we add an argument to plotConcHist and plotFluxHist (maybe called aggregateDF) to pass in user-aggregated data optionally. This would affect this line in both: localAnnualResults <- setupYears(paStart=paStart,paLong=paLong, localDaily = localDaily).

Examples of aggregating data in both

# aggregate in EGRET:
eList <- Choptank_eList
Daily <- getDaily(eList)
AnnualResults <- setupYears(Daily, 4, 10)

# aggregate in loadflex
metadata_example <- updateMetadata(exampleMetadata(), dates="date")
preds_example <- data.frame(fit=abs(rnorm(365, 5, 2)), se.pred=abs(rnorm(365, 1, 0.2)), 
  date=seq(as.Date("2018-05-15"), as.Date("2019-05-14"), by=as.difftime(1, units="days")))
aggregateSolute(preds_example, metadata=metadata_example, format="conc", agg.by="month")

@aappling-usgs
Copy link
Collaborator Author

  • flow normalization line: plotFlowNorm=TRUE is inappropriate for any loadflex model that can currently be created, and I think forever inappropriate for composite method or interpolation models, so I really do think that a default of plotFlowNorm=FALSE, overriding the EGRET default, would be good. But maybe we'll get around to finding a way to do flow normalization for some loadflex models in the next few months, so let's just wait on this for now.

    • @wdwatkins - please do specify plotFlowNorm=FALSE in your call to create plotFluxHist if that's one of the outputs in your batch mode script.
  • aggregation: Yes, I like your plan for how to keep aggregation happening in loadflex when plotting loadflex data. Let's try it.

    • Curious: Does EGRET ever plot values aggregated to other time intervals, e.g. monthly or quarterly fluxes?

@lindsayplatt
Copy link

There is a function called calculateMonthlyResults that aggregates daily values into monthly. I don't see anything beyond that.

@aappling-usgs
Copy link
Collaborator Author

OK, thanks for looking

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

No branches or pull requests

2 participants