-
Notifications
You must be signed in to change notification settings - Fork 66
Add code to plot ocean TF within transect #600
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
base: master
Are you sure you want to change the base?
Add code to plot ocean TF within transect #600
Conversation
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.
Nice work @cshafer! I have two small changes to request.
if options.interp_temp and (len(times) > 1): | ||
print('Cannot plot temperature for more than one time index.' + | ||
' Skipping temperature interpolation and plotting.') | ||
options.interp_temp = False | ||
|
||
if options.interp_thermal_forcing and (len(times) > 1): |
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.
Combine this with if-statement used for temperature above.
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.
Thanks Trevor, I'll fix this!
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.
@cshafer, this is great and runs really fast! I have a few minor changes to request. It looks like a lot, but you can just accept all the changes I made to spacing and lump that into one commit.
thickAx.fill_between(distance, upper_surf_nan, lower_surf_nan, color='xkcd:ice blue') | ||
thickAx.fill_between(distance, bed_transect, thickAx.get_ylim()[0], color='xkcd:greyish brown') | ||
thickAx.grid(False) | ||
thickAx.set_ylim([None, 750]) |
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.
The axis limits should not be hard-coded.
thickAx.fill_between(distance, upper_surf_nan, lower_surf_nan, color='xkcd:ice blue') | ||
thickAx.fill_between(distance, bed_transect, thickAx.get_ylim()[0], color='xkcd:greyish brown') |
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.
These should be applied generally, not just for the thermal forcing case. However, the ice color will need to be skipped if options.temperature
.
y = np.array([float(i) for i in options.y_coords.split(',')]) | ||
|
||
# Determine bounding box using max and min of user-provided coordinates | ||
pad = 5000 |
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.
We might want to make the padding size a function of dcEdge
. @matthewhoffman , what do you think?
Co-authored-by: Trevor Hillebrand <[email protected]>
This pull request updates the existing
plot_transect.py
script to add the option of plotting ocean thermal forcing along an ice-shelf transect.The code plots the extrapolated
TFocean
field for a single time index along a user defined transect. Invalid (1.0e36
) TF values are set tonp.nan
before interpolation happens for each ocean layer. Ice and bedrock are filled in with solid colors if--thermal_forcing
option is set.