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
# -*- coding: utf-8 -*- | |
""" | |
:DESCRIPTION:Code for managing soil moisture data | |
:REQUIRES: | |
:TODO:More error handling | |
:AUTHOR: John Franco Saraceno | |
:ORGANIZATION: U.S. Geological Survey, United States Department of Interior | |
:CONTACT: [email protected] | |
:VERSION: 1.0 | |
Fri Jul 29 18:48:40 2016 |
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
%code to batch process and invert binary lisst data | |
f_directory = 'C:\Users\saraceno\Documents\MATLAB\LISST\recachelisstdata'; | |
datafile_ext = '*.dat'; | |
zscfile = 'office_zsc_1145_110712.asc'; | |
fac_zscfile = 'factory_zsc_1145.asc'; | |
ringareafile = 'Ringarea_1145.asc'; | |
instrument_data = 'InstrumentData.txt'; | |
VCC = 4972; | |
type = 3; | |
random_shape = 1; |
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
# -*- coding: utf-8 -*- | |
""" | |
:DESCRIPTION:code to process LISST VC data | |
:REQUIRES: | |
:TODO: | |
:AUTHOR: John Franco Saraceno | |
:ORGANIZATION: U.S. Geological Survey, United States Department of Interior |
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
# -*- coding: utf-8 -*- | |
""" | |
:DESCRIPTION: | |
:REQUIRES: | |
:TODO: | |
:AUTHOR: John Franco Saraceno | |
:ORGANIZATION: U.S. Geological Survey, United States Department of Interior |
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
# List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
# Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
# Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(valuelist)] |
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
#v1.0 - to supply password and login | |
#shamlessly stolen form the web | |
import sys | |
import pexpect | |
user = 'user' | |
password = 'password' | |
host = 'host1.us.com' | |
command = 'hostname ; echo $?' | |
def dossh(user, password, host, command): |
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
# -*- coding: utf-8 -*- | |
""" | |
script to merge water quality and discharge data from two USGS gages for | |
the X2CM project | |
@author: saraceno | |
Created on Wed Jun 14 14:51:19 2017 | |
""" | |
import pandas as pd |
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 urllib.request as request | |
import json | |
import matplotlib.pyplot as plt | |
import matplotlib.colors as colors | |
import matplotlib.cm as cm | |
import numpy as np | |
class BuoySpectraPlotter: | |
def __init__(self, buoy_station): |
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
#include <ESP8266WiFi.h> | |
#include <Wire.h> | |
#include <PubSubClient.h> | |
#include <Adafruit_Sensor.h> | |
#include <Adafruit_BME280.h> | |
#define wifi_ssid "YOUR_WIFI_SSID" | |
#define wifi_password "YOUR_WIFI_PASSWORD" | |
#define mqtt_server "YOUR_MQTT_SERVER_HOST" |
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
# -*- coding: utf-8 -*- | |
""" | |
Webscraping local air quality index forecast from https://sparetheair.com/ | |
@author: saraceno | |
@email: [email protected] | |
@github: onegneissguy | |
code adapted from https://medium.com/python-pandemonium/6-things-to-develop-an-efficient-web-scraper-in-python-1dffa688793c | |
""" |
OlderNewer