-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add plotting script for thermal forcing and surface mass balance #566
base: master
Are you sure you want to change the base?
Conversation
Plot ISMIP6 thermal forcing time series for Amery/Lambert UQ paper.
Add option to plot SMB across a region or the entire domain.
Update linestyles based on ESM, save a pdf version, use lowercase axis labels, etc.
Support plotting average over depth range, for example using '-d -200,-500' in the command.
Add option to plot over whole shelf depth range, using the --shelf_range flag. This may not be very accurate because it will sample deep temperatures far from the grounding line, where they are unlikely to ever be felt by the ice shelf during a simulation, but it is much faster than interpolating to a specific depth or to the ice-shelf base or seafloor.
Example plot, created using the following command:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trhille , thanks for making a PR to capture this script. I have some cleanup suggestions and a couple questions about the functionality.
# Assume this is floating ice | ||
depth = -1. * rhoi / rhosw * thk[0, nearest_cell] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to do this? Because TF is defined everywhere, it would be easy to inadvertently include values inside grounded ice. Maybe that's desired, though generally probably not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this only plots TF at user-specified locations and the concept of the shelf base is meaningless for grounded ice, I don't think this is a problem. But I could add an assertion that depth >= bed.
parser.add_option('-c', dest='coords_file', default=None, | ||
help='CSV file containing x in first column, y in second. No header.') | ||
parser.add_option('-x', dest='x_coords', default=None, | ||
help='List of x coordinates of transect if not \ | ||
using a csv file. Comma-separated, no spaces.') | ||
parser.add_option('-y', dest='y_coords', default=None, | ||
help='List of y coordinates of transect if not \ | ||
using a csv file. Comma-separated, no spaces.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand of the code below, it looks like it is necessary to specify x,y locations in one of these two ways. Is that right? Is there not a way to just use all data in a region, say? I'm not asking for you to generalize that behavior if it doesn't already exist, but clarify, probably in the main doc strings, how this works. Also that all the depth options apply over just the horizontal locations as defined by these options, i.e. plot_shelf_base_thermal_forcing is not the entire shelf base but the shelf base at the x,y locations determined by these horizontal options. (if I follow correctly)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's not currently a way to use all data in a region, but that would be good to add. I'll update the doc strings.
parser.add_option('-n', dest='region_number', default=None, | ||
help='Region number to plot. If None, use entire domain.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the region only applies to the SMB plot - is that intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. I do want to generalize it, but it wasn't necessary for the Lambert paper figure (although it might have made things easier if I had started with that). I can add a comment for the region is just SMB for now.
Co-authored-by: Matt Hoffman <[email protected]>
This merge adds a script that plots thermal forcing and surface mass balance time series. Currently the thermal forcing-related fields are hard-coded to ISMIP6 variable names, but that could be changed in the future. The user must specify files from which to plot thermal forcing and SMB; a mesh file containing coordinates, ice geometry, etc; and optionally a regions file that contains the
regionCellMasks
field.There are many (maybe too many) user-defined options for plotting:
-d
argument, (ii) to interpolate the thermal forcing field to the seafloor (--seafloor
), ice-shelf base (--shelf_base
), or (iii) average over the full ice-shelf depth range (--shelf_range
).-c
flag, or to specify coordinates in the command using-x
and-y
as comma-separated lists.--start_time
and--end_time
.--n_samples
. This is just for prototyping, and the random samples are not currently reproducible.--average
flag. If this flag is not set, a separate time series will be plotted for every cell, which will get messy when plotting more than a few cells. Note that averaging is not currently weighted by cell area.--save
flag.-n
flag, which corresponds to the region number inregionCellMasks
.