Thursday, September 30, 2010

some chinese translation tools

OT = off topic

(1) old standby babel fish - type in english or paste chinese characters, get unintelligible response

http://babelfish.yahoo.com/translate_txt

(2) draw the character with your mouse and get the closest matches. okay for characters without a hundred strokes. can't cut and paste the result easily, but you get the pin yin and tone.

http://www.chinese-tools.com/tools/mouse.html

(3) chinese word processor and dictionary. extremely useful if you know pin yin. might only be 30 days free.

http://www.njstar.com/cms/njstar-chinese-word-processor-download

Monday, September 27, 2010

vi stuff

some vi stuff

show line numbers:
:set number

copy or move block of lines or line:

:line,linecotarget
:line,linemtarget
:linemtarget

Go to a line:

type line number then G

error in transfer

If you get this error when applying transfer in sac:  

check_channel; decimation blockette with no associated filter,
skipping to next response now
No transfer function applied! 
ERROR 2118: No transfer function applied.


Then go into the RESP file and make sure that the blocks for each stages are in the following order (cut and paste if necessary):

FIR response
Decimation
Channel Gain

Friday, September 24, 2010

perl

some perl stuff

http://esdynamics.geowissenschaften.uni-tuebingen.de/~esd/tutorials/perl/start.html

http://www.perl.com/pub/2008/04/23/a-beginners-introduction-to-perl-510.html

http://perldoc.perl.org/index-tutorials.html


#!/usr/bin/perl -w

foreach $fn (<*BHZ*.SAC>){
   foreach (`sachdr -l $fn`){
      if (/kstnm/){
          @a=split;
          $sta=$a[2];
          }
      if (/stla/){
          @b=split;
          $stla=$b[2];
          }
      if (/stlo/){
          @c=split;
          $stlo=$c[2];
          }
       }
print "$sta $stla $stlo\n";
};

x windows

Xming for xwindows.

Run Xlaunch for multiple windows.

Then in SSH under tunneling settings, check Enable X11.

Wednesday, September 15, 2010

station lat/lon to 3 decimal places

On the IRIS site the seismic station locations are only given to 2 decimal places lat/lon, which is +/- l km. They don't want to real the precise position of the instruments.

If you need more info, location to 3 decimal places is available in the .sac files.

(from rob)

In the sac header files you can find the latitude and longitude to at least 3 decimal places. You can access this either via sac:
read (file)
lh stla stlo

or a couple matlab options based on which sac reader you're using
with load_sac:
[header, data] = load_sac('file');
header.stla, header.stlo

(In the above two cases stla is short for station latitude and stlo is short for station longitude)

or with readsac
[time, amp, header] = readsac('file');
header(17)
header(18)

in this case header(17) is the latitude and header(18) is longitude.

italian insar site

This link has been stuck in my inbox for a long time, courtesy of JP. Might as well archive it here. We're all about databases.

http://webgis.irea.cnr.it/webgis.html

IREA-CNR InSAR WEB GIS

(wow. acronyms.)