I love to share what I've learnt with others. Check out my blog posts and notes about my
academic research, as well as technical solutions on software engineering and data
science challenges. Opinions expressed in this blog are solely my own.
I have updated my python library hn2016_falwa to
v0.2.0 (see release note! Now
it includes functions to compute the contribution of non-conservative forces to wave activity.
Moreover, the documentation page generated
with Sphinx is now hosted on readthedocs.org! Check it out!
A side note: somehow I made multiple commits to remedy mistake. The git commands to squash
the (3, for example) commits are:
git rebase -i origin/master~3 master
git push origin +master
(Ideally, I shall run tensorflow somewhere else rather than on my MacBook.)
When I install keras with Anaconda on my Mac OS X, with tensorflow as the backend, the following warning comes up when
running the sample script:
I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
To use those instructions (SSE4.1 SSE4.2 AVX AVX2 FMA), tensorflow has to be compiled from source. The instructions are available here.
Using the following command to build the source:
Today I wanted to setup an automated kickstarter scraper on Python Anywhere but realized that
only MySQL is freely supported there (while I’ve been using PostgreSQL). So, a time to switch?
Here is how I install MySQL on my Mac and have it accessed with SQLAlchemy:
Go to System Preferences to start the MySQL server.
Navigate to the bin directory and login with the temporary password shown at the end of the installation:
cd /usr/local/mysql/bin
./mysql -u root -p
Create another set of username and password that you use instead of root.
CREATE USER username@localhost IDENTIFIED BY 'password'
I have installed pymysql and sqlalchemy in Python to access the MySQL database. To access the database:
fromsqlalchemyimportcreate_enginefromsqlalchemy_utilsimportdatabase_exists,create_database# dbname is the database name
# user_id and user_password are what you put in above
engine=create_engine("mysql+pymysql://%s:%s@localhost:3306/%s"%(user_id,user_password,dbname),echo=False)ifnotdatabase_exists(engine.url):create_database(engine.url)# Create database if it doesn't exist.
con=engine.connect()# Connect to the MySQL engine
table_name='new_table'command="DROP TABLE IF EXISTS new_table;"# Drop if such table exist
con.execute(command)
On my way building a webapp with python and Flask, I need to include input options to make the app interactive. Here are some great sites I’ve learnt things from:
I’ve published a new paper on Geophysical Research Letters!
Climate dynamicists have derived a conservation relation based on small-amplitude wave assumption for wave activity (A) that describes evolution of Rossby wave packets:
However, only the wave activity flux vector on the RHS has been used to diagnose realistic climate data. A is ill-defined when wave amplitude is large (i.e. ‘of finite-amplitude’). In Huang & Nakamura (2016), we introduced a new theory of wave activity applicable to large waves. We thus can obtain a well-defined A even from real data. This is the first piece of work that compare LHS and RHS of the conservative part of equation above for reanalysis data. This advance allows us to estimate the overall non-conservative contribution (natural/human-induced forcings) to the observed flow.
Major results include:
(1) Our estimation of transient wave activity (top panel) is consistent with previous work (bottom panel, assuming small-amplitude waves) and is better behaving.
(2) We can break down the local wave activity budget at seasonal time-scale.
(3) We can also break down the budget in synoptic time-scale with the use of co-spectral analysis.
The ECMWF API Python Client is now available on pypi and anaconda.
The Climate Corporation has distributed the ECMWF API Python Client on
pypi. Now it can be installed via:
pip install ecmwf-api-client
If you are using anaconda, OS X/linux users can install that via