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
""" | |
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 |
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
#!/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 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 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 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
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 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 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 |
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/env python | |
""" | |
This script can be executed as is or via an alias, e.g. | |
alias nclookipy='ipython -i ~/path/to/nclook.py' | |
to quickly open a NetCDF file in Python. | |
""" | |
import netCDF4 | |
import argparse |