Difference between revisions of "Main Page/Research/MSB/Scripts"
From phurvitz
Phil Hurvitz (talk | contribs) |
Phil Hurvitz (talk | contribs) |
||
Line 20: | Line 20: | ||
*: Where both have GPS timestamps (Subject ID >= 11): '''[[/conflate_msb_sms_gps.R|conflate_msb_sms_gps.R]]''' | *: Where both have GPS timestamps (Subject ID >= 11): '''[[/conflate_msb_sms_gps.R|conflate_msb_sms_gps.R]]''' | ||
*: Where SMS does not have GPS timestamps (Subject ID < 11): '''[[/conflate_msb_sms_nogps.R|conflate_msb_sms_nogps.R]]''' | *: Where SMS does not have GPS timestamps (Subject ID < 11): '''[[/conflate_msb_sms_nogps.R|conflate_msb_sms_nogps.R]]''' | ||
+ | |||
+ | ==Conflating MyExperience and SMS== | ||
+ | The idea is to get the MyExperience record's phone timestamp, find the corresponding phone timestamp from the SMS, get that SMS's GPS timestamp for conflating with MSB data (which are all indexed by GPS time). | ||
+ | There are several basic problems: | ||
+ | # If the true time of a MyExperience record cannot be ascertained, the record must be discarded, otherwise there is a risk of associating a survey with the wrong time and place. This data pollution would be worse than no record at all. | ||
+ | # Subjects before S11 had no MSB data on the SMS, so there is no sure way to conflate timestamps. | ||
+ | #: Some of the subjects have a fairly close match between phone time and network time, so there is evidence that the phone time was set and stayed correct. However, because time differences between phone and network time can vary substantially, | ||
+ | # Not all MyExperience records sent out SMS. No other log file was recorded to store MSB data and MyExperience data. So these phantom MyExperience records cannot necessarily be conflated with any time. | ||
+ | #: Now, if a | ||
+ | |||
+ | [[/log of SMS consistency within each subject|log of SMS consistency within each subject]] |
Revision as of 23:36, 19 January 2009
Contents
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.
- 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
- 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
Conflating MyExperience and SMS
The idea is to get the MyExperience record's phone timestamp, find the corresponding phone timestamp from the SMS, get that SMS's GPS timestamp for conflating with MSB data (which are all indexed by GPS time). There are several basic problems:
- If the true time of a MyExperience record cannot be ascertained, the record must be discarded, otherwise there is a risk of associating a survey with the wrong time and place. This data pollution would be worse than no record at all.
- Subjects before S11 had no MSB data on the SMS, so there is no sure way to conflate timestamps.
- Some of the subjects have a fairly close match between phone time and network time, so there is evidence that the phone time was set and stayed correct. However, because time differences between phone and network time can vary substantially,
- Not all MyExperience records sent out SMS. No other log file was recorded to store MSB data and MyExperience data. So these phantom MyExperience records cannot necessarily be conflated with any time.
- Now, if a