IDEMSInternational / R-Instat

A statistics software package powered by R
http://r-instat.org/
GNU General Public License v3.0
38 stars 103 forks source link

PICSA dialog designs #2301

Open Lunalo opened 7 years ago

Lunalo commented 7 years ago

1) The dialog with all the options image

The combo box at the top will allow the user select Temperature or rainfall and the appropriate controls for each option will be visible. I did this to avoid radio buttons appearing at the top of the dialog.

The group box of the plots will be showing the desired plots for each option(Temp/Rainfall) . There are two group boxes one for Temperature plots and the other for Rainfall plots.

I also thought of the numeric up down that will hold the thresh hold value for each option with the default value appearing.

I also thought of one group box for crop models for the case of Crops modelling but I didn't have an idea of which models to put.

Lastly, We have option for saving the results which can be reused.

Other designs are as follows.

2) Temperature and Rainfall

image

3) Rainfall

image

4) Temperature image

5) Crops

image

I hope hope all @africanmathsinitiative/instat members will have a look at this and suggest the improvement.

Thanks.

volloholic commented 7 years ago

Hi John

There a few critical issues like the plot choices you have given do not perfectly correspond to PICSA plots. Where did you get the list from? Even if they did I do not believe you could satisfactorily implement in the way you illustrate for example how is a season defined?

The combined one needs more thought: First using a combo box like that is even worse than using radio buttons would have been! This is a perfect illustration of why it is important to understand why something is wrong before finding a replacement!

And actually there is a bigger question at stake what is the functional difference you see from a users perspective of using the combined? I was imagining that with the combined the user could choose both rainfall and temperature graphs for example.

I think you need to think more carefully about the design. Ask question if you need to you're not expected to have all the answers on your own but I hope you will be able to conceptualise something usable which this certainly isn't. Do not underestimate what goes into a good conceptualisation!

I hope you're enjoying the challenge of moving up from implementation and are appreciating that things only get harder as you try to specify rather than just implement.

Good luck

David

Lunalo commented 7 years ago

Hi @volloholic

Thanks for eye opening remarks.

The main question that has been ringing in my mind is that what do we want to achieve with this dialog(s)

also, what is the main use of PICSA. If I get this right then I will be in a position to do it right

I will do more research and also consult with Danny, Steve and Roger to get this right after which I will redesign the dialogs.

Thank you.

volloholic commented 7 years ago

Hi John Your main question is a good one. James knows PICSA I suggest you try talking to him to get a better understanding of PICSA and how he thinks this dialogue might be used. By all means talk to me Danny Roger and Steve as well but we won't be able to tell you simply this is what is needed without doing the work ourselves. Part of the aim of this task is to start spreading the load of conceptualisation of dialogues a bit. So I hope if you do talk to us you don't ask questions like what should it do how should it look but rather things like, "Am I correct that .... might be a potential user and they would want the dialogue to ...?" I hope you enjoy this new approach. David

rdstern commented 7 years ago

Suggested design for the crop dialogue

This is the R code that Francis Torgbor has been working on. It will change quite a lot for R-Instat and he should remain involved in the design of both the R code and in discussions on the dialogue – or sub-dialogue. James also knows what this method does for PICSA. This is also a good test of the summary methods that David and Danny have been working on. I suggest it is easier to explain what is happening by understanding – perhaps trying first my suggestions for the dialogue and also for the presentation of the results. We actually need 2 data frames, but they will be linked, so I suggest as follows: a) Usual data selector, and sheet selected is annual summary sheet. b) Before using this dialogue the summary sheet should contain the column for the date of the start of the rains. It should also have the date of the length (or the end). c) There is a single data receiver with a label “Season Start” d) Under this there is a checkbox (default unchecked) with the label “Length” e) Under this is a second single receiver with the label “Season End”. f) If the checkbox is ticked, then the second receiver label changes to “Season Length g) These have to be specified, because it is quite possible that the data frame may contain multiple definitions of the start. h) Then across the dialogue there are three sets of up-down controls, with each of these three a bit like the 3 controls for Organise > Column: Generate > Regular Sequence. i) So there are 9 of these up-down in a 3 by 3 layout. On top of them is a set of 3 labels (might be one label actually saying “From By To” j) The label for the first set of 3 is “Planting Dates”. The first up-down has a default of 100 and a lower limit of 1 and an upper limit of 366. The second has a default of 10, lower is 1 and upper could be (say) 50. After this one is a label “days”. The third has the same limits as the first with a default of 110. k) The second has the label “Crop Duration” It has a default of 100 and a minimum of 30 and maximum of 300. It moves in steps of 5. The second has a default of 10. It goes in steps of 5 from 5 to 50 and has a label (“days”). The third has the same limits as the first and a default also of 100 l) The third has the label “Water needs”. It goes from 100 to 2000 in steps of 25, with a default of 500. The second goes from 25 to 200 with a default of 100 and a label after it of “mm”. The third is like the first with a default of 600. m) It might be good to check with Danny whether this is already (or should be) a custom control (i.e. the up-down). I would still like the option to be able to type into one of these as well as accepting to use the control. The one in regular sequence is a regular pain to use!) This set will multiply that pain 3 times! n) The results will go to a new sheet. If we follow what happens with the Organise > Reshape > Column Summaries then the command will choose the name for this sheet. I assume if we do the command twice it will automatically choose different names. There could be the same two checkboxes, namely “Save Results in Data Frame” (default checked) and also “Display Results in Output Window”

