Skip to content

Fix array dimensions#141

Merged
mgrover1 merged 3 commits intoProjectPythia:mainfrom
brian-rose:fix-transpose
Mar 26, 2025
Merged

Fix array dimensions#141
mgrover1 merged 3 commits intoProjectPythia:mainfrom
brian-rose:fix-transpose

Conversation

@brian-rose
Copy link
Member

This PR is an attempt to get the builds working again for this Cookbook. It's currently failing in the Fast Barnes notebook with

Cell In[7], line 63, in grid_rhi(file, z_res, rng_res, z_limits, rng_limits, fields)
     60     data = deepcopy(np.array(radar.fields[fields[j]]['data']))
     61     # data = data.filled(np.nan)
---> 63     res_field[:,:,j] = barnes(np.asarray([rg_loc.ravel(),radar.gate_altitude['data'].ravel()]).transpose(),
     64                        data.ravel(),
     65                        100,
     66                        np.asarray([0,0]),
     67                        100,
     68                        (len(z_pts),len(rng_pts)),
     69                        method=method,
     70                        num_iter = num_iter,
     71                        min_weight=0.0002
     72                       )
     75 data_dict = {}
     76 for k in range(len(fields)):

ValueError: could not broadcast input array from shape (1100,151) into shape (151,1100)

My guess is that just removing the .transpose() in line 63 will make the problem go away. I don't have access to the data to test locally, but we'll see if it passes here.

@github-actions
Copy link

github-actions bot commented Jan 9, 2025

👋 Thanks for opening this PR! The Cookbook will be automatically built with GitHub Actions. To see the status of your deployment, click below.
🔍 Git commit SHA: b4b3000
✅ Deployment Preview URL: https://ProjectPythia.github.io/radar-cookbook/_preview/141

@mgrover1 mgrover1 marked this pull request as ready for review March 26, 2025 17:52
@mgrover1 mgrover1 merged commit 5da3efc into ProjectPythia:main Mar 26, 2025
2 checks passed
@brian-rose brian-rose deleted the fix-transpose branch March 26, 2025 19:12
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

Successfully merging this pull request may close these issues.

2 participants