Hello,
I'm runnning a two-way nesting simulation in a region located over Panama.
Since wrfout files aren't in the commen CF_compilant netcdf format, I modified the output files using pandas library to set XLAT and XLONG as indexes and extract RAINC+RAINNC variable and merge time. Something goes wrong with domain 1 as the final file has missing information in the region where the domain 2 is set as shown in fig1 (zommed in fig2). The code I'm using is (just an example with the extraction of T2):
The pandas dataframe has the wright dimensions (100x160x73), but when checking for different values of latitude and longitude (len(list(dict.fromkeys(list(df.Latitude))) a 118 pomps out instead of 100. The final netcdf file has a dimension of 118x178x73 pixels which cause plots to have white points. Where do these extra pixels come from?
I assume it's related to the relation of lat-lon values between the two domains, as the same code works fine when merging only domain 2 files or merging domain 1 files that result from a 1 domain simulation (for example first step of ndown).
Thanks in advance,
Jana.
I'm runnning a two-way nesting simulation in a region located over Panama.
Since wrfout files aren't in the commen CF_compilant netcdf format, I modified the output files using pandas library to set XLAT and XLONG as indexes and extract RAINC+RAINNC variable and merge time. Something goes wrong with domain 1 as the final file has missing information in the region where the domain 2 is set as shown in fig1 (zommed in fig2). The code I'm using is (just an example with the extraction of T2):
Code:
for i in range(len(wrfouts)):
ds=xr.open_dataset(wrfouts[i])
df_tq = ds['T2'].to_dataframe()
df_tq = df_tq.reset_index()
df_tq = df_tq.drop(['Time','south_north','west_east'],1)
df_tq = df_tq.drop_duplicates()
df_tq = df_tq.rename(columns={"XLAT":"lat","XLONG":"lon", "XTIME":"time", "T2":"t"})
dfs.append(df_tq)
big_frame = pd.concat(dfs, ignore_index=True)
big_frame_multi = big_frame.set_index(['lat','lon','time'])
dataset=big_frame_multi.to_xarray()
I assume it's related to the relation of lat-lon values between the two domains, as the same code works fine when merging only domain 2 files or merging domain 1 files that result from a 1 domain simulation (for example first step of ndown).
Thanks in advance,
Jana.