2/24/2013

FORTRAN code to read Applanix SBET file

FORTRAN code to read Applanix SBET file.
I use a Intel Fortran complier.

!! Shih-Hung, Hsu @ CHS
!! v1.0 2013/2/22
!! Show output on screen.

program sb2ascii
implicit none

!! Input
character*30 :: sb_file

!! Output
character*30 :: ascii_file

!! Data
real*8 :: time, latitude, longitude, altitude, x_vel, y_vel, z_vel, roll, pitch
real*8 :: platform_heading, wander_angle, x_acceleration, y_acceleration, z_acceleration
real*8 :: x_angular_rate, y_angular_rate, z_angular

!! Error_Control
integer :: sb_file_IO, ascii_file_IO

!! Test
character*30 :: c_test
integer :: i_test


write(*,*) "Input file name:"
read(*,*) sb_file

open(11, FILE=sb_file, IOSTAT=sb_file_IO, FORM='BINARY', ACCESS='STREAM', READONLY)
open(12, FILE=ascii_file, IOSTAT=ascii_file_IO, FORM='BINARY', ACCESS='STREAM')

do while(sb_file_IO.eq.0)
read(11, IOSTAT=sb_file_IO) time, latitude, longitude, altitude, x_vel, y_vel, z_vel, &
& roll, pitch, platform_heading, wander_angle, x_acceleration, &
&y_acceleration, z_acceleration, x_angular_rate, y_angular_rate, z_angular
write(12, IOSTAT=ascii_file_IO) time, latitude, longitude, altitude, x_vel, y_vel, z_vel, &
& roll, pitch, platform_heading, wander_angle, x_acceleration, &
&y_acceleration, z_acceleration, x_angular_rate, y_angular_rate, z_angular
!write(*, "(17(F20.10))") time, latitude, longitude, altitude, x_vel, y_vel, z_vel, &
! & roll, pitch, platform_heading, wander_angle, x_acceleration, &
! & y_acceleration, z_acceleration, x_angular_rate, y_angular_rate, z_angular
end do

close(11)
close(12)

stop
end program sb2ascii


More......

11/06/2012

南湖群峰 / Mt. Nanhu Series

南湖群峰,位於宜蘭縣,南投縣和台中市交界,為台灣中央山脈最北端的百岳,在此朝東可遙望太平洋上的龜山島,朝西可見聖稜線,朝北可見七星山。中央山脈在此由南北走向轉為東北-西南走向,且高度從三千公尺不斷下降,最後沒入太平洋之中。也是台灣幾個擁有冰河遺跡的高山之一。
Nanhu Mountain, located between Ilan conutry, Nantou country and Taichung city, is the highest mountain on the northern of cental mountain range in Taiwan. The strike of the mountain range changes from north-south to northeast-southeast with a quick drop in the elevation descending from Nanhu Mountain (more than 3400 m) to Pacific Ocean. You can see evidence of past glaciations in those mountains.
無標題
↑南湖東峰。Eastern Peak.
在高緯度和高山地區,降雪終年不化,厚雪經過長年不斷的擠壓最後成為冰川。在冰河時期,台灣曾出現過許多冰川,其中南湖圈谷即是其遺留下的痕跡。由於整個南湖群峰大多屬於黑色板岩,容易風化,在冰川退去後,整個圈谷在多雨的環境下迅速風化成碎石坡地形。
The glacier forms the accumulation of snow. There are serval glacier on the last glacial period in Taiwan. After the last glacial period, the glaciers have vanished, exposing the "U"-shaped glacial valley below.

無標題
↑南湖圈谷。The glacial valley in Nanhu Mountain.

此路線通常包含審馬陣山3141公尺、南湖大山3742公尺、南湖北山3536公尺、南湖大山東峰3637公尺、馬比杉山3211公尺、南湖大山南峰3449公尺及巴巴山3264公尺,共七座百岳。常見的行程安排多為5天的行程。雲稜山莊和南湖山莊是其中兩個最重要的山屋。
Most plans contain 5 days schedule and included 7 mountains: Nanhu Main Peak 3742M, Nanhu North Mountain 3536M ,Nanhu East Peak 3637M ,Nanhu South Peak 3449M ,Baba Mountain 3264M, Mabishan Mountain 3221M, Shenmajhen Mountain 3141M. There are two major cabins en route: Yuleng Cabin, Nanhu Cabin. Both of those cabins have water nearby.

無標題
↑南湖山屋,曾有黑熊出沒。Nanhu Cabin, some people had witness a Formosan black bear nearby.

無標題
↑從南湖大山看中央尖。See Jhongyangjian Main Peak from Nanhu Main Peak. The peak is famous in Taiwan because it's so sharp.

