### Synthesize Time Series Data with Various Algorithms (Pascal) Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt Provides examples of six different Pascal functions for synthesizing time-domain signals from frequency-domain data. These functions offer varying levels of randomization and windowing. Ensure frequency-domain data (FreqList, Ex1, Ey1, etc.) and desired time range (BeginTime, EndTime) are correctly provided. ```Pascal // Direct use of synthesis functions for custom processing var Ex, Ey, Hx, Hy, Hz: Double1D; FreqList: Double1D; Ex1, Ey1, Hx1, Hy1, Hz1: TComplex1D; Ex2, Ey2, Hx2, Hy2, Hz2: TComplex1D; SampleRate: Double; BeginTime, EndTime: TDateTime; begin SampleRate := 2400; // Hz BeginTime := EncodeDateTime(2023, 1, 15, 10, 0, 0, 0); EndTime := EncodeDateTime(2023, 1, 15, 10, 0, 1, 0); // 1 second // FreqList and complex field arrays from TForwardSite.GetFEH() // Site.GetFEH(FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2); // Option 1: Fixed synthesis (no randomization) SyntheticSeriesFix(SampleRate, BeginTime, EndTime, 1000, 1, // MaxFre, MinFre Ex, Ey, Hx, Hy, Hz, FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2, 1.0); // AllScale // Option 2: Average segment with fixed length AverageSegmentSyntheticSeries(SampleRate, BeginTime, EndTime, 1000, 1, Ex, Ey, Hx, Hy, Hz, FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2, 8, // SyntheticPeriods (average segment = 8 periods) 1.0); // AllScale // Option 3: Average segment with Hanning window AverageSegmentWindowedSyntheticSeries(SampleRate, BeginTime, EndTime, 1000, 1, Ex, Ey, Hx, Hy, Hz, FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2, 8, 1.0); // Option 4: Random segment lengths RandomSegmentLengthSyntheticSeries(SampleRate, BeginTime, EndTime, 1000, 1, Ex, Ey, Hx, Hy, Hz, FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2, 8, 1.0); // Option 5: Random segments with full Hanning window RandomSegmentLengthWindowedSyntheticSeries(SampleRate, BeginTime, EndTime, 1000, 1, Ex, Ey, Hx, Hy, Hz, FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2, 8, 1.0); // Option 6: Random segments with partial window at transitions RandomSegmentLengthPartiallyWindowedSyntheticSeries(SampleRate, BeginTime, EndTime, 1000, 1, Ex, Ey, Hx, Hy, Hz, FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2, 8, 1.0); // Ex, Ey, Hx, Hy, Hz now contain synthesized time series data WriteLn('Generated ', Length(Ex), ' samples'); end; ``` -------------------------------- ### Initialize and Configure TSyntheticTimeSeries Controller Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt Demonstrates how to instantiate the TSyntheticTimeSeries class, define the global time window for the survey, and attach multiple sampling schemas (TS3 and TS5) to handle different frequency bands. ```Pascal var STS: TSyntheticTimeSeries; Schema: TSyntheticSchema; begin STS := TSyntheticTimeSeries.Create; try STS.BeginTime := EncodeDateTime(2023, 1, 15, 10, 0, 0, 0); STS.EndTime := EncodeDateTime(2023, 1, 15, 18, 0, 0, 0); STS.Name := 'SyntheticSite001'; Schema := STS.AddNewSchema; Schema.Name := 'TS3'; Schema.Continous := False; Schema.SampleRate := 2400; Schema.MaxFrequency := 1000; Schema.MinFrequency := 1; Schema.SyntheticPeriods := 8; Schema.SourceScale := 1.0; Schema.Intervals := 7200; Schema.Offset := 3600; Schema.SamplingTime := 1.0; Schema.SyntheticFunciton := 5; Schema := STS.AddNewSchema; Schema.Name := 'TS5'; Schema.Continous := True; Schema.SampleRate := 15; Schema.MaxFrequency := 1; Schema.MinFrequency := 0.000001; Schema.SyntheticPeriods := 8; Schema.SourceScale := 1.0; Schema.SyntheticFunciton := 5; finally STS.Free; end; end; ``` -------------------------------- ### Configure TSyntheticSchema for Frequency Band Synthesis Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt Shows how to configure a specific TSyntheticSchema instance. This includes setting the sampling rate, frequency range, and selecting the synthesis function (e.g., windowed or random segments) to control the output characteristics. ```Pascal var Schema: TSyntheticSchema; begin Schema := TSyntheticSchema.Create; try Schema.Name := 'TS4'; Schema.Description := 'Mid-frequency band 0.1-10 Hz'; Schema.Continous := False; Schema.SampleRate := 150; Schema.Intervals := 7200; Schema.Offset := 0; Schema.SamplingTime := 1.0; Schema.MinFrequency := 0.1; Schema.MaxFrequency := 10; Schema.SyntheticPeriods := 8; Schema.SourceScale := 1.5; Schema.SyntheticFunciton := 5; finally Schema.Free; end; end; ``` -------------------------------- ### Execute Synthetic MT Time Series Workflow Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt This workflow demonstrates loading ModEM forward modeling data, configuring multi-band synthesis parameters, and exporting the results to Phoenix or GMT formats. It handles frequency-to-time domain conversion and natural field amplitude scaling. ```pascal var Sites: TObjectList; Site: TForwardSite; STS: TSyntheticTimeSeries; SiteTS: TSiteTimeSeries; TBL: TTBL; Schema: TSyntheticSchema; Frequencies: Double1D; ScaleE, ScaleB: Double1D; I: Integer; RotationAngle: Double; begin Sites := LoadModEMMTRespond('.\\COMMEMI3D-2A.modemdat'); TBL := TTBL.Create; TBL.LoadTBL('.\\Config\\TEST0000.TBL'); STS := TSyntheticTimeSeries.Create; STS.BeginTime := TBL.STIM; STS.EndTime := TBL.ETIM; Schema := STS.AddNewSchema; Schema.Name := 'TS3'; Schema.Continous := False; Schema.SampleRate := 2400; Schema.MaxFrequency := 1000; Schema.MinFrequency := 1; Schema.SyntheticPeriods := 8; Schema.SourceScale := 1.0; Schema.Intervals := TBL.HSMP * 2; Schema.Offset := TBL.HSMP; Schema.SamplingTime := TBL.L3NS; Schema.SyntheticFunciton := 5; Schema := STS.AddNewSchema; Schema.Name := 'TS4'; Schema.Continous := False; Schema.SampleRate := 150; Schema.MaxFrequency := 10; Schema.MinFrequency := 0.1; Schema.SyntheticPeriods := 8; Schema.SourceScale := 1.0; Schema.Intervals := TBL.HSMP * 2; Schema.Offset := 0; Schema.SamplingTime := TBL.L4NS; Schema.SyntheticFunciton := 5; Schema := STS.AddNewSchema; Schema.Name := 'TS5'; Schema.Continous := True; Schema.SampleRate := 15; Schema.MaxFrequency := 1; Schema.MinFrequency := 0.000001; Schema.SyntheticPeriods := 8; Schema.SourceScale := 1.0; Schema.SyntheticFunciton := 5; Frequencies := Sites[0].GetFrequencies; SetLength(ScaleE, Length(Frequencies)); SetLength(ScaleB, Length(Frequencies)); for I := 0 to Length(Frequencies) - 1 do begin ScaleE[I] := NatureMagneticAmplitude(Frequencies[I]); ScaleB[I] := ScaleE[I]; end; RotationAngle := 0; for I := 0 to Sites.Count - 1 do begin Site := Sites[I]; Site.UpdateNatureMagneticAmplitude(ScaleE, ScaleB); SiteTS := STS.SyntheticSites(Site, RotationAngle); TBL.Name := Site.Name; TBL.TSFileName := Site.Name; TBL.Site := Site.Name; SiteTS.SavePhoenix('.\\Output\\', TBL, Site.Name); SiteTS.SaveGMTTS('.\\Output\\', Site.Name, True); SiteTS.Free; end; STS.Free; TBL.Free; Sites.Free; end; ``` -------------------------------- ### POST /TSyntheticTimeSeries Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt Initializes and configures the main synthesis controller to manage time windows and sampling schemas for a specific MT site. ```APIDOC ## POST /TSyntheticTimeSeries ### Description Initializes the TSyntheticTimeSeries controller, sets the global time window for synthesis, and adds specific sampling schemas (e.g., TS3, TS5) to the site configuration. ### Method POST ### Endpoint /TSyntheticTimeSeries ### Parameters #### Request Body - **BeginTime** (DateTime) - Required - Start timestamp for the synthetic data generation. - **EndTime** (DateTime) - Required - End timestamp for the synthetic data generation. - **Name** (String) - Required - Identifier for the synthetic site. - **Schemas** (Array) - Required - List of TSyntheticSchema objects to be applied. ### Request Example { "Name": "SyntheticSite001", "BeginTime": "2023-01-15T10:00:00", "EndTime": "2023-01-15T18:00:00", "Schemas": [] } ### Response #### Success Response (200) - **Status** (String) - Confirmation of controller initialization. #### Response Example { "Status": "Success", "SiteName": "SyntheticSite001" } ``` -------------------------------- ### Load and Access ModEM Forward Response Data (Pascal) Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt Loads ModEM forward response data from a .modemdat file using the TForwardSite class. It allows access to site information, frequencies, and frequency-dependent impedance tensors and electromagnetic fields. Dependencies include TObjectList and TForwardSite. Outputs site name, position, frequencies, and field components. ```Pascal var Sites: TObjectList; Site: TForwardSite; Field: TForwardFreqencyFields; Frequencies: Double1D; I: Integer; begin // Load sites from ModEM .modemdat file Sites := LoadModEMMTRespond('C:\Data\COMMEMI3D-2A.modemdat'); try // Access first site Site := Sites[0]; WriteLn('Site: ', Site.Name); WriteLn('Position: X=', Site.X:0:2, ' Y=', Site.Y:0:2); WriteLn('Frequencies: ', Site.FieldsCount); // Get all frequencies Frequencies := Site.GetFrequencies; // Access frequency-dependent fields for I := 0 to Site.FieldsCount - 1 do begin Field := Site.Fields[I]; WriteLn('Frequency: ', Field.Frequency:0:4, ' Hz'); WriteLn(' Zxy: ', Field.Zxy.Module:0:6, ' @ ', RadToDeg(Field.Zxy.Phase):0:2, ' deg'); WriteLn(' Zyx: ', Field.Zyx.Module:0:6, ' @ ', RadToDeg(Field.Zyx.Phase):0:2, ' deg'); WriteLn(' Ex1: ', Field.Ex1.Module:0:6, ' Ey1: ', Field.Ey1.Module:0:6); WriteLn(' Hx1: ', Field.Hx1.Module:0:6, ' Hy1: ', Field.Hy1.Module:0:6); end; // Apply calibration (system response correction) // Site.AddCalibration(CalibrationResponses); // Scale by natural magnetic field amplitude // Site.UpdateNatureMagneticAmplitude(EScale, HScale); finally Sites.Free; end; end; ``` -------------------------------- ### Manage Phoenix TBL Files with TTBL Class (Pascal) Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt Demonstrates loading, modifying, and saving Phoenix Geophysics TBL files using the TTBL class. This includes setting site parameters, equipment details, and recording times. Ensure the TBL file path and output directory are correctly specified. ```Pascal var TBL: TTBL; begin TBL := TTBL.Create; try // Load existing TBL template TBL.LoadTBL('.\\Config\\TEST0000.TBL'); // Access and modify site parameters WriteLn('Site: ', TBL.Site); WriteLn('Box Serial: ', TBL.SNUM); WriteLn('Start Time: ', DateTimeToStr(TBL.STIM)); WriteLn('End Time: ', DateTimeToStr(TBL.ETIM)); // Configure for new site TBL.Name := 'NewSite001'; TBL.Site := 'NewSite001'; TBL.TSFileName := 'NewSite001'; TBL.SNUM := '4884'; // Box serial number TBL.HXSN := 'MT8C9003'; // Hx coil serial TBL.HYSN := 'MT8C9004'; // Hy coil serial TBL.HZSN := 'MT8C9005'; // Hz coil serial TBL.EXLN := 100.0; // Ex dipole length (m) TBL.EYLN := 100.0; // Ey dipole length (m) TBL.HSMP := 3600; // High-frequency sample interval (s) TBL.L3NS := 10; // TS3 records per schedule TBL.L4NS := 10; // TS4 records per schedule // Set recording times TBL.STIM := EncodeDateTime(2023, 6, 1, 8, 0, 0, 0); TBL.ETIM := EncodeDateTime(2023, 6, 2, 20, 0, 0, 0); TBL.FTIM := TBL.STIM; TBL.LTIM := TBL.ETIM; // Save modified TBL TBL.SaveTBL('C:\\Output\\NewSite001.TBL'); finally TBL.Free; end; end; ``` -------------------------------- ### TForwardSite Class - ModEM Response Data Container Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt Demonstrates loading ModEM forward response data from a .modemdat file and accessing site-specific impedance tensors and electromagnetic field components at various frequencies. ```APIDOC ## TForwardSite Class - ModEM Response Data Container ### Description Loads ModEM forward modeling response data from a .modemdat file and provides access to site information, frequencies, and frequency-dependent electromagnetic fields (impedance tensors, electric and magnetic fields). ### Method Pascal (Example Usage) ### Endpoint N/A (Local File Processing) ### Parameters N/A ### Request Example ```pascal var Sites: TObjectList; Site: TForwardSite; Field: TForwardFreqencyFields; Frequencies: Double1D; I: Integer; begin Sites := LoadModEMMTRespond('C:\Data\COMMEMI3D-2A.modemdat'); try Site := Sites[0]; WriteLn('Site: ', Site.Name); WriteLn('Position: X=', Site.X:0:2, ' Y=', Site.Y:0:2); Frequencies := Site.GetFrequencies; for I := 0 to Site.FieldsCount - 1 do begin Field := Site.Fields[I]; WriteLn('Frequency: ', Field.Frequency:0:4, ' Hz'); WriteLn(' Zxy: ', Field.Zxy.Module:0:6, ' @ ', RadToDeg(Field.Zxy.Phase):0:2, ' deg'); WriteLn(' Zyx: ', Field.Zyx.Module:0:6, ' @ ', RadToDeg(Field.Zyx.Phase):0:2, ' deg'); WriteLn(' Ex1: ', Field.Ex1.Module:0:6, ' Ey1: ', Field.Ey1.Module:0:6); WriteLn(' Hx1: ', Field.Hx1.Module:0:6, ' Hy1: ', Field.Hy1.Module:0:6); end; finally Sites.Free; end; end; ``` ### Response N/A (Direct object manipulation) ``` -------------------------------- ### Generate and Save Synthetic Time Series Data (Pascal) Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt Creates and saves synthetic time series data for a measurement site using the TSiteTimeSeries class. Supports saving in GMT-compatible text format and Phoenix format, requiring TBL configuration for the latter. Dependencies include TSiteTimeSeries, TTimeSeries, and TTBL. ```Pascal var SiteTS: TSiteTimeSeries; TS: TTimeSeries; TBL: TTBL; begin // SiteTS is typically returned from TSyntheticTimeSeries.SyntheticSites() // For demonstration, create manually: SiteTS := TSiteTimeSeries.Create; try SiteTS.Name := 'TestSite'; SiteTS.Longitude := 116.5; SiteTS.Latitude := 39.8; SiteTS.Altitude := 50.0; // Access individual time series bands for I := 0 to SiteTS.TimeSeriesCount - 1 do begin TS := SiteTS.TimeSeries[I]; WriteLn('Band: ', TS.Name, ' SampleRate: ', TS.SampleRate:0:0, ' Hz'); WriteLn(' Records: ', TS.BeginTimeCount); end; // Save as GMT-compatible text format SiteTS.SaveGMTTS('C:\Output\', 'TestSite', True); // True = absolute timestamps // Save as Phoenix format (requires TBL configuration) TBL := TTBL.Create; try TBL.LoadTBL('.\Config\TEST0000.TBL'); SiteTS.SavePhoenix('C:\Output\', TBL, 'TestSite'); finally TBL.Free; end; finally SiteTS.Free; end; end; ``` -------------------------------- ### Access and Export Time Series Data (Pascal) Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt Provides access to raw electromagnetic field data and timestamps stored within a TTimeSeries object. Supports exporting data to GMT format. Dependencies include TTimeSeries and its implementations. Outputs segment information, field values, and flattened data arrays. ```Pascal var TS: TTimeSeries; Data: Double2D; Times: Double1D; I, J: Integer; begin // TS obtained from TSiteTimeSeries.TimeSeries[index] WriteLn('Time Series: ', TS.Name); WriteLn('Sample Rate: ', TS.SampleRate:0:0, ' Hz'); WriteLn('Segments: ', TS.BeginTimeCount); // Access raw field arrays (2D: [segment][sample]) // Channels: Ex, Ey, Hx, Hy, Hz (electric and magnetic fields) for I := 0 to TS.BeginTimeCount - 1 do begin WriteLn('Segment ', I, ': ', DateTimeToStr(TS.BeginTime[I]), ' to ', DateTimeToStr(TS.EndTime[I])); WriteLn(' Ex samples: ', Length(TS.ExField[I])); WriteLn(' First Ex value: ', TS.ExField[I][0]:0:6); WriteLn(' First Hx value: ', TS.HxField[I][0]:0:6); end; // Get flattened data array [channel][all_samples] Data := TS.GetData(0, -1); // All segments WriteLn('Total samples: ', Length(Data[0])); WriteLn('Ex channel: ', Length(Data[0]), ' samples'); WriteLn('Ey channel: ', Length(Data[1]), ' samples'); WriteLn('Hx channel: ', Length(Data[2]), ' samples'); WriteLn('Hy channel: ', Length(Data[3]), ' samples'); WriteLn('Hz channel: ', Length(Data[4]), ' samples'); // Get timestamps as decimal days Times := TS.GetTimes; // Export to GMT format TS.SaveGMTTS('C:\Output\', TS.Name + '.txt', True); end; ``` -------------------------------- ### Synthesis Functions - Time Series Generation Algorithms Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt This section outlines the six synthesis functions available for converting frequency-domain data to time-domain signals, offering various options for randomization and windowing. ```APIDOC ## Synthesis Functions - Time Series Generation Algorithms ### Description Provides six different synthesis functions that control how frequency-domain data is converted to time-domain signals with varying degrees of randomization and windowing. ### Method ```pascal // Direct use of synthesis functions for custom processing var Ex, Ey, Hx, Hy, Hz: Double1D; FreqList: Double1D; Ex1, Ey1, Hx1, Hy1, Hz1: TComplex1D; Ex2, Ey2, Hx2, Hy2, Hz2: TComplex1D; SampleRate: Double; BeginTime, EndTime: TDateTime; begin SampleRate := 2400; // Hz BeginTime := EncodeDateTime(2023, 1, 15, 10, 0, 0, 0); EndTime := EncodeDateTime(2023, 1, 15, 10, 0, 1, 0); // 1 second // FreqList and complex field arrays from TForwardSite.GetFEH() // Site.GetFEH(FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2); // Option 1: Fixed synthesis (no randomization) SyntheticSeriesFix(SampleRate, BeginTime, EndTime, 1000, 1, // MaxFre, MinFre Ex, Ey, Hx, Hy, Hz, FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2, 1.0); // AllScale // Option 2: Average segment with fixed length AverageSegmentSyntheticSeries(SampleRate, BeginTime, EndTime, 1000, 1, Ex, Ey, Hx, Hy, Hz, FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2, 8, // SyntheticPeriods (average segment = 8 periods) 1.0); // AllScale // Option 3: Average segment with Hanning window AverageSegmentWindowedSyntheticSeries(SampleRate, BeginTime, EndTime, 1000, 1, Ex, Ey, Hx, Hy, Hz, FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2, 8, 1.0); // Option 4: Random segment lengths RandomSegmentLengthSyntheticSeries(SampleRate, BeginTime, EndTime, 1000, 1, Ex, Ey, Hx, Hy, Hz, FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2, 8, 1.0); // Option 5: Random segments with full Hanning window RandomSegmentLengthWindowedSyntheticSeries(SampleRate, BeginTime, EndTime, 1000, 1, Ex, Ey, Hx, Hy, Hz, FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2, 8, 1.0); // Option 6: Random segments with partial window at transitions RandomSegmentLengthPartiallyWindowedSyntheticSeries(SampleRate, BeginTime, EndTime, 1000, 1, Ex, Ey, Hx, Hy, Hz, FreqList, Ex1, Ey1, Hx1, Hy1, Hz1, Ex2, Ey2, Hx2, Hy2, Hz2, 8, 1.0); // Ex, Ey, Hx, Hy, Hz now contain synthesized time series data WriteLn('Generated ', Length(Ex), ' samples'); end; ``` ### Parameters - **SampleRate** (Double) - Required - The sampling rate in Hz. - **BeginTime** (TDateTime) - Required - The start time for the synthesized series. - **EndTime** (TDateTime) - Required - The end time for the synthesized series. - **MaxFre** (Integer) - Required - Maximum frequency for synthesis. - **MinFre** (Integer) - Required - Minimum frequency for synthesis. - **Ex, Ey, Hx, Hy, Hz** (Double1D) - Output - Arrays to store the synthesized time-domain data. - **FreqList** (Double1D) - Required - List of frequencies. - **Ex1, Ey1, Hx1, Hy1, Hz1** (TComplex1D) - Required - Complex frequency-domain data for the first set. - **Ex2, Ey2, Hx2, Hy2, Hz2** (TComplex1D) - Required - Complex frequency-domain data for the second set. - **AllScale** (Double) - Required - Scaling factor for the synthesized series. - **SyntheticPeriods** (Integer) - Required (for average/random segment functions) - Number of periods to average or segment length. ### Request Example ```json { "example": "See Pascal code for examples of calling each synthesis function." } ``` ### Response #### Success Response (200) - **Ex, Ey, Hx, Hy, Hz** (Double1D) - The synthesized time-series data arrays. #### Response Example ```json { "example": "Output message indicating the number of generated samples." } ``` ``` -------------------------------- ### TTBL Class - Phoenix Table File Handler Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt This section demonstrates how to use the TTBL class to load, access, modify, and save Phoenix Geophysics TBL (table) files, which are used for site configuration, equipment parameters, and time series metadata. ```APIDOC ## TTBL Class - Phoenix Table File Handler ### Description Manages Phoenix Geophysics TBL (table) files that define site configuration, equipment parameters, and time series metadata. ### Method ```pascal // Load and configure a Phoenix TBL file var TBL: TTBL; begin TBL := TTBL.Create; try // Load existing TBL template TBL.LoadTBL('.\Config\TEST0000.TBL'); // Access and modify site parameters WriteLn('Site: ', TBL.Site); WriteLn('Box Serial: ', TBL.SNUM); WriteLn('Start Time: ', DateTimeToStr(TBL.STIM)); WriteLn('End Time: ', DateTimeToStr(TBL.ETIM)); // Configure for new site TBL.Name := 'NewSite001'; TBL.Site := 'NewSite001'; TBL.TSFileName := 'NewSite001'; TBL.SNUM := '4884'; // Box serial number TBL.HXSN := 'MT8C9003'; // Hx coil serial TBL.HYSN := 'MT8C9004'; // Hy coil serial TBL.HZSN := 'MT8C9005'; // Hz coil serial TBL.EXLN := 100.0; // Ex dipole length (m) TBL.EYLN := 100.0; // Ey dipole length (m) TBL.HSMP := 3600; // High-frequency sample interval (s) TBL.L3NS := 10; // TS3 records per schedule TBL.L4NS := 10; // TS4 records per schedule // Set recording times TBL.STIM := EncodeDateTime(2023, 6, 1, 8, 0, 0, 0); TBL.ETIM := EncodeDateTime(2023, 6, 2, 20, 0, 0, 0); TBL.FTIM := TBL.STIM; TBL.LTIM := TBL.ETIM; // Save modified TBL TBL.SaveTBL('C:\Output\NewSite001.TBL'); finally TBL.Free; end; end; ``` ### Parameters N/A for class instantiation and method calls shown. ### Request Example ```json { "example": "See Pascal code for TBL object manipulation." } ``` ### Response N/A for this example, as it demonstrates file operations and object manipulation. ### Response Example ```json { "example": "See Pascal code for output messages." } ``` ``` -------------------------------- ### POST /TSyntheticSchema Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt Configures a specific sampling band schema, defining sample rates, frequency ranges, and the mathematical synthesis function used for signal generation. ```APIDOC ## POST /TSyntheticSchema ### Description Defines the parameters for a specific frequency band (TS2-TS5). This includes timing, frequency bounds, and the selection of the synthesis algorithm. ### Method POST ### Endpoint /TSyntheticSchema ### Parameters #### Request Body - **Name** (String) - Required - Schema identifier (e.g., TS4). - **SampleRate** (Integer) - Required - Sampling frequency in Hz. - **MinFrequency** (Float) - Required - Minimum frequency bound. - **MaxFrequency** (Float) - Required - Maximum frequency bound. - **SyntheticFunciton** (Integer) - Required - Algorithm ID (0-5) for signal generation. - **Continous** (Boolean) - Required - Whether the recording is continuous or segmented. ### Request Example { "Name": "TS4", "SampleRate": 150, "MinFrequency": 0.1, "MaxFrequency": 10, "SyntheticFunciton": 5, "Continous": false } ### Response #### Success Response (200) - **SchemaID** (String) - Unique identifier for the created schema. #### Response Example { "SchemaID": "TS4_Configured" } ``` -------------------------------- ### TSiteTimeSeries Class - Multi-Band Time Series Container Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt Explains how to use the TSiteTimeSeries class to manage multiple time series bands (TS3, TS4, TS5) for a single site and export data in various formats like GMT and Phoenix. ```APIDOC ## TSiteTimeSeries Class - Multi-Band Time Series Container ### Description Manages multiple time series bands (e.g., TS3, TS4, TS5) for a single measurement site. Provides functionality to access individual time series, set site metadata, and export data to different file formats. ### Method Pascal (Example Usage) ### Endpoint N/A (Local File Processing) ### Parameters N/A ### Request Example ```pascal var SiteTS: TSiteTimeSeries; TS: TTimeSeries; TBL: TTBL; begin SiteTS := TSiteTimeSeries.Create; try SiteTS.Name := 'TestSite'; SiteTS.Longitude := 116.5; SiteTS.Latitude := 39.8; SiteTS.Altitude := 50.0; for I := 0 to SiteTS.TimeSeriesCount - 1 do begin TS := SiteTS.TimeSeries[I]; WriteLn('Band: ', TS.Name, ' SampleRate: ', TS.SampleRate:0:0, ' Hz'); end; SiteTS.SaveGMTTS('C:\Output\', 'TestSite', True); TBL := TTBL.Create; try TBL.LoadTBL('.\Config\TEST0000.TBL'); SiteTS.SavePhoenix('C:\Output\', TBL, 'TestSite'); finally TBL.Free; end; finally SiteTS.Free; end; end; ``` ### Response N/A (Direct object manipulation) ``` -------------------------------- ### TTimeSeries Class - Single Band Time Series Source: https://context7.com/emwpj/syntheticmttimeseries/llms.txt Details the TTimeSeries class (and its implementations TContinuousTimeSeries, TMultipleTimeSeries) for storing and accessing 5-channel electromagnetic field data for a single sampling band, including methods for data retrieval and export. ```APIDOC ## TTimeSeries Class - Single Band Time Series ### Description An abstract class representing time series data for a single frequency band, storing 5 channels of electromagnetic field data (Ex, Ey, Hx, Hy, Hz). Provides methods to access data by segment or as a flattened array, retrieve timestamps, and export to GMT format. ### Method Pascal (Example Usage) ### Endpoint N/A (Local Data Access) ### Parameters N/A ### Request Example ```pascal var TS: TTimeSeries; Data: Double2D; Times: Double1D; I, J: Integer; begin // TS obtained from TSiteTimeSeries.TimeSeries[index] WriteLn('Time Series: ', TS.Name); WriteLn('Sample Rate: ', TS.SampleRate:0:0, ' Hz'); for I := 0 to TS.BeginTimeCount - 1 do begin WriteLn('Segment ', I, ': ', DateTimeToStr(TS.BeginTime[I]), ' to ', DateTimeToStr(TS.EndTime[I])); WriteLn(' Ex samples: ', Length(TS.ExField[I])); end; Data := TS.GetData(0, -1); WriteLn('Total samples: ', Length(Data[0])); Times := TS.GetTimes; TS.SaveGMTTS('C:\Output\', TS.Name + '.txt', True); end; ``` ### Response N/A (Direct object manipulation) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.