p) For now, when this is run make a new data frame and generate three columns, making them factors. The first is named "Planting". With the defaults above it will have 2 levels namely 100 and 110. The column will be of length 4 and will be 100,100,110,110 (i.e. first level followed by 2nd level.
You can stop there for now, because we will need to see what can be put into the crop function and what will need to be written extra.

rdstern commented 7 years ago

Working of the crop method. There are 3 components to the calculation. I illustrate with the first set given above, i.e Planting is day 100 in the year, Duration of the crop is 100 days and the water requirement is 500mm. 1) One part I call W is now to go back to the daily data. Then each year to find the total rainfall from day 100 to 199, i.e. for 100 days. This will give a value for each year. Suppose for the first year it gave 593mm and the second was 452mm. So in year 1, this criterion was OK, in year 2 it was not OK, i.e. it was less than 500mm.

The other two criteria are already in the yearly format, so easier. Suppose in year 1 the start day was day 94, and in year 2 it was day 106. Then year 1 is still OK, Year 2 is not, but it was not OK anyway so that makes little difference.

Now we add the third criterion, where (say) the length was 120 days in year 1 and 110 in year 2. Then Year 1 is OK, Year 2 would have been OK.

In the current running of the function it just gives the result, which here is 0.5, i.e. one year in the 2 years. In general it will run through all years and for all combinations of the 3 criteria. The result is then the proportions. They are presented as a table.

I think we can include this, but do much better in R-Instat. We can also note in which years it failed, and also why it failed in those years when it did. So, I would like the option to add 2 columns in the yearly file for each cell of the table. This will show when it occurred each year. When it failed we have a factor column with 8 levels so we know which of the 3 criteria failed.

rdstern commented 7 years ago

Starting with PICSA. John you may like to start by seeing the sort of analyses we need for PICSA.
PICSA and NMS Services 2.pptx

The attached Powerpoint shows some of the graphs. You will see that the all have the years as the x-axis and something interesting for farmers (from rainfall and temperatures) on the y axis.

Also you may like to learn more about PICSA as a whole, so you see where your dialogues will help. Have a look here https://ccafs.cgiar.org/blog/new-manual-helps-expand-reach-climate-services-together-farmers

There are two particular items. One is a 6-minute video - that's from clicking in the web page on the picture of the two women. Then there is a user guide - a step-by-step run through PICSA.

Now the Met Service staff themselves need to produce the graphs for the rainfall and temperatures. These dialogues are to help them.

rdstern commented 7 years ago

In these dialogues rainfall is the more complicated. Here are my ideas for rainfall. I don't feel it will be easy to combine these dialogues together - they are sufficiently different. So I am at least going to start with 3 separate dialogues. Ideas on the crops are above. This comment is to give ideas on rainfall.

I start with your dialogue on Rainfall. It will be a bit wider, but is a good start. I suggest that there need to be some "Preliminaries" or "Preparation". So I suggest you could replace your "Threshold" checkbox by a big button that leads to a tabbed sub-dialogue.

The main part is "Overall" and includes the Threshold, with a default value set of 0.85. And after the field is a label "mm". It has 4 alternatives, so it is a combo box I think. Those are 0.05, 0.85, 2.45, 4.95. You can type into it and the check is that it is a number > 0.

Then there could be a second overall piece of information. "Year (Season) starts in and ends in . These have defaults of Jan and Dec, and options of the 12 months. If the second has an earlier value (e.g. July) compared with the first (e.g. August), then there is a checkbox which is initially ticked saying "Label years with the month in which the season starts." There can be a tool-tip with the text (So a season from October 1960 to May 1961 will be called "1960". Untick if you prefer to label it with the ending year, i.e. "1961").