無標題
↑雲稜山莊到審馬陣山間的草原。This photo was taken between Yuleng Cabin and Shenmajhen Mountain.

上河文化地圖 Maps


More......

12/12/2011

能高越嶺古道 / Nengao Cross Mountain Historic Trail

能高越嶺古道為早期台灣往來東西的一條重要道路,西從霧社沿著塔羅灣溪一路朝東,跨越中央山脈後經銅門沿著木瓜溪抵達花蓮,為台灣早期重要的交通道路。
Nengao Cross Mountain Historic Trail was an important road for east/west journeys across central Taiwan in early times. The trail starts form Wushe, pass the central mountain range, and ends at Tongmen where near Mukumugi.

↑從稜線上東望太平洋。From ridge toward east.

爾後台灣電力公司建立橫跨中央山脈的電力傳輸線路,在舊有古道上興建雲海和檜木兩個保線所。除了這兩個保線所,尚有約在路徑中央的天池山莊提供住宿,以及在中央山脈稜線上的"光被八表"紀念碑。
In 1950s, Taiwan Power Company built a power line along this path under the help of the USA. In order to maintain this power line, two line stations also built on the trail. There is also a Tienchi lodge located in the middle of the trail, provide foods and blankets.
long long away ↑俯瞰舊天池山莊,2011/10造訪時仍在改建。Old Tienchi lodge, it was under rebuild when I visited it on Oct, 2011.

能高越嶺西段路徑寬大,路跡明顯,除了幾處大型崩塌在大雨之後有高風險之外,其緩慢爬升的特性對於登山新手是較為友善的路線。東段的路徑雖不差,但有一小段地形對新手風險較高,且銅門的道路狀況一直都不太穩定。
The western part of the trail have very little elevation gain and the path is pretty clean. However, the geology conditions cause some location of this trail are easy to collapse in heavy rain. The eastern part of the trail have moderate elevation change and hundred meters of landslide terrain.

↑路況好時的大崩壁,連腳踏車都可通行。In good weather, even bikes are able to ride on the trail.

奇萊南峰和南華山為此一路線上最接近的兩座百岳,雖然一般人聽到奇萊第一個會聯想到的是鼎鼎有名的"黑色奇萊",但奇萊南峰和其主峰以及北峰的奇峰險石風色完全不同,而是令人心曠神怡的高山草原。
There are two peaks rising over 3000 meter near the trail. Mt. Nanhua, with a peak of 3184 m. Mt Chilai South, with a peak of 3358m.
無標題
↑奇萊南峰附近的高山草原。The view near Mt. Nanhua.

More......

12/04/2011

水漾森林 / Forest in Water: Beautiful Decay

一九九九年九月二十一日的深夜裡,大地撕裂撼動怒吼,隨之而來的地震波粉碎許多人、事、物,改變台灣的面貌,亦帶出台灣人的善良。水漾森林就誕生在這動盪的黑夜,那夜不但生成許多堰塞湖,瀑布,日月潭到霧峰一帶也沉降2公分到26公分。
In September 21, 1999 a deadly 7.6 Mw earthquake strikes Taiwan killed more than 2000 people. This quake became known as the Chi-Chi earthquake. Quake lakes, waterfalls and massive landslides were everywhere after the night. Area in Central Taiwan such as Sun Moon Lake and Wushe had subsided about 2 to 26 cm from its original elevation. This Beautiful Decay was born in such an environment.

↑水漾森林一偶。A part of the forest.
進入水漾森林通常是從杉林溪或豐山這兩處地方,其中杉林溪的入口位於森林生態渡假園區"仁亭"旁,豐山則由行豐吊橋經千人洞由石鼓盤溪進入水漾。 People usually go the forest via SunLinkSea(There are no sea.) or Fongshan Village. The entry point in SunLinkSea is easier to find than in Fongshan, but you need to buy a ticket.
↑夕陽將水面染成金黃。At sunset.
雖然從杉林溪進入水樣的路徑隨處可見登山布條,但途中的叉路仍可能造成迷路。而從杉林溪到水漾的路又可分為兩條,其一翻過鹿屈山,另一主要沿著舊林道。經由鹿屈山的路徑較明顯,但垂直落差較大,林道部分路徑被芒草堆淹沒,但垂直落差較小。
Follow the marks, they will show you the way to the Forest. But be careful, there are two trails that will lead you to the Forest and the others will bring you into deep mountains. After about 10km you will reach the Forest. The difference between the trail passes the Mt. and the trail mainly follow established tree road is in the change in elevation and easy to recognize. The former path have less change in elevation but are relatively hard to recognize.

↑登山口滿滿的布條。The colorful marks in front of the entry point in SunLinkSea.

