Wednesday, July 13, 2016

installing #altair #python #conda

>conda install altair --channel conda-forge

The following packages will be downloaded:

    package                    |            build
    conda-4.1.8                |           py35_0         247 KB
    pandas-0.18.1              |      np110py35_0         6.9 MB  conda-forge
    vega-0.4.1                 |           py35_1         904 KB  conda-forge
    altair-1.0.0               |           py35_0         1.6 MB  conda-forge
                                           Total:         9.6 MB
Linking packages ...
[vega                ]|#########################                         |  50%
C:\Users\Userme>"C:\Users\Userme\AppData\Local\Continuum\Anaconda3\Scripts\jupyter-nbextension.exe" install vega --py --sys-prefix   && if errorlevel 1 exit 1

Just for my note
    To initialize this nbextension in the browser every time the notebook (or other app) loads:

          jupyter nbextension enable vega --py --sys-prefix

The documentation:

Tuesday, June 28, 2016

Create Clickable imagesc for 2D data

Looking at the figure is fun, specially if you can click and get the values. So, created this little function which can give you title and data tips @cursor location.
function imagesca(x, titlewant)
h = figure;
catch ME
datacursormode on

Thursday, June 16, 2016

Print a large poster on multiple A4/paper

There are two ways:
1. Save the (powerpoint) document as  pdf.
2. Open the pdf, print.
3. Select the appropriate options in the poster option in the page size and handling section
4. The options are Tile scale: 200% for example, overlap by few tenth of the inches
5. Cutmarks and labels etc are optional #4 does the magic!

Another way that I learned from the internet is to paste the picture in the excel sheet. The excel is smart enough to segment the pic into multiple pages. And, I used to think that extra flowing line being printed into second page was a bad feature in excel! :)

Wednesday, June 15, 2016

Dropbox over server

Well, I had some failures in the past. So, I wanted to try again.
First, I had to run headless install via command line.
Then ran the Dropbox daemon from the newly created .dropbox-dist folder.
That got me a unique link to link dropbox account to cloud.
Then I got the code from the help page (
Rest was not bad!
Here are some of the commands that I had to run... because I wanted to exclude bunch of folders from syncing. I wish there was "include" option instead of "exclude".

~/bin/ exclude add ~/Dropbox/MyExclude1 ~/Dropbox/MyExclude2 

~/bin/ exclude list 

~/bin/ help ~/bin/ status ~/bin/ start

Plot LST

Just a code to plot LST
Lat  = double(hdfread(filewant,  'Latitude' ));
Lon  =  double(hdfread(filewant,  'Longitude' ));
LST = 0.02* double(hdfread(filewant,  'LST' ));

load coast
latlim=[floor(min(min(Lat))),ceil(max(max(Lat))) ]; lonlim=[floor(min(min(Lon))),ceil(max(max(Lon))) ];
ax = worldmap(latlim, lonlim);
surfacem(Lat, Lon, LST);
geoshow(lat, long,'Color', 'black' )
colormap; set(gcf,'Color','white')
map2 = colormap; map2( 1, : ) = 0; colormap(map2);
colorbar % saveas(gcf, 'plotHDF.png', 'png') close all
caxis([ 290 330])

Tuesday, June 14, 2016

Chrome: Add keyboard shortcut to your favorite website

This trick works on Google chrome. 
  • Right click on the address bar
  • Edit Search Engines
  • Scroll to the bottom of the list
  • Give the name, keyword (eg. gs: for google scholar), then URL.
You can put %s in place of query.