Then there are tabs. One is called something like "Totals/Count", (but see below) a second is "Start", a third is "End", a fourth is "Spell" and a fifth could be "Extreme".

On the main dialogue you have check-boxes (as you have now). But some of them are not enabled until the preparatory information has been supplied.

The layout might be in 2 sets of 6 check boxes each, so it isn't one long list.

The first pair could be "Total Rainfall", the second (across) "Number of Rain Days". I think these can be enabled initially. In fact in the information above I am not sure we need the "Totals/Count" tab. The third checkbox could be "First Starting Opportunity", the 4th is "Start (including dry-spell condition)", (that's the second pair of check-boxes.) 5th is "End of rains", 6th is "End of Season", 7th is "Season Length", 8th is "Total and Count in Season", 9th is Longest Dry Spell (Fixed Months), 10th is "Longest dry Spell (in Season). Final row 11 is "Annual/Seasonal Extremes" and 12 is "Extremes above high threshold". Option 11 is also enabled initially.

The plan could be that users could start straight away getting a few results. They could then see how this was going. As they did more preparation, (or preliminaries) other check-boxes would become enabled.

Now there would be two parts to the analyses. The first is to take the daily data and produce the yearly summaries. The second part would be to graph the yearly summaries. Ideally I would like this dialogue to do both. But there is a risk that users will find it too easy to produce rubbish. The alternative is to expect users to use separate dialogues for the graphs. They could be under climatic, or under our current Describe.

What do you think so far? If you are happy with the general ideas, then we could start with the fact that some check-boxes are already enabled.

You could also use Option 9 above to test your system to enable more options.

In the sub-dialogue with the Spells tab, the first field could be:

"Threshold value for dry spell". This is the same control as overall (i.e. threshold for rain) but could be set to be a different value.

Then there is a group with a label "Fixed Months". It has:

Starting Month "pull down with the 12 months - initially blank. After is an up-down for day, with 1 as the minimum and 31 as the maximum. It is initially set to 1. Same for ending month and control for the day. (Usually we won't need the "day" controls, but we will in the general system, so they do no harm here. Once there is a value in the first month and the last month, then the option 9 becomes enabled.

There is quite a lot to go on here.

rdstern commented 7 years ago

The third dialogue is for temperatures. We usually as the NMS to produce just a single graph for the temperatures. So it would be good if the dialogue made the production of that graph really easy. But the simple graph may go wrong, so it could be good to have a sub-dialogue to help the NMS to look in a bit more detail if they wish - or need to.

The single graph has the year (as usual) as the x-axis. It has 2 lines with one for the annual mean of tmax and also the annual mean for tmin. Often we find a straight line fits quite well. In that case (you begin to see a complication!) we can add those lines. Then we can also report on the change in temperatures between the beginning of the record and the end. Perhaps the NMS should be able to test the statistical significance of the result, even though it is just the observed lines that are usually shown to the Extension service as part of PICSA.

So let's start with (at least) the lines we need and also the main graph. Start with your dialouge with Temperature at the top. We need 3 single receivers. The first is "Date", the second is "Maximum Temperatures" and the third is "Minimum Temperatures".

The initial analysis will be to take the mean of each of the daily data columns and then produce a new (or add to the) data frame on an annual basis. Then we plot those. OK needs the date column. It can work with either max or min completed, so is enabled when either is chosen. There is an Options button to go to a sub-dialogue. There is (as you have it) a set of check-boxes. The first is only enabled if both temperature columns are completed. It is initially ticked an is for "Single graph (not Separate Graphs)". If you untick then you get facets with the top graph for TMax and the bottom for TMin and different Y axes for each. A second check box can be to "Add fitted lines". This is initially unticked. If ticked, then for now just fit a straight line using lm and give the results in the output window. A third check-box, currently disabled is to "Add summary report".

You may wish to set up the sub-dialogue now, even if it doesn't yet do anything. Make it larger than the usual very small ones. No tabs at this stage. Could have a label "Missing Value Options". And another with "Add confidence bands to graph."

Roger

Lunalo commented 7 years ago

Hi @rdstern , This url: https://ccafs.cgiar.org/blog/new-manual-helps-expand-reach-climate-services-together-farmers has refused to open the page.

rdstern commented 7 years ago

Odd. It works fine for me. I just tried it now. perhaps you could try again?

dannyparsons commented 7 years ago

I think the original link had a problem. The one John sent works for me.