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

Bias_Correction #1

Open
pradhancda opened this issue Aug 2, 2020 · 3 comments
Open

Bias_Correction #1

pradhancda opened this issue Aug 2, 2020 · 3 comments

Comments

@pradhancda
Copy link

Sir,

Is it applicable to netcdf ?
To do bias correct within era5 (obs) and rcm (model)......
How to merge all netcdf aa rcm data comes separately ?
can i run directly in python or any virtual environment is required ?

Please clarify..........

regards,
Subhasis

@pankajkarman
Copy link
Owner

pankajkarman commented Aug 11, 2020 via email

@pankajkarman
Copy link
Owner

It is recommended to use a separate python environment for new projects to avoid problems in future. There is no python version related problem with this library, but try to use any python3 version to avoid breaking your codes in future.

@amolvibhuteIITM
Copy link

Dear sir,

I am appplying gamma_mapping to model data. but it is giving following error

FitError: Optimization converged to parameters that are outside the range allowed by the distribution.

my code is

models = ["MMM"] # Add other models if needed
var_names_sec = ["ua"]

for m in models:
for var1 in var_names_sec:
for ldyr in range(1, 2):
ob = xr.open_dataset(var1+'_obs_1960_2012_lead'+str(ldyr)+'.nc')
ob.load()
obs_data = ob.uwnd.sel(level=(200))

        mo = xr.open_dataset(var1+'_'+m+'_1960_2012_lead'+str(ldyr)+'.nc')
        model_data = mo.ua.sel(plev=(200))
        
        time = obs_data.time
        lat = obs_data.lat
        lon = obs_data.lon
        model_data = xr.DataArray(model_data, coords=[obs_data.time, lat, lon], dims=['time', 'lat', 'lon'])
        sce_data = model_data
        ds = xr.Dataset({'model_data':obs_data,'obs_data':model_data, 'sce_data':sce_data}) 
        
        bc = XBiasCorrection(ds['obs_data'], ds['model_data'], ds['sce_data'])
        df3 = bc.correct(method='gamma_mapping')
        df3.to_netcdf(var1+'_'+m+'_1960_2012_lead'+str(ldyr)+'_qmbc.nc')

Please help to resolve the issue.

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

3 participants