↑清晨的陽光灑落在湖面。The dawn, the sunshine through the mist.

↑仍然站立的枯木。The dead trees still stand up straight.

↑深夜。Deep night.
全部照片 / Full Photo Set

More......

12/12/2010

加羅湖:散落的珍珠 / Lake Jialuo:Pearls Fall from Sky

一次偶然的意外,天上的仙女弄斷珍珠項鍊,將一粒粒潔白的珍珠灑落地面,在山林間點綴交織出幽靜的高山湖泊,這就傳說中加羅湖的由來。
One day an angel broke her pearl necklace in accident and it fall into the mountains. Their pearls blowout when they hit the ground to become the lakes we know today as "Lakes Jialuo"
↑加羅湖。Lake Chia-Lo: one of the largest lakes. 加羅湖位於宜蘭縣,海拔 2242 公尺,和四季林道柵欄處的垂直落差達1000公尺,過加納富溪的巨木登山口後,更是一路抖上,想一觀散落的珍珠也得相當體力。
The lakes are located in Yilan County, Taiwan at elevations of 2242 meters. The nearest entry point is the Sihji forest road with an altitude of about 1000 meters below the lakes. When you pass through the Jianaiu River at the end of the forest road, the angle of the trail turns very steep. You will need to be prepared for a serval hours hike and you need a applications for entering the lakes. ↑加納富溪。Jianaiu River. ↑登山口的巨木:別忘記轉彎。The giant tree: Don't forget make a turn into trail. ↑大霧深鎖(其實是鏡頭有水)。Heavy fog. ↑請愛護牠們!There are animals live here. Please protect those guys! ↑這邊曾被大火肆虐。The white forest is the result of a human-caused forest fire in April 1999.

More......

4/03/2010

批次檔延遲執行啟動項目 / Command Line Startup Delayer

由於是公司很乾淨的電腦有這個需求,不適合裝一些額外的軟體,所以想出這個方法。不過在不乾淨的作業系統下,最前面有必要增加一些 Code 來延遲執行整個批次檔。如果有更多程式或較少程式要執行,稍微修改就可以了。
If you don't want to install any software, it might a way of delay startup programs.

@echo off
set /A num = 0
set path=C:\startup
REM 要啟動的程式捷徑位置 ( .lnk of startup items )
goto run

: starting
set /A StartT = %time:~6,1%*10 + %time:~7,1%
REM 避免 0X 秒造成錯誤 ( avoid error of convert 0x to numbers )
IF %StartT% == %StartE% goto run
goto starting


: run
set /A StartT = %time:~6,1%*10 + %time:~7,1%
IF %num% == 8 goto endloop
IF %StartT% == 7 goto p1
IF %StartT% == 14 goto p2
IF %StartT% == 21 goto p3
IF %StartT% == 28 goto p4
IF %StartT% == 35 goto p5
IF %StartT% == 42 goto p6
IF %StartT% == 49 goto p7
IF %StartT% == 56 goto p8
goto run

: p1
set /A num = %num%+1
set /A StartE = %StartT%+1
echo 啟動 P1 中,已啟動 %num% / 8
P1.lnk
goto starting

: p2
set /A num = %num%+1
set /A StartE = %StartT%+1
echo 啟動 P2 中,已啟動 %num% / 8
P2.lnk
goto starting

: p3
set /A num = %num%+1
set /A StartE = %StartT%+1
echo 啟動 P3 中,已啟動 %num% / 8
P3.lnk
goto starting

: p4
set /A num = %num%+1
set /A StartE = %StartT%+1
echo 啟動 P4 2 中,已啟動 %num% / 8
P4.lnk
goto starting

: p5
set /A num = %num%+1
set /A StartE = %StartT%+1
echo 啟動 P5 中,已啟動 %num% / 8
P5.lnk
goto starting

: p6
set /A num = %num%+1
set /A StartE = %StartT%+1
echo 啟動 P6 中,已啟動 %num% / 8
P6.lnk
goto starting

: p7
set /A num = %num%+1
set /A StartE = %StartT%+1
echo 啟動 P7 中,已啟動 %num% / 8
P7.lnk
goto starting

: p8
set /A num = %num%+1
set /A StartE = %StartT%+1
echo 啟動 P8 中,已啟動 %num% / 8
P8.lnk
goto starting

: endloop
pause

More......

3/31/2010

用命令提示字元長時間統計線路狀況 / Ping statistics with Command Line

最近收資料的線路非常的不穩,又沒辦法24小時一直看著它,然後就變出這個東西了。每10秒鐘Ping一次,每15分會寫出檔案一次,每小時會重新統計一次。

Ping every 10 seconds. Write to file every 15 minutes. Restart every hour.

@echo off

set SVIP=123.123.123.123
set T_OUT=6000

