PROCESS STEP 2:
The following processing flow was executed within a python notebook (FA2018002_SonobuoyMiniseed.ipynb) on raw sonobuoy traces and navigation by deployment.
1. Obspy (version 1.2.2) was used to read all raw miniSEED files contributing to a deployment into a merged three trace stream. Interactive plotting was used to identify the trace containing data for the deployment and determine the date and times of the hydrophone deployment and the first and last recorded shots. A position for the hydrophone deployment was manually retrieved from the Hemisphere GPS message in the HYPACK raw file corresponding to the determined time. During this process a row for each sonobuoy deployment containing columns for its coordinates, name, year, UTC day and time, image name, SurveyID, VehicleID, and DeviceID were entered into the ASCII CSV file '2018-002-FA_SB_depnav.csv'.
2. Python was used to parse HYPACK raw files for the FEI clock shot-instant messages within the first and last shot temporal limits and append them into a Pandas (version 0.25.1) dataframe containing columns for year, Julian day, hour, minute, second, microsecond, and Pandas datetime object. Similarly, the CSV version of the final MCS shot navigation ('2018-002-FA_MCS_shtnav.csv', available online at
https://doi.org/10.5066/P91WP1RZ) was parsed to produce a dataframe with the same temporal limits containing columns for deployment longitude and latitude (static coordinates determined manually in previous operation), shot longitude and latitude, FFID, offset, year, Julian day, hour, minute, second, and Pandas datetime object. Offset is the distance in meters between the static deployment position and each shot position as calculated by pyproj (version 1.9.6) on the WGS84 ellipsoid. The offsets are nominal estimates and do not account for post-deployment drift of the sonobuoy.
3. The dataframes produced in the previous operation were merged, using the Pandas merge "asof" module with the datetime object as the join key, to produce a dataframe retaining the deployment longitude and latitude, shot longitude and latitude, FFID, and offset columns from the MCS shot navigation input and the year, Julian day, hour, minute, second, microsecond, and Pandas datetime object columns from the FEI clock shot-instant input. Generally, the "nearest" direction argument was specified during the "asof" merge to simply match the rows of each dataframe containing the closest datetime objects. However, problems with the network time protocol sever software on the Geometrics acquisition computer during deployments SB1 - SB10 resulted in MCS SEG-D header times up to 7 seconds behind the FEI clock shot-instant times. In these instances, the "backwards" direction argument was specified during the "asof" merge in order to match rows so that those with earlier datetime objects in the MCS shot navigation dataframe were matched with those containing later datetime objects in the FEI clock shot-instant dataframe. New columns containing the sonobuoy name, associated MCS line name, SurveyID, VehicleID, and DeviceID were added to the resultant merged shot time dataframe and it was exported to an ASCII CSV file. Upon completing this processing step for all deployments, the shot time ASCII CSV files were concatenated into a single file, '2018-002-FA_SB_shtnav.csv', and a header line was inserted.
4. The merged shot time dataframe was used along with the Obspy trace slice module to cut the continuously recorded sonobuoy record into an Obspy stream containing individual traces for each recorded shot. Iterating over the dataframe rows, Obspy was used to slice 15 second traces from the input record starting at each shot instant, create and populate a list of user defined SEG-Y header words (trace sequence number, ffid, trace id, trace within ffid, coordinate scalar, source x and y coordinates (shot positions in arcseconds), group x and y coordinates (static deployment position in arcseconds), offset (nominal distance between source and sonobuoy), coordinate units (2 = arcseconds), year, day, hour, minute, second, and time basis code (4 = UTC)), and write the resultant trace stream to a SEG-Y Rev. 1 formatted file (32-Bit IBM floating point).