Hi all,
I've been working with some PFT-level data from CLM5 (e.g. NPP for each PFT) and have been using Python code from the NCAR-ESDS documentation to do the processing (Sparse arrays and the CESM land model component — NCAR-ESDS 0.1 documentation). This worked great until this week and I am now running into strange errors I'm not sure I understand. Following the example code, I convert the PFT output to a sparse matrix, then to an Xarray DataSet called sparse_data1. The following line:
data1 = sparse_data1.PSNSUN.isel(vegtype=14).groupby("time.year").mean().sel(year=2015)
does what you would expect. However, I'm trying to do time series analysis, and this line:
data1 = sparse_data3.PSNSUN.isel(vegtype=14).groupby("time.year").mean()
returns an error when I try to extract the output or do any operations on it.
print (data1.values)
ValueError: This operation requires consistent fill-values, but argument 1 had a fill value of 7.0, which is different from a fill_value of 5.0 in the first argument.
Attempting to slice the years using sel(year=slice(2015,2100)) has the same issue. I'm unable to convert the output into a numpy array, and viewing its properties suggests there is a text description of the data where the actual values should be. This code all worked fine last week so it's probably something to do with updates to the various Python packages involved, but I wondered if anyone else working with PFT-level output has encountered this problem or found a solution?
Cheers,
James
I've been working with some PFT-level data from CLM5 (e.g. NPP for each PFT) and have been using Python code from the NCAR-ESDS documentation to do the processing (Sparse arrays and the CESM land model component — NCAR-ESDS 0.1 documentation). This worked great until this week and I am now running into strange errors I'm not sure I understand. Following the example code, I convert the PFT output to a sparse matrix, then to an Xarray DataSet called sparse_data1. The following line:
data1 = sparse_data1.PSNSUN.isel(vegtype=14).groupby("time.year").mean().sel(year=2015)
does what you would expect. However, I'm trying to do time series analysis, and this line:
data1 = sparse_data3.PSNSUN.isel(vegtype=14).groupby("time.year").mean()
returns an error when I try to extract the output or do any operations on it.
print (data1.values)
ValueError: This operation requires consistent fill-values, but argument 1 had a fill value of 7.0, which is different from a fill_value of 5.0 in the first argument.
Attempting to slice the years using sel(year=slice(2015,2100)) has the same issue. I'm unable to convert the output into a numpy array, and viewing its properties suggests there is a text description of the data where the actual values should be. This code all worked fine last week so it's probably something to do with updates to the various Python packages involved, but I wondered if anyone else working with PFT-level output has encountered this problem or found a solution?
Cheers,
James