This file contains 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 numpy as np | |
from scipy.spatial import cKDTree as KDTree | |
import xarray as xr | |
def grid_to_points(grid, points, coord_names): | |
"""Index a gridded dataset with a Pandas DataFrame of station coordinates | |
grid : xr.Dataset or xr.DataArray | |
gridded source data | |
points : pd.Dataframe |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
""" | |
Convert PHC 3.0 data from Levitus ASCII to netCDF | |
Polar science center Hydrographic Climatology (PHC) | |
A Global Ocean Hydrography with a High Quality Arctic Ocean | |
http://psc.apl.washington.edu/nonwp_projects/PHC/Climatology.html | |
Citation: | |
PHC 3.0, updated from: | |
Steele, M., R. Morley, and W. Ermold, PHC: A global |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
#!/bin/bash | |
msls () { | |
rd=$1 | |
ssh_loc=$2 | |
scp_loc=$3 | |
if [ "${ssh_loc}" != "" ] && [ "${scp_loc}" != "" ]; then | |
ssh -q ${ssh_loc} "ssh -q ${scp_loc} ls -l ${rd}" | |
fi |
This file contains 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 re | |
with open('cic.html', 'r') as f: | |
raw = f.read() | |
r = r"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?" | |
add = re.findall(r, raw) | |
unique = sorted(set(add)) |
This file contains 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
class Struct(): | |
"""Create a custom class from a dictionary | |
Usage | |
----- | |
Initialize empty, with a dictionary, and/or | |
with any number of key=value pairs | |
Note | |
---- |
This file contains 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 re | |
def extract_email_addresses(adds): | |
adds = ''.join(adds.split()) | |
adds = re.sub(r'(\"|\,)', ' ', adds) | |
adds = re.split(r'\<(.*?\@.*?)\>', adds) | |
#adds = re.findall(r"^[A-Za-z0-9\.\+_-]+@[A-Za-z0-9\._-]+\.[a-zA-Z]*$", ''.join(adds)) | |
adds = [a for a in adds if '@' in a] | |
return adds |