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

CLIMPACT2 and R-Instat for WMO work #8634

Closed
rdstern opened this issue Nov 6, 2023 · 3 comments · Fixed by #8708
Closed

CLIMPACT2 and R-Instat for WMO work #8634

rdstern opened this issue Nov 6, 2023 · 3 comments · Fixed by #8708

Comments

@rdstern
Copy link
Collaborator

rdstern commented Nov 6, 2023

@jkmusyoka Climpact2 is quite large, but not so recent. It includes a gui for the analysis of individual stations and a batch process for the analysis of multiple stations.

It also processes netcdf files, but only on UNIX machines - I am not quite sure why. We were asked whether we could add Climpact2 to R-Instat.

I was hoping we could simply add the routines as script files. But I am now wondering whether we, instead explain why we are not doing this and ask for reviewers to check that we are correct in arguing that we have largely covered the facilities in CLIMPACT2 in R-Instat.

a) They include the QC for rainfall and temperatures from the same software we have used. I suggest we have effectively a good implementation of those facilities.
b) In that context I suggest one tiny change in our QC dialogs. We have a check we call Days in the Temperaure QC and Same in the Rainfall QC. I suggest we call it Flatline in each dialog to tie with the teminolgy used in Climpact2 and elsewhere.
c) They also refer to climdex_pcic that is well implemented in R-Instat. And it is implemented for multiple stations so that's covered.
d) Climpact2 discusses Sector-specific indices. We should understand what they are and perhaps add them to R-Instat. Initially we should identify them.
e) It discusses the calculation of SPI and SPEI. That is already in R-Instat. However, that package has been extensively improved in 2023. So I suggest we should include these improvements in R-Instat. (We should interpret this as part of our implementation of Climpact2.)
f) It has a lot on netcdf files. We should find what that is? It supplies sample data and that reads easily into R-Instat. I'm not sure, as mentioned above, what it does with those data, and why it claims that these facilities are only on unix machines? It may be because of memory requirements. We should check what is done in Climpact2 with their netcdf files and see whether this is possible already with the current facilities in R-Instat.
g) We should also look carefully to see what is in Climpact2 in addition to qc, Indices, and SPEI. We should also check the graphical displays, to see if we can do them already in R-Instat.
h) There is a user guide. I have not gone through it carefully enough. It may answer some of the questions above.

@rdstern rdstern added this to the 0.7.19 - mid December milestone Nov 6, 2023
@rdstern
Copy link
Collaborator Author

rdstern commented Nov 23, 2023

@jkmusyoka I now suggest we do the above, but in a really positive way. There were requests for climpact2. If we do nothing, then those users need to use RStudio for it.
We now claim that anything the runs in RStudio should run in R-Instat. So, let's try and see if a climpact2 user can use those scripts at least as easily in R-Instat as they can in RStudio?

@jkmusyoka
Copy link
Contributor

@N-thony it may be easier to start with a dialogue in R-Instat that exports station data in a format which is ready for Climpact2.

The specifications for Climpacts's input data file are as follows:-

  • An ASCII text file
  • Columns as following sequences: Year, Month, Day, PR, TX, TN (NOTE: PR units = millimeters and Temperature units = degrees Celsius). We have the R code for producing Year, Month and Day columns given date columns i.e. look into Climatic -> Dates -> Use date backend R code.
  • The format as described above must be space delimited (e.g. each element separated by one or more spaces).
  • For data records, missing data must be coded as -99.9; data records must be in calendar date order. Missing dates are allowed. We also have R code for infilling missing dates i.e. Climatic -> Dates -> Fill Date Gaps
  • Decimal places must be denoted by the period character, not a comma (i.e. "." not ",")

A screenshot of how the data should look like is shown below

image

Over to you. Let me know what you need.

@N-thony
Copy link
Collaborator

N-thony commented Dec 20, 2023

@jkmusyoka sounds good, as we have most of the dialogues for exporting and examples of as provided above, I think this is a good task for @derekagorhom. But I think we will need a R function to output data in the format for the Climpact software as we have done with CPT. Once we have the function, it will be easy to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants