Stream: python-questions

Topic: PFT to sparse conversion


view this post on Zulip Montasir Maruf (Feb 09 2023 at 18:32):

I am trying to convert 2D variables to 3D. I have attached my data details here. //convert_pft_variables_to_sparse(data, pftnames)// in this function which argument should I used instead of pdfnames? I have also attached the error message Capture.JPG error.JPG

view this post on Zulip Katie Dagon (Feb 10 2023 at 20:15):

Hi @Montasir Maruf, I was just discussing this issue with @Stephen Yeager who is looking at some CLM4 output that is indexed by the lndgrid dimension. It looks like you are using code from the sparse-PFT-gridding notebook which works when you have CLM output indexed by pft. Unfortunately it won't work in this case with the indexing by lndgrid. It also looks like your data is indexed by ncol in which case it would be quite analogous to working with CAM-SE output.

@Stephen Yeager came up with a workaround similar to how remapping is done for CAM-SE output that I believe he already shared with you, but I'll post here so everyone else can see the solution: /glade/u/home/yeager/analysis/python/toshare/CLM_field_regrid.ipynb

view this post on Zulip Montasir Maruf (Feb 13 2023 at 16:31):

Hi @Katie Dagon thank you for sharing the script!


Last updated: May 16 2025 at 17:14 UTC