Difference between revisions of "Main Page/Research/MSB/Scripts"

From phurvitz
< Main Page‎ | Research‎ | MSB
Jump to: navigation, search
Line 7: Line 7:
 
* Parsing SMS files, standardizes all SMS into a single format, in a single file, '''[[/preprocess_sms.R|preprocess_sms.R]]'''
 
* Parsing SMS files, standardizes all SMS into a single format, in a single file, '''[[/preprocess_sms.R|preprocess_sms.R]]'''
 
*: This creates a single file form which individual subjects' sms records can easily be extracted.
 
*: This creates a single file form which individual subjects' sms records can easily be extracted.
 +
*# Some SMS have GPS week and TOW
 +
*# For those that have GPS week and TOW:
 +
*## If GPS week != 1340 then this is a good timestamp
 +
*## If GPS week = 1340, then get the mean difference between this timestamp and the phone timestamp
 +
*### Apply this difference to the "bad" GPS timestamps as an estimate of GPS time
 
* Joining MSB and GPS data, calculates distance to previous and next points, makes WASPN83 coordinates: '''[[/join_data.R|join_data.R]]'''
 
* Joining MSB and GPS data, calculates distance to previous and next points, makes WASPN83 coordinates: '''[[/join_data.R|join_data.R]]'''
 
* To parse the binary '''MyExperience.sdf''' file into a CSV ASCII file: '''[[/process_sdf.R|process_sdf.R]]'''
 
* To parse the binary '''MyExperience.sdf''' file into a CSV ASCII file: '''[[/process_sdf.R|process_sdf.R]]'''

Revision as of 23:03, 17 January 2009

Scripts to push and pull MSB data

  • Raw MSB data are downloaded from the device onto a local PC. This script pushes data to my storage server msb_push_data.pl.
  • Data are sucked from my server to Jonathan's server and then the parse and classify routines are run. Data are retrieved from Jonathan's server using msb.get.data.R.

Scripts to parse the MSB data on the receiving Linux server

  • Parsing SMS files, standardizes all SMS into a single format, in a single file, preprocess_sms.R
    This creates a single file form which individual subjects' sms records can easily be extracted.
    1. Some SMS have GPS week and TOW
    2. For those that have GPS week and TOW:
      1. If GPS week != 1340 then this is a good timestamp
      2. If GPS week = 1340, then get the mean difference between this timestamp and the phone timestamp
        1. Apply this difference to the "bad" GPS timestamps as an estimate of GPS time
  • Joining MSB and GPS data, calculates distance to previous and next points, makes WASPN83 coordinates: join_data.R
  • To parse the binary MyExperience.sdf file into a CSV ASCII file: process_sdf.R
    This requires pre-processing to CSV via MyExperience_Analyzer.exe or MyExperience_Analyzer_new.exe.
    Because the sdf files may be in different formats, use trial-and-error to see which exe file will open the sdf. If one exe fails, use the other.
    When the MyExperience Analyzer opens, click Queries > Get All Responses, then File > Save As and save the file as Get All Responses.csv.
  • To conflate SMS and MSB records
    Where both have GPS timestamps (Subject ID >= 11): conflate_msb_sms_gps.R
    Where SMS does not have GPS timestamps (Subject ID < 11): conflate_msb_sms_nogps.R