This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def label_global_map(fig, ax, xticks, yticks, xoff=-10, yoff=-10, degree=False, **text_kw): | |
| """Label gridlines of a global cartopy map.""" | |
| geodetic_trans = ccrs.Geodetic() | |
| xlab_kw = ylab_kw = dict(va="center", ha="center", **text_kw) | |
| for xtick in xticks: | |
| s = format_lonlat(xtick, "lon", degree=degree) | |
| text_transform = offset_copy( | |
| geodetic_trans._as_mpl_transform(ax), fig=fig, units="points", x=0, y=yoff | |
| ) | |
| ax.text(xtick, -90, s, transform=text_transform, **xlab_kw) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def roll_cube_e2w(cube_in, inplace=False): | |
| """Takes a cube which goes longitude 0-360 back to -180-180.""" | |
| if inplace: | |
| cube = cube_in | |
| else: | |
| cube = cube_in.copy() | |
| lon = cube.coord('longitude') | |
| if (lon.points >= 0.).all(): | |
| if (lon.points <= 360.).all(): | |
| subtract = -180. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| url = 'http://svo2.cab.inta-csic.es/theory/newov/ssap.php?model=bt-settl&fid=752&format=ascii' | |
| df = pd.read_csv(url, skiprows=9, names=['wavelength', 'flux'], sep='\t', index_col=False, | |
| skipfooter=1, engine='python', dtype={'wavelength': float, 'flux': float}) | |
| df['wavelength'] *= 1e-4 | |
| fig, ax = plt.subplots() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ | |
| Synchronize an Overleaf LaTeX paper with a Github repository | |
| """ | |
| import argparse | |
| import sys | |
| import subprocess as sb | |
| from path import Path # non-standard path.py package |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Meteorological constants as iris cubes | |
| Taken from metpy.constants submodule | |
| """ | |
| import iris | |
| import metpy.constants as metconst | |
| import metpy.units as metunits |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.