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

How to load external station data and GCM data #267

Open
EboQuabena opened this issue Aug 2, 2022 · 7 comments
Open

How to load external station data and GCM data #267

EboQuabena opened this issue Aug 2, 2022 · 7 comments

Comments

@EboQuabena
Copy link

I have been trying to use the 'esd' r-package to downscale CMIP5 data to station data in Ghana at latitude = 5.783 and longitude = 0.633 to make a projection. I have a little difficulty loading my external station data and GCM data unto the package.

Can you be of help to me in this regard?

@brasmus
Copy link
Collaborator

brasmus commented Aug 3, 2022

You need to download the CMIP data onto your hard drive - see our wiki-page on this GitHub site for tips link. I suggest you download data for a region that covers 0-10N and 5W-5E so that you get a sufficient representation of the large-scale conditions.

@EboQuabena
Copy link
Author

Is it possible to get a simple script to help me downscale a gcm projection data to that of one station data? I have been trying to do that but to no avail

@brasmus
Copy link
Collaborator

brasmus commented Aug 8, 2022

Yes, but it's not advised to do it that way. It's far better to downscale a group of stations within a small region for a large ensemble of GCMs. One GCM will likely give you misleading results and could result in maladaptation - it's a big risk to do it that way. First ting is to check your GCM data (let's say it stored in R object X) - does map(X)produce any sensible results? Or x <- EOF(X); plot(x)? (here the cases matter and x and X are two different data objects) Then check your station data (let's call it y)- what does plot(y).

@EboQuabena
Copy link
Author

Exactly what I want to do. I’ll be using an ensemble of GCMs (mainly cmip6 projection dataset for ssp245, ssp370 and ssp585.

I wanted to use one GCM and one station to try and get the downscaling working. I’ll then proceed with the ensemble.

Also, the outputs of map(X) , plot (x) and plot (y) give me sensible results.

@brasmus
Copy link
Collaborator

brasmus commented Aug 9, 2022

Very good! So if your station data is the data object y and your GCM data X, then you need to compute the EOFs first x <- EOF(X). Then the simple downscaling exercise is z <- DS(y,x,verbose=TRUE) using the EOFs as predictor. Here I set the argument verbose=TRUE to get more information about the process and an idea about how far the code reaches before there is a problem. A typical problem is if the station and the GCM data have different time scales, e.g. daily and monthly. One way to ensure similar timescales is e.g. using z <- DS(as.seasonal(y),as.seasonal(EOF(X)),verbose=TRUE). Sometimes the objects use different format for time, e.g. date or just year. Then you can fix this by index(y) <- year(y) if you have e.g. annual data or aggregated data for one season. A way to check is to write class(y) and range(index(y)). It's a bit complicated because there are so many different ways to provide data, so sometimes you need to add a couple of extra lines...

@EboQuabena
Copy link
Author

Great! The challenge now is to get the future downscaled data. The results of the downscaling of the GCM end where the station data ends. How do I get it to continue to 2100?

@brasmus
Copy link
Collaborator

brasmus commented Aug 10, 2022

I guess you downscaled using the reanalysis for calibration. To downscale a GCM, then you need to use 'common EOFs' where you combine the reanalysis and the GCM data into a joint data object and compute an EOF for this combined dataset (this is called 'common EOFs'). Then you repeat the downscaling with this common EOF rather than the ordinary EOF representing the reanalysis only. I just added an example on our wikipage. There was a bug in the code which affected the example provided there, so you should get a version 1.10.11 or later.

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