Skip to content

Add script to plot spatial distribution of subglacial discharge and ice shelf melt#581

Open
alexolinhager wants to merge 2 commits intoMPAS-Dev:masterfrom
alexolinhager:alexolinhager/landice/plot_qsg_shelf_melt
Open

Add script to plot spatial distribution of subglacial discharge and ice shelf melt#581
alexolinhager wants to merge 2 commits intoMPAS-Dev:masterfrom
alexolinhager:alexolinhager/landice/plot_qsg_shelf_melt

Conversation

@alexolinhager
Copy link
Contributor

Add script to plot spatial distribution of subglacial discharge and ice shelf melt around Antarctica. Script at this point is not complete and is a work in progress.

Add script to plot spatial distribution of subglacial discharge and ice
shelf melt around Antarctica. Script at this point is not complete.
@matthewhoffman matthewhoffman changed the title plot_qsg_shelf_melt Add script to plot spatial distribution of subglacial discharge and ice shelf melt Feb 27, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new (work-in-progress) post-processing script under landice/output_processing_li/ intended to visualize the spatial distribution of MPAS-Ocean land-ice freshwater flux (ice-shelf melt / discharge proxy) around Antarctica by projecting mesh cells into polar stereographic coordinates, gridding the data, and plotting a map.

Changes:

  • Add plot_qsg_shelf_melt.py to read MPAS-Ocean mesh/output via xarray and extract Antarctic cells.
  • Project lon/lat to a polar stereographic coordinate system and subset by named regions.
  • Bin/average values onto a regular grid and plot with matplotlib.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +31 to +34
ind = np.where(latCellDeg <= -65)
latCellAnt = latCellDeg[ind]
lonCellAnt = lonCellDeg[ind]
meltAnt = melt[0,ind]
Comment on lines +74 to +86
ind = np.array(np.where((xCellAnt >= np.min(xlimit)) & (xCellAnt <= np.max(xlimit)) & (yCellAnt >= np.min(ylimit)) & (yCellAnt <= np.max(ylimit))))
#set up grid to interpolate onto - better for visualization purposes
res = 15*1000 #15 km grid resolution
Xvec = np.arange(np.min(xCellAnt[ind]), np.max(xCellAnt[ind]) + res, res)
Yvec = np.arange(np.min(yCellAnt[ind]), np.max(yCellAnt[ind]) + res, res)

Xgrd, Ygrd = np.meshgrid(Xvec,Yvec)
Xgrd = np.transpose(Xgrd)
Ygrd = np.transpose(Ygrd)

xp = np.array(xCellAnt[ind])
yp = np.array(yCellAnt[ind])

Comment on lines +92 to +97
for i in range(len(Xvec)-1):
for ii in range(len(Yvec)-1):
ind = np.array(np.where((xp >= Xvec[i]) & (xp <= Xvec[i+1]) & (yp >= Yvec[ii]) & (yp <= Yvec[ii+1])))
if ind.size != 0:
Mgrd[i,ii] = np.mean(values[0,ind])
else:
Comment on lines +91 to +96
#bin average onto grid
for i in range(len(Xvec)-1):
for ii in range(len(Yvec)-1):
ind = np.array(np.where((xp >= Xvec[i]) & (xp <= Xvec[i+1]) & (yp >= Yvec[ii]) & (yp <= Yvec[ii+1])))
if ind.size != 0:
Mgrd[i,ii] = np.mean(values[0,ind])
Minor cleanup and ease of life improvements from 
copilot code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants