tag:blogger.com,1999:blog-91234768713503181082024-03-14T02:20:54.285+02:00Ran's Thoughts"And earthquakes are to a girls guitar they're just another good vibration"<br><br>
InSAR Processing and moreRanhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.comBlogger52125tag:blogger.com,1999:blog-9123476871350318108.post-77341099546356677962017-05-18T12:27:00.000+03:002017-05-18T12:27:42.079+03:00Send Large attachments with google API for gmailThe problem: How to send large size images using google's gmail API for python. The documentation is not very good and a 10MB size limit is not mentioned. Following their quickstart example, I use body-media instead of body to send large files.
See below for an example:
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-20133469031498678832016-01-06T04:43:00.004+02:002016-01-06T04:43:50.665+02:00Real-Time Kernel for RaspberryPi 2
This post will describe how to compile a RT-kernel for RaspberryPi 2.
I'm using UBUNTU 14.04 LTS 64bit for compiling Raspbian Jessie.
After a long time, I needed a RT kernel for a new project with the new RaspberryPi2. Realizing My old post has broken links, I struggled again with the task. This time, after a successful attempt, I'm determined to put it all here step by step.
Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com4tag:blogger.com,1999:blog-9123476871350318108.post-6323961176939407172015-07-15T21:42:00.000+03:002015-07-15T21:42:48.639+03:00Batch Download ESA's Sentinel satellite imagesThe new ESA's satellite Sentinel data is distributed free using an open data hub.
All you need to do is to register. The data hub provide tools for searching data and creating a cart of products for downloading. Since I'm very lazy, I created a Python client that would download the data once provided with the correct data link or a product list file (that can be easily downloaded from Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-20641691500819718212015-03-20T20:43:00.003+02:002015-03-20T21:30:17.633+02:00FFT using pylabfrom pylab import *
data,timestep = 10*sin(arange(1000)*5/2.0/pi)+5*sin(arange(1000)*10/2.0/pi),0.01
han = hanning(len(data))
handata = han*data
n = len(data)*50
FFT = abs(fftshift(fft(handata,n)))
freq = fftshift(fftfreq(n,timestep))
plot(freq,2*FFT/sum(han))Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-9382319169053294872015-01-13T08:00:00.000+02:002015-01-16T21:08:54.096+02:00ASUS EeePc fan replacementMy 2009 Asus EeePc (model 1005ha) started to make loud noise. I figured it was the fan. With an aid of this YouTube movie (see below) I was able to replace the fan and repair it. Thanks luisfilipe1983!
Assembling the tools
Opening the back
Removing the keboard
Going inside
Getting closer...
Deep inside
Fixed!
The YouTube Movie:
Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0Albany,CA,United States39.0959629363055 -122.3437513.573928436305497 -163.652344 64.6179974363055 -81.035156tag:blogger.com,1999:blog-9123476871350318108.post-66638661128675262002014-10-01T20:06:00.000+03:002014-11-17T20:14:58.167+02:00Starting a PostDoc At UC BerkeleyI'm starting A postdoc fellowship at UC Berkeley Seismological Laboratory (BSL) under the supervision of Prof. Richard Allen. For the next year or two I'll be busy working on the Earthquake Early Warning System (EEWS) algorithms. My first project will be to figure how to implement BSL EEWS algorithms for the Israeli Seismological Network. California here we come...Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0Berkeley, CA, USA37.8715926 -122.2727469999999837.7713156 -122.43410849999998 37.9718696 -122.11138549999998tag:blogger.com,1999:blog-9123476871350318108.post-19173782402413894362013-12-31T09:28:00.000+02:002014-02-21T09:31:37.104+02:00Starting to work at GIIThat's it. I've finished my 2 years Post-Doc adventure at TAU.
I'm now starting to work on the Israel national Earthquake Early Warning System (EEWS).
As of tomorrow, I'm going to work at the Seismology Division of the Geophysical Institute of Israel (GII).
Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-22955376500611193012013-11-26T13:03:00.000+02:002013-12-19T13:05:26.325+02:00Real-Time Kernel for RaspberryPi (Take II)After unsuccessful attempt to compile Archlinux-rt kernel,
I encountered a very good guide describing how to compile a Debian Linux-rt kernel with Xenomai for the RaspberryPi. and a completing page for creating the RPI image.
I can't say I understand it completely, but I managed to combine to two guides and compile my own RaspberryPi Linux-rt kernel.
I'm sure some of the steps are missing and Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-33727757802431516242013-08-29T13:41:00.000+03:002013-11-05T12:50:29.855+02:00EQMet TSA-SMA setup for SeisComp3The following post will describe how to install EQMet INTERNET-READY STRONG MOTION ACCELEROGRAPH (TSA-SMA) and set it up for SeisComp3.
Following the instruction in the manual:
The initial steps are to connect the TSA-SMA to electricity, GPS and a computer via the USB device connection.
Then, connect to the device via serial connection.
On windows: read the manual and follow the Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0Tel Aviv University, Haim Levanon 55, Tel Aviv, Israel32.1112857 34.8015035999999336.5892512000000032 -6.5070904000000667 57.6333202 76.110097599999932tag:blogger.com,1999:blog-9123476871350318108.post-59389841772710954472013-08-01T12:14:00.000+03:002013-12-19T12:22:22.918+02:00Machinoid Real-Time Linux for RaspberryPiDownload and install Machinoid following: http://www.machinoid.com/?p=10
apt-get install libtool gfortran
apt-get install libusb-1.0
install xenomai following the instructions in the link above.
sysctl vm.min_free_kbytes=8192
vi /etc/ld.so.conf.d/xenomai.conf
add 2 lines:
# xenomai default configuration
/usr/xenomai/lib
ldconfig
install wifi drivers (after I got problems with Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-2156012492964833082013-07-07T14:32:00.000+03:002013-12-19T12:40:03.065+02:00LSM303 accelerometer on RaspberryPiAfter getting my new LSM303 accelerometer, I got my great electronics tec. Daviv Shtibelman to wire it up for RPI.
Connecting LSM303 pins 1 (SCL), 2 (SDA), 6 (GND) and 8 (V3V) to pins 5 (SCL), 3 (SDA), 6 (GND) and 1 (V3V) on the Pi board.
On my ArchlinuxARM OS I had to install i2c-tools:
> pacman -S i2c-tools
And add i2c modules:
> echo i2c-dev > /etc/modules-load.d/ i2c.conf
> Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com3tag:blogger.com,1999:blog-9123476871350318108.post-45386068836950611062013-06-30T12:08:00.000+03:002013-12-19T12:12:45.522+02:00Real-Time Kernel for RaspberryPiAfter installing and running ArchLinuxARM on my RaspberryPi, I tried to compile a real-time kernel.
With the help of moonman, following this ArchLinuxARM forum thread, I downloaded the RT patch:
https://www.kernel.org/pub/linux/kernel/projects/rt/3.6/patch-3.6.11.4-rt36.patch.gz
and the PKGBUILD:
# git clone https://github.com/archlinuxarm/PKGBUILDs.git
following this, I updated pacman:
# Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-39781659717625975472013-06-01T11:19:00.000+03:002013-07-08T11:20:04.464+03:00RaspberryPi initial stepsI initiated a new project involving low-cost micro-computer RaspberryPi.
In order to begin I ordered some basic parts (costs are in USD for Israeli market, should be cheaper elsewhere):
a RaspberryPi (55$)
5v charger with microusb adapter (10$)
8GB SD card (12$)
HDMI cable (8$)
and some extra parts:
3.5" LCD screen (45$)
micro-keyboard (62$)
micro-sd low profile adapter (11.9$)
wifi dongle Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-26220273564038873362013-01-16T11:11:00.001+02:002013-06-19T10:50:50.913+03:00Fedora 17 Linux packgesThese are MY needed packages, feel free to follow my steps or ignore this.
1. Add rpmfusion to yum repo list:
> sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
2.
sudo yum install -y yumex tcsh gmt ImageMagick ipython scipy Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-29798131806781897372013-01-01T11:20:00.000+02:002013-06-19T11:21:58.594+03:00Done with the PhD., Moving forwardFinally, I finished my PhD. and now it time to move forward.
Taking my Professors advice, I'm making the first steps in the world of seismology and I'm going to spend the next few years in Tel-Aviv University, working with Dr. Alon Ziv and Dr. Hillel Wust-Bloch.
The main work is building and maintain a local mini seismic-array network. I am going to actually place the seismometers, connect the Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-12285164096355939292012-12-16T15:07:00.000+02:002012-12-16T15:07:28.936+02:00JoyWarrior24F14 Udev rulesThe JW24F14 device is accessible as a HID only as root. In order to access it as a user, I had to write a UDEV rule with the help of this post. more info about udev rules can be found here.
issue the command:
> sudo vi /etc/udev/rules.d/10-JoyWarrior24F14.rules
and when in editing mode (i) add:
# Rules for accessing JoyWarrior24F14 HID as user:
SUBSYSTEM=="usb", ATTRS{idVendorRanhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-44342302690444312562012-10-25T13:51:00.002+02:002012-10-25T14:10:42.686+02:00Python Event Listener - multiprocessing deamonI wanted to have a file change listener such that if new data is added to a file I could run a code.
Following this post, I've written a modification so now the listener is working in multiprocessing.
#!/usr/bin/python
# A code to stream file as it grows
# by Ran Novitsky Nof Oct 25, 2012
import os,time
from multiprocessing import Process,Pipe
# change this file name
FileName = 'stream.txt'Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-148370135195659982012-10-24T10:30:00.002+02:002012-10-24T10:52:00.418+02:00SeisComp3 - get events dataAfter installing Seiscomp3 and running it for a while, now it is time to play with the data.
As a first step I want to be able to see the events outside the SeisComp3 environment.
This will later serve me when exporting the data to a web page or reports.
The steps described here are: 1) get a list of events, 2) export the data to an xml file and 3) print the data as a bulletin.
1) Get Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-54281816131403500762012-09-24T22:06:00.000+02:002013-03-14T12:06:31.137+02:00Installing SeisComp3 on fedora 17After installing Fedora 17 I will now describe how to install MySQL server and SeisComp3.
first, install MySQL (following this):
> sudo yum install -y mysql mysql-server
enable and start MySQL service:
> sudo systemctl enable mysqld.service
> sudo systemctl start mysqld.service
Next, secure the server:
> sudo /usr/bin/mysql_secure_installation
(answer yes to Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com7TAU, Tel Aviv, Israel32.113031298045264 34.80638265609741232.112190798045262 34.805148656097415 32.113871798045267 34.807616656097409tag:blogger.com,1999:blog-9123476871350318108.post-91192601839330823152012-08-28T20:21:00.002+03:002012-08-28T20:21:24.532+03:00Howto write to stdout XYhow to use python to write to a certain location (x,y) on the stdout (terminal):
copied form here
import sysdef print_there(x, y, text): sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (x, y, text)) sys.stdout.flush()
Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-72669809548381828522012-08-28T09:30:00.000+03:002012-11-18T15:49:49.806+02:00Creating a software raid1. format the hard drives to raid using fdisk (gdisk in fedora 17)
or with parted (for 3TB disks):
> parted /dev/sdx
(parted) mklabel gpt
(parted) unit TB
(parted) mkpart primary 0 3001G
(parted) print
(parted) quit
2. Create the raid device (change Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-49537967948605905472012-08-27T15:31:00.001+03:002013-03-14T11:31:38.745+02:00Installing Fedora Core 17based on my-guides post-install post
1. Add to sudo:
> su --login -c 'visudo'
add under the line:
root ALL=(ALL) ALL
the line:
username ALL=(ALL) ALL
and remove the sign # from the line with %wheel
save and test using the line:
> sudo whoami
(answer should be root)
2. Disable SeLinux and firewall:
> sudo vi /etc/selinux/config
Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-62880826106616323422012-05-29T09:05:00.000+03:002012-05-29T09:05:33.606+03:00Dead Sea rising: how the lowest place on Earth is getting (slightly) higher - GeoSpace - AGU BlogosphereSee a blog post about my recent paper:
Dead Sea rising: how the lowest place on Earth is getting (slightly) higher - GeoSpace - AGU BlogosphereRanhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0Dead Sea31.5195423 35.456279531.3029708 35.1404225 31.736113800000002 35.7721365tag:blogger.com,1999:blog-9123476871350318108.post-91300841936931713022012-05-10T23:58:00.000+03:002012-05-10T23:58:53.578+03:00Howto run a process automatically when a certain mail is downloaded by ThunderbirdIn order to run a file whenever a certain mail arrives to my inbox I created a filter using the Thunderbird add-on FiltaQuilla. The add-on expand the messages filtering options and add an option to "run a file". when a certain mail match the filter, Thunderbird will run the file specified. I use a python code - code.py so in the filter configuration under Linux (Fedora core 14) I use this line:
Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0tag:blogger.com,1999:blog-9123476871350318108.post-90702354351667966242011-11-21T15:40:00.001+02:002014-02-21T09:19:33.965+02:00HowTo Mosaic ASTER Global Digital Elevation Model (GDEM)A second version of ASTER GDEM was released in Oct. 17 2011 by The Ministry of Economy, Trade and Industry of Japan (METI) and the National Aeronautics and Space Administration (NASA). The GDEM is in a 30m pixel resolution and 1x1 degree tiles. The data is distributed as zipped GeoTIFF files. When a larger than 1x1 deg. DEM is needed for Interferometry processing, you can use my GDEM.py Ranhttp://www.blogger.com/profile/13547751431352852077noreply@blogger.com0