code
stringlengths
3
6.57k
check_units('[pressure]', '[temperature]', '[temperature]')
wet_bulb_temperature(pressure, temperature, dewpoint)
method (and others)
hasattr(pressure, 'shape')
np.atleast_1d(pressure)
np.atleast_1d(temperature)
np.atleast_1d(dewpoint)
lcl(press, temp, dewp)
moist_lapse(concatenate([lcl_pressure, press])
check_units('[pressure]', '[temperature]')
static_stability(pressure, temperature, axis=0)
potential_temperature(pressure, temperature)
first_derivative(np.log(theta.m_as('K')
check_units('[pressure]', '[temperature]', '[dimensionless]')
dewpoint_from_specific_humidity(pressure, temperature, specific_humidity)
check_units('[length]/[time]', '[pressure]', '[temperature]')
vertical_velocity_pressure(w, pressure, temperature, mixing_ratio=0)
left(w = \frac{Dz}{Dt}\right)
left(\omega = \frac{Dp}{Dt}\right)
Density (:math:`\rho`)
pressure (in Pascals / second)
density(pressure, temperature, mixing_ratio)
return (-mpconsts.g * rho * w)
to('Pa/s')
check_units('[pressure]/[time]', '[pressure]', '[temperature]')
vertical_velocity(omega, pressure, temperature, mixing_ratio=0)
left(\omega = \frac{Dp}{Dt}\right)
left(w = \frac{Dz}{Dt}\right)
Density (:math:`\rho`)
height (in meters / second)
density(pressure, temperature, mixing_ratio)
return (omega / (- mpconsts.g * rho)
to('m/s')
check_units('[pressure]', '[temperature]')
specific_humidity_from_dewpoint(pressure, dewpoint)
saturation_mixing_ratio(pressure, dewpoint)
specific_humidity_from_mixing_ratio(mixing_ratio)
check_units('[pressure]', '[temperature]', '[temperature]')
lifted_index(pressure, temperature, parcel_profile)
level(s)
np.where(pressure == 500 * units.hPa)
Tp500.to(units.degC)
check_units('[length]', '[temperature]', '[speed]', '[speed]')
gradient_richardson_number(height, potential_temperature, u, v, axis=0)
gradient (or flux)
left(\partial \theta/\partial z\)
left(\partial u / \partial z\right)
left(\partial v / \partial z\right)
first_derivative(potential_temperature, x=height, axis=axis)
first_derivative(u, x=height, axis=axis)
first_derivative(v, x=height, axis=axis)
return (mpconsts.g / potential_temperature)
main()
KeyBindings()
kb.add("f")
_(event)
print("You pressed `f`.")
kb.add("q")
_(event)
kb.add("x")
_(event)
os.kill(os.getpid()
patch_stdout()
ProgressBar(key_bindings=kb, bottom_toolbar=bottom_toolbar)
pb(range(800)
time.sleep(0.01)
main()
dump_hash(twitter_dump)
hashlib.sha1()
dump.update(twitter_dump)
dump.hexdigest()
file_hash(point_to_file)
hashlib.sha1()
open(point_to_file, "rb")
iter(lambda: f.read(4096)
hash_sha1.update(chunk)
print(hash_sha1.hexdigest()
hash_sha1.hexdigest()
extract_image_blob(posted_image_dest)
open("test.jpg", "wb")
c.execute("SELECT tweeted_image FROM T_Tweets WHERE Tweet_id = " + str(tweet_id)
c.fetchone()
image_file.write(ablob[0])
create_db(table_name)
c.execute("PRAGMA journal_mode = WAL")
conn.commit()
get_all_tweets(screen_name)
tweets (200 is the maximum allowed count)
api.user_timeline(screen_name = screen_name, count=200)
print("Failed to pull tweets from %s" % screen_name)
print("User may be protected/private.")
print("Exiting...")
sys.exit()
print("Failed to pull the tweets due to a Twitter Rate Limit error.")
print("Please wait 15 min and try again...")
sys.exit()
alltweets.extend(new_tweets)
len(new_tweets)
print("getting tweets before %s" % (oldest)
api.user_timeline(screen_name = screen_name,count=200,max_id=oldest)