-
Notifications
You must be signed in to change notification settings - Fork 104
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
Outfilling Dialog #9363
Comments
@Vitalis95 in the design above: First you may wish to install the Then in the diagram above: |
@jkmusyoka @lilyclements ,do we need to add |
@lilyclements , concerning the
|
Summarising @rdstern's requests for changes in the R code:
Just wanted to have this written together somewhere. I can make the changes in the R package |
Just to respond to the items above:
|
|
On 2, in the function is it for a maximum of 1 station, or can we have more in your Exclude. The current dialog is just for 0 or 1 station? |
@rdstern It can now have multiple stations excluded. Before you pointed that out, it could only have one excluded (so you need to redownload the package) |
@lilyclements I see the new version can also output to a variable. My concern now that we can exclude many stations is on our routine use of this function, if it is the only one we have. Let's take Eastern Province, where there are 5 main stations, then over 100 volunteer stations, and quite some automatic stations. So let's consider the work in 2 stages: |
@rdstern setting a seed is there under the parameters “set_seed” (default NULL) I am unsure if I 100% follow. The monthly parameter (adjustment?) values are the same for all rows (so across the stations) because of how the function is set up, I believe. In the code, the “monthly parameter” values are all set, and then there is a loop through each row of the data using these values to generate new values. I did check on the generation of random values (e.g. a random binomial distributed value). Setting a single seed does mean that when we randomly generate a variable it does alter for each iteration of the loop (so each row does get a randomly distributed value). |
@Vitalis95 here are my suggestions for minor revisions to the current outfilling dialog. Here it is: a) Move the Looking forward! |
Once this is all working, the item that remains is to make the Stations to Exclude a control that can exclude multiple stations that you select. It needs a checkbox for each station and we have that elsewhere. It is the control in the Filter from Factors sub-dialog, and also in the filter sub-dialog when you choose a factor to filter on. |
After our meeting with Emily today, it is apparent we want to return two columns: "generated_rainfall" and "outfilled_rainfall". @Vitalis95 is there a way that we can return two variables from one function into a data frame in R-Instat? In addition, @rdstern do we want to have as "Stations to Exclude" or "Stations to Include"? I'm not sure which is easier for the user in R-Instat. I can do that we have "everything" by default, but otherwise you state which stations to include. |
@Vitalis95 the important change is to produce the 2 variables. We produce multiple variables into the same data frame in some other dialogs, e.g. the Prepare > Column: Numeric > Transform (with multiple options), and the Prepare > Column: Text > Split dialog. Here is the current dialog: I suggest you change Store Result(s) into @lilyclements can you improve on the est and out addition to the names? The tamsat_est is the variable currently produced - which is for every day, not just the days missing in the data. The second is simply I've forgotten what happens if you untick the storing checkbox? Lily, do we need to produce a new data frame? If not, then remove the checkbox so it always saves the 2 columns. We could merge after this, or include the next change (or more) at the same time. The change above doesn't need any change from Lily. Lily and Emily are suggesting that the You'll have to discuss with Lily, how to manage whatever it returns! |
@rdstern thanks for linking to the similar dialogs - I wasn't sure how to return the R code to have two new columns to join the data frame, but I think this is now done. I have added in the addition of I have also made a change in the Finally, the results were slightly different to what Emily was getting with her code. I have now fixed this after finding where this is coming from. Next Steps for @rdstern and @Vitalis95:
|
@N-thony this is mainly for @Vitalis95.
As part of our ePICSA work, we would like to construct a dialog to simplify the outfilling of station data using satellite estimates mainly for our current work in Zambia.
Below is the R script which we recently used in Zambia perform some outfilling. The outfilling uses @lilyclements
outfillingR
package.library(outfillingR) zambia_data <- data_book$get_data_frame(data_name="zambia_data") #perform outfilling infilled_data <- do_infilling( data = zambia_data, station = "station", date = "date", rainfall = "rainfall", rfe = "tamsat", lon = "longitude", lat = "latitude", station_to_exclude = "STATION A", rainfall_estimate_column = "tamsat", custom_bins = c(1, 5, 10, 15, 20), count_filter = 5, min_rainy_days_threshold = 30, target_months = c(5, 6, 7, 8, 9), distribution_flag = "gamma", markovflag = TRUE ) #display resulting dataframe data_book$import_data(data_tables=list(infilled_data=infilled_data))
See an initial design of the dialog below - largely based on the arguments of the
do_infilling
function in the script. I think this should be enough to get you @Vitalis95 started. Let me know any questions you may have.@lilyclements the script currently results in a new dataframe with the outfilled column. Wouldn't it simpler and neat if the outfilled column is just added to the dataframe we are trying to infill? Is this possible?
The text was updated successfully, but these errors were encountered: