IDEMSInternational / R-Instat

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

Two issues with Climatic > Prepare > Climdex #5367

Open rdstern opened 5 years ago

rdstern commented 5 years ago

There is one big issue that the climdex dialogue does not include the Station field. It is currently designed for just a single station. I am curious to know what size of job it is to extend the code for multiple stations? I assume that is a @dannyparsons question.

There are 2 smaller issues so far. I am testing with Dodoma that is just a single station and Ghana, where there are 2 stations. I am using the library data for both. Initially I am using annual indices and just the rainfall ones. In the rainfall tab I ticked everything, so I produce 12 columns The two problems I found are are as follows: 1) When I use the indices and it makes a new data frame (as opposed to adding to an exiting annual one) it makes the year column into a factor. I need the year as numeric for plotting. It is the linking column, so not trivial to change it. So, could it please leave the Year column as the same type as in the annual data - usually numeric. 2) For the Ghana data it insists on making a new data frame for the annual summaries. This is even though I have either filtered to a single station, (I tried with Saltpond) or have made a subset - which I did with Tamale. This may be a more general issue, that the new data frame is called Ghana by station_year (or Tamale_by_Station_Year), even though there is a single station. The climdex dialogue doesn't have a Station field, so the result is a data frame which is just Tamale_by_Station.

This result means that Dodoma is nice and does exactly what I would like. I can get other summaries and then the summaries from climdex add to the existing data frame. (And as climdex isn't writing the year column it isn't a factor there. For Ghana this doesn't happen.

a) My suggested (temporary) solution is to add a Station field to the dialogue which is visible, but disabled. This would be blank for Dodoma, but completed for the Ghana examples - even when the Station has just a single level.

b) Also leave the year column, i.e. don't have it automatically as a factor, when making a new data frame.

c) And if you agree with these steps, then (in preparation) could a Station field also be added - in the same way - to the SPI dialogue. I will be coming to that one next!

rdstern commented 5 years ago

There are now some more (small) issues, as I look at the dialogue in more detail.

There is a website here giving names for each index. I suggest we change our resulting variable names into those. They are also pleasantly shorter than the ones we have.
Here they are: image

The text for the rainfall indices is also slightly incorrect. As is their label. It should be >= and not just >. I suggest we could include the symbol in at least one place. This affects numbers 20, 21 and 22 in the dialogue (rainfall tab). I suggest replacing "exceeding" by >= or preferably ≥. Also change the tooltip to put this into words. (The later indices 25 and 26 are correctly "exceeding". Don't change those.)

Ivanluv commented 5 years ago

@rdstern I think this suggestion on changing the names on the rainfall tab is great. @maxwellfundi @dannyparsons what are you thoughts on this?Can I change them?

There are now some more (small) issues, as I look at the dialogue in more detail. These are on the rainfall tab. There is a website here giving names for each index. I suggest we change our names into those. They are also pleasantly shorter than the ones we have. Here they are: image

The text for the rainfall ones is also slightly incorrect. As is ther label. It should be >= and not just >. I suggest we could include the symbol in at least one place. This affects numbers 20, 21 and 22 in the dialogue (rainfall tab). I suggest replacing exceeding by >= or preferably ≥. The tooltip is changed to put this into words. (The later indices 25 and 26 are correctly "exceeding". They don't change.)

dannyparsons commented 5 years ago

I don't think these very short names are useful unless the longer name is also easily available. Unless you're already familiar with these codes you will need more information. On the dialog we're using checkboxes so there's space for text. I like the "medium" length names i.e. "Number of frost days" we could have "FD (Number of frost days)" or "Number of frost days (FD)" Then the "long" description could be on the tooltip.

I don't particularly like the layout we currently have, and the website looks better, but I don't have a clear idea of changing the layout drastically. If someone has an idea that would be great.

Also, a small point, the buttons at the bottom of the sub dialog have a display issue.

dannyparsons commented 5 years ago

Most of the issues with this come from being tied to functions in the climdex package, for some of these like using station, I don't see an easy way of solving without a rewrite.

I would not be in favour of adding a station receiver to the dialogs yet, especially if it will autofill the station, because its not doing anything with it yet, and a user might think they can do something to enable it. It could be there but invisible.

rdstern commented 5 years ago

I did not make my point above clearly enough, causing @dannyparsons to misunderstand one of the changes I would like.

a) In the dialogue there would be very minor changes only. We keep the text, just change "exceeding" to ≥ in indices 20, 21, 22. (And change the corresponding tooltip.) Also perhaps include the abbreviation with the number, e.g. Monthly/Yearly maximum one-day precipitation [17] becomes Monthly/Yearly maximum one-day precipitation [17: Rx1day]

b) The bigger change I would like is in the resulting variable name in the data frame. Currently it is called Max_1Day_Rain, which is long and more like a label for the variable. I suggest the variable name Rx1day instead. I am quite happy if the existing name remains and becomes the variable label.

dannyparsons commented 5 years ago

Ok thanks. I like the addition of the short names in a) and these could also be the column names as suggested in b) (in lower case though to keep with naming conventions). I think we should also be able to add the long name as the label too.

Ivanluv commented 4 years ago

I did not make my point above clearly enough, causing @dannyparsons to misunderstand one of the changes I would like.

a) In the dialogue there would be very minor changes only. We keep the text, just change "exceeding" to ≥ in indices 20, 21, 22. (And change the corresponding tooltip.) Also perhaps include the abbreviation with the number, e.g. Monthly/Yearly maximum one-day precipitation [17] becomes Monthly/Yearly maximum one-day precipitation [17: Rx1day]

b) The bigger change I would like is in the resulting variable name in the data frame. Currently it is called Max_1Day_Rain, which is long and more like a label for the variable. I suggest the variable name Rx1day instead. I am quite happy if the existing name remains and becomes the variable label.

Should I include the abbreviations to the rainfall indices only or to the temperature indices too?

shadrackkibet commented 4 years ago

Also, we should allow the user to use Temperature indices/Precipitation indices independently. Currently Ok is not enabled not unless the user has Both Temperature and Precipitation variables. I think in both cases we should also enable/disable indices tabs depending on whether the receivers are infilled.

rdstern commented 3 years ago

@dannyparsons can this be closed now?