関数wintosac_set_header マニュアル

(The documentation of function wintosac_set_header)

Last Update: 2025/6/12


◆機能・用途(Purpose)

SACヘッダの値を設定する。 関数wintosac からの内部呼び出し用である。
Set SAC headers; a function for internal call from function wintosac.


◆形式(Format)

#include <win/convert.h>
inline union sacheader wintosac_set_header
(const int NsecondBlock,const int samplingRate,
 const struct humanTime initialTime,
 const struct win_channelTable channelTable,
 const int l,struct sequence sacdata)


◆引数(Arguments)

NsecondBlock 秒ブロックの個数。 関数wintosac の第1引数と同じ値を与える。
The number of second blocks, which must be equal to the value of the 1st argument of function wintosac.
samplingRate 作成するSACデータのサンプリングレート。 関数wintosac の第5引数と同じ値を与える。
The sampling rate of the SAC data to create, which must be equal to the value of the 5th argument of function wintosac.
initialTime 作成するSACデータの先頭時刻。 関数wintosac の第2引数(秒ブロックを並べた配列)の先頭の配列要素のメンバtime と同じ値を与える。
The beginning time of the SAC data to create, which must be equal to the value of member time of the first array component of the 2nd argument (an array composed of second blocks) of function wintosac.
channelTable チャンネルテーブルのデータ。 関数wintosac の第3引数と同じものを与える。
A channel table data, which must be equal to the 3rd argument of function wintosac.
l SAC形式に変換したいチャンネルの番号。 チャンネルコードではなく引数channelTableのメンバcontentsの配列要素番号であり、 関数wintosac の第4引数と同じ値を与える。
An index of a channel to convert to SAC format; not a channel code but an array index of member contents of argument channelTable, which must be equal to the value of the 4th argument of function wintosac.
sacdata 引数lで指定したチャンネルにおける、作成した時系列データ。 先に時系列データを作成してからこの関数でSACヘッダを設定するという処理順を想定しており、 そのためこの関数の実行時にはSACデータのうちの時系列データの部分は 既に存在する前提である。その時系列データを与える。
A time series data for the channel specified by argument l that has been created. It is supposed that a time series data is first created, and then SAC headers are determined in this function. Therefore, the time series data is assumed to have been created when this function is called. Give this time series data.


◆戻り値(Return value)

設定したSACヘッダ。メンバを以下のように設定する。
The SAC headers. The values of members of the return value are as follows.

メンバ
Member

Value
name.h000_DELTA 1.0/samplingRate
name.h001_DEPMIN sacdata.valueの配列要素の最小値
The minimum value of the array components of sacdata.value
name.h002_DEPMAX sacdata.valueの配列要素の最大値
The maximum value of the array components of sacdata.value
name.h005_B 0.0
name.h006_E (samplingRate∗NsecondBlock−1)/samplingRate
name.h021_RESP0 channelTable.contents[l].scale
name.h022_RESP1 channelTable.contents[l].AD_convert_bit
name.h023_RESP2 channelTable.contents[l].naturalPeriod
name.h024_RESP3 channelTable.contents[l].damping
name.h031_STLA channelTable.contents[l].latitude
name.h032_STLO channelTable.contents[l].longitude
name.h033_STEL channelTable.contents[l].altitude
name.h056_DEPMEN sacdata.valueの配列要素の平均値
The average of the array components of sacdata.value
name.h057_CMPAZ
channelTable.contents[l].componentの最後の1文字
The last character of channelTable.contents[l].component
設定する値
The value to be set
U0.0
N0.0
E90.0
その他
The others
関数initialize_sacheader によって設定されるデフォルト値
The default header values determined by function initialize_sacheader
name.h058_CMPINC
channelTable.contents[l].componentの最後の1文字
The last character of channelTable.contents[l].component
設定する値
The value to be set
U0.0
N90.0
E90.0
その他
The others
関数initialize_sacheader によって設定されるデフォルト値
The default header values determined by function initialize_sacheader
name.h070_NZYEAR initialTime.year
name.h071_NZJDAY initialTimeから計算される、1年の初めからの通し日数
The total number of days from the beginning of the year calculated from initialTime
name.h072_NZHOUR initialTime.hour
name.h073_NZMIN initialTime.min
name.h074_NZSEC initialTime.secの整数部分
The integer part of initialTime.sec
name.h075_NZMSEC 0
name.h076_NVHDR SACHEADER_VERSION
name.h077_NORID 0
name.h078_NEVID 0
name.h079_NPTS samplingRate∗NsecondBlock
name.h085_IFTYPE 1
name.h105_LEVEN TRUE
name.h107_LOVROK TRUE
name.h108_LCALDA TRUE
name.h110_KSTNM channelTable.contents[l].stationName
「%-8s」形式とする。
In “%-8s” format.
name.h144_KUSER0 channelTable.contents[l].unit
「%-8s」形式とする。
In “%-8s” format.
name.h150_KCMPNM channelTable.contents[l].component
「%-8s」形式とする。
In “%-8s” format.
その他
Other members
関数initialize_sacheader によって設定されるデフォルト値
The default header values determined by function initialize_sacheader


◆使用例(Example)

struct humanTime initialTime={2025,1,1,0,0,0.0};
struct win_channelTable channelTable;
struct sac_timeseq sacdata;
sacdata.header=wintosac_set_header (60,100,initialTime,channelTable,0,sacdata.data);