...
Sample CSV and Hazard data for populating the database are located at username@dev01-quakecore:/var/wwwrcc/home/projects/quakecore/seis2Data.
Type the following command and come back after lunch.
Code Block |
---|
# First, create a folder called 'private' under your git repository seisfinder2 $ cd seisfinder2 /seisfinder2$ mkdir private # Then create a folder called 'data' under private/ /seisfinder2$ cd private /seisfinder2/private$ mkdir data # General copy command: scp -r username@remoteserver:remote_path_to_copy_files local_path_to_put_copied_files # add sudo if permission denied # if still permission denied, type the following command in the dev01-quakecore server to change permssion username@dev01-quakecore $ sudo chmod 755 /rcc/home/varprojects/wwwquakecore/seisfinder2seis2Data/private/data/cybershake17p8_csv # Now copy files from remote server to your local machine # cybershake17p8 csvs scp -r gg999@dev01-quakecore:/rcc/home/varprojects/wwwquakecore/seisfinder2seis2Data/private/data/cybershake17p8_csv home/gg999/seisfinder2/private/data/ # darfield csvs scp -r gg999@dev01-quakecore:/rcc/home/varprojects/wwwquakecore/seisfinder2seis2Data/private/data/darfield_csv home/gg999/seisfinder2/private/data/ # hazard data scp -r gg999@dev01-quakecore:/rcc/home/varprojects/wwwquakecore/seisfinder2seis2Data/private/data/hazard home/gg999/seisfinder2/private/data/ # event data scp -r gg999@dev01-quakecore:/var/www/seisfinder2rcc/home/projects/quakecore/seis2Data/private/data/event home/gg999/seisfinder2/private/data/ |
...
Code Block |
---|
$cd seisfinder2 # if running local host /seisfinder2 $ python manage.py runserver # if running from the dev01-quakecore server # first change file permission if permission denied use: /seisfinder2 $ sudo chmod 755 var/www/seisfinder2/rcc/home/projects/quakecore/seis2Data/private/data/cybershake17p8_csv # then /seisfinder2 $ sudo python manage.py runserver 132.181.39.127:8000 # else use 'ifconfig' to figure out the IP address of your server |
...
Code Block |
---|
# The 'root_dir=' is the absolute path where you just put the copied data in step 4. Eg. # local host: http://127.0.0.1:8000/seisfinderapp/insert?root_dir=home/gg999/seisfinder2/private/data/cybershake17p8_csv&type=cybershake # dev01-quakcore: http://132.181.39.127:8000/seisfinderapp/insert?root_dir=var/www/seisfinder2/rcc/home/projects/quakecore/seis2Data/private/data/cybershake17p8_csv&type=cybershake |
...
Code Block |
---|
# local host: http://127.0.0.1:8000/seisfinderapp/insert?root_dir=home/gg999/seisfinder2/private/data/darfield_csv&type=historic # dev01-quakcore: http://132.181.39.127:8000/seisfinderapp/insert?root_dir=var/www/seisfinder2/rcc/home/projects/quakecore/seis2Data/private/data/darfield_csv&type=historic |
...
Now you've finished all the installation steps. Let's do some test to see if the python scripts can run with the database smoothly. The two scripts that need to be tested are hazard_search.py and event_search.py:
(1) To see the detailed usage of hazard_search.py and event_search.py, type:
Code Block |
---|
/seisfinder2/sqlsts $ python hazard_search.py -h
/sesifinder2/sqlsts $ python event_search.py -h |
(2) Sample test ) Test for hazard_search.py
Code Block |
---|
$cd seisfinder2/sqlsts seisfinder2/sqlsts $ python hazard_search.py -q Cybershake17p8 -45.63 168.94 |
Output:
(23) Test Sample test for event_search.py
Code Block |
---|
seisfinder2/sqlsts $ python event_search.py -e 2010Sept4_m7pt1_newtdelay_VMCant_v1p65_BULLDOZED-h0p100_EMODv3p0p4_170426 -c -43.1325 171.7693 -r bev01_s103246Allsegm_v8_23 |
Output:
(3) To see the detailed usage of hazard_search.py and event_search.py, type:
...