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

NetCDF input/output? #1

Open
monocongo opened this issue Mar 11, 2019 · 5 comments
Open

NetCDF input/output? #1

monocongo opened this issue Mar 11, 2019 · 5 comments

Comments

@monocongo
Copy link

I would like to compare the results of this code with a Python implementation of scPDSI in order to validate results and determine if there are areas of possible improvement. It would be easiest for me to do this if I can use the same input files and then make a comparison of the outputs. The input format for the Python code is NetCDF. Is it possible to use NetCDF as input into this R code? I'm not adept with R so please forgive the rookie question -- hopefully, this is more straight-forward than I assume. Thanks in advance for any assistance.

@kongdd
Copy link

kongdd commented Aug 22, 2019

Hi @monocongo,

I have checked the output of this version scPDSI at here, which is exactly the same as the original cpp version (scPDSI2003) at both of monthly and weekly scale by using the example data in scPDSI2003.

By the way, you need to comment this line to make them same, https://github.com/kongdd/scPDSI/blob/master/src/pdsi_ext.cpp#L237.

@monocongo
Copy link
Author

Thanks, @kongdd.

I apologize, I don't understand the gist of your comments. Are you essentially saying that the R implementation of scPDSI contained within this repository matches the results of the C++ version by Wells/Goddard/Hayes? If so then how is that relevant to this issue, i.e. comparing the results of the Python implementation of scPDSI against those produced by this package?

My intention is to use the same precipitation, temperature, and AWC inputs for the two implementations and then compare results in order to see 1) how much if any differences there are in the results of the two implementations, and 2) if there are discrepancies between the two then to determine which, if either, is closer to accurately modeling actual drought conditions.

When you say I need to comment a line to make them the same, what does this mean? The line referenced appears to call a Calibrate() method three times. How is that relevant to this issue?

@kongdd
Copy link

kongdd commented Aug 22, 2019

Sorry. I can't solve your issue.

  1. Without clear benchmark, it is hard to say which version is better. I think what we can do is just close to the original version written by the author.
    If you need to make some improvement, you might need to illustrate its merits in a scientific paper.
  2. In the original cpp version, it just Calibrate once.
    https://github.com/kongdd/scPDSI/blob/master/inst/scPDSI2003/bin/scpdsi.cpp#L1381

@monocongo
Copy link
Author

In order to make a comparison, we can use the same input for both codes and then compare the results of the two packages. If one shows a better correspondence to actual drought events then we can consider that to be a better model/index, no? My initial question is regarding how can I use NetCDF as input to this code in order to perform this kind of comparison. The documentation for this package is not sufficient to make this determination, which is why I've asked for guidance as to how to use NetCDF as input to this package, so I can use it to compute scPDSI and then compare the results against those of my Python package.

@kongdd
Copy link

kongdd commented Aug 22, 2019

Ha ha, we need to push @Sibada to write more document.

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