: restartping
if not EXIST %SVIP%.斷線 (goto starting)
find /c "Request timed" %SVIP%.斷線 >> %SVIP%.連線
REM 斷線=(connection fail) 連線=(connection success)
find /c "Reply from" %SVIP%.成功 >> %SVIP%.連線
echo. >> %SVIP%.連線
echo %date:~0,10% %time% >> %SVIP%.連線


: starting
set S_DATE=%date:~0,10%
set S_TIME=%time%

if EXIST %SVIP%.斷線 (del %SVIP%.斷線)

if EXIST %SVIP%.連線 (echo ================= >> %SVIP%.連線 >> %SVIP%.連線) ELSE (echo ================= > %SVIP%.連線)
echo. >> %SVIP%.連線
echo Ping: %SVIP% Timeout: %T_OUT%ms Cycle: 10seconds >> %SVIP%.連線
echo. >> %SVIP%.連線
echo %S_DATE% %S_TIME% >> %SVIP%.連線

echo Ping: %SVIP% Timeout: %T_OUT%ms Cycle: 10seconds
echo Please Standing By...

: loopping

ping %SVIP% -n 1 -w %T_OUT% >> %SVIP%.斷線
copy %SVIP%.斷線 %SVIP%.成功

cls
echo Ping: %SVIP% Timeout: %T_OUT%ms Cycle: 10seconds
echo.
echo %S_DATE% %S_TIME:~0,8%
find /c "Request timed" %SVIP%.斷線
find /c "Reply from" %SVIP%.成功
echo.
echo %date:~0,10% %time:~0,8%
echo.
echo Type Ctrl-C to stop.

: waitping
if %time:~7,3%==0.0 (goto goping) ELSE (goto waitping)

: goping
if %time:~3,4%==15:0 (goto writing)
if %time:~3,4%==30:0 (goto writing)
if %time:~3,4%==45:0 (goto writing)
if %S_TIME:~0,2%==%time:~0,2% (goto loopping) ELSE (goto restartping)

: writing
find /c "Request timed" %SVIP%.斷線 >> %SVIP%.連線
find /c "Reply from" %SVIP%.成功 >> %SVIP%.連線
echo. >> %SVIP%.連線
echo %date:~0,10% %time% >> %SVIP%.連線
goto :loopping

More......

11/10/2009

GE 你要去哪? / ops! Google Earth


本來要研究如何從桃園高鐵到桃園楊梅,結果 Google Earth 要我去搭跨海渡輪= =。
It's the answers that Google Earth tells me the route from THSR Taoyuan Station to Yangmei. Yaoyuan Station and Yangmei are both in Taiwan.






不過我從來不知道台灣和中國之間有渡輪可以直達。
However, I never know that I can do that.

More......

10/24/2009

合歡山東峰 / Hehuan E. Peak

合歡山位於花蓮縣和南投縣的交界上,屬於太魯閣國家公園的一部分,亦是大甲溪和濁水溪以及力務溪的分水嶺。
Mount Hehuan lies along the major drainage divide between Dajia River, Zhuoshui River and Liwu River in Taiwan. It also located at the boundaries of Nantou and Hualien counties and is a part of Taroko National Park.

↑ Taroko National Park.


合歡主峰、北峰、東峰和西峰以及石門山和合歡尖是合歡山的主要山峰,在中橫開闢前必須花費數天才能抵達這些區域。在中橫開闢後,抵達這些百岳只需數個小時。然而,在高海拔環境,任何錯誤都可能奪去寶貴的性命,因此仍不可大意。
High peaks in the mount include Mt. Hehuan, Hehuan N. Peak, Hehuan E. Peak, Hehuan E. Peak, Hehuan W. Peak, Mt. Shihmen, Mt. Hehuanjian. Before the Central Cross-Island Highway was built, it took several days to reach those peaks. Thank those who constructed the highway, it just take a couple of hours reaching those peaks. However, it will be fatal if you don't make all things ready.

↑ Central Cross-Island Highway.

合歡山東峰,標高3421公尺,在百岳中排名第35,九峨。
Hehuan E. Peak is 3,421 metres above sea level.








行程大約需要兩小時。
It takes about two hours.

More......

5/15/2009

論文演化史 / My Paper The Evolution and History of my Paper

Stage 1.
Earthquake swarms in the Taiwan orogen
Earthquake swarms in the Taiwan

Stage 2.
Earthquake bursts in the Taiwan
Characteristics of earthquake bursts in Taiwan

Stage 3.
Characteristics of Foreshocks to Moderate-sized (M > 5.5) Earthquakes in Eastern Taiwan

Finally...
Precursory swarms of moderate-sized earthquakes in eastern Taiwan

More......