Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Problem processing PFT-level output

James King

James King
Member
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
 

kdagon

Katie Dagon
New Member
Hi James,

I saw your post regarding this issue in the Zulip forum, and will respond there. Anyone looking to join this discussion on Zulip can follow the instructions below (see also the Earth System Data Science communication website):

Zulip is a Slack-alternative that we at NCAR/UCAR use for asynchronous conversations on many topics, including Python questions. Channels include “ESDS”, “dask”, “python-questions”, “python-dev”, “jupyterlab-hub” and more. Join the NCAR-UCAR Zulip here (link does not expire).
 
Top