ahernanzl / pyClim-SDM

Statistical Downscaling for Climate Change Projections with a Graphical User Interface
30 stars 15 forks source link

How WG treats missing hres data #42

Closed leiapauline closed 7 months ago

leiapauline commented 7 months ago

Hello,

When I use the WG-NMM method to downscale precipitation, I noticed that when loading the hres data and and saving it as an npy file, the missing data which are initially -999 become 42949672.95. This messes up with the resulting ECDFs and I would like some guidance how I can properly handle missing data.

For illustration, below is the actual CDF of the observed station data. image But when it is processed through the WG_lib and saved as obs_0.npy, this occurs. image This results to very weird downscaled values for precipitation.

Any guidance will be much appreciated. Thank you very much for your time.

Sincerely, Leia Pauline

ahernanzl commented 7 months ago

Hi, Missing data are coded with special values in the npy files, but when downscaling they are handled properly. Please verify that no weird values are found at the final downscaled files

leiapauline commented 7 months ago

Hello,

This is understood. After downscaling, I plotted the values from the resulting netcdf files. And there are some weird values especially from using QDM and WG-NMM, which from what I understand are dependent on the CDF of the observed data. Below is a time series plot of the results. The gray line shows the station data for the testing period. image

Thanks for your time.

Sincerely, Leia Pauline

ahernanzl commented 7 months ago

Hi, could you share your input data? The files corresponding to precipitation of the reanalysis and hres folders, please. And you can restrict your observations to this particular station if you want and know how to do it. And the same goes for the reanalysis, you can cut the area to the surroundings of the station

leiapauline commented 7 months ago

Hello,

I have uploaded the files here: https://drive.google.com/drive/folders/1klbtQrWZYZCIGV3WID9FQ5OuLWBo4Igc?usp=sharing It has the folders for hres and reanalysis. I am trying to downscale precipitation with r1000, r850, and kx as predictors. I set the calibration period from 1986-2005, with the testing period from 2001-2005. Thanks for your help.

Sincerely, Leia Pauline

ahernanzl commented 7 months ago

Dear user, A bug at QDM has been corrected, please get the new version of the software. For WG-HMM nevertheless, results show no high values on the test we have run with your files

leiapauline commented 7 months ago

Dear Sir,

Thank you so much for looking into it. The results for QDM no longer has high values. But the WG-NMM results still show high values. Sharing with you the results. image

I tried to run the software with only one station instead of my current 20 stations but I encountered this error. Traceback (most recent call last): File "/home/ltonga/pyClim-SDM-master/src/gui_mode.py", line 36, in <module> from imports import * File "/home/ltonga/pyClim-SDM-master/src/../config/imports.py", line 78, in <module> import ANA_lib File "/home/ltonga/pyClim-SDM-master/src/../lib/ANA_lib.py", line 5, in <module> from advanced_settings import * File "/home/ltonga/pyClim-SDM-master/src/../config/advanced_settings.py", line 717, in <module> hres_lats.update({targetVar: aux_hres_metadata[:, 2].astype(float)}) ~~~~~~~~~~~~~~~~~^^^^^^ IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Sorry for the inconvenience. And thank you very much for your time.

Sincerely, Leia Pauline

ahernanzl commented 7 months ago

You are right, I found and corrected the error at WG, try it now, sorry. The problem to downscale only one station has not been solved yet

leiapauline commented 7 months ago

Dear Sir, Thank you so much. The extremely high values are resolved. Sincerely, Leia Pauline