Skip to content

[sdsarchive] Search *.3 directories (mseed3)#181

Draft
andres-h wants to merge 1 commit intoSeisComP:mainfrom
andres-h:mseed3sds
Draft

[sdsarchive] Search *.3 directories (mseed3)#181
andres-h wants to merge 1 commit intoSeisComP:mainfrom
andres-h:mseed3sds

Conversation

@andres-h
Copy link
Copy Markdown
Contributor

Not 100% sure if done correctly, but seems to work. Ideally mseed2 should take precedence if both formats are available.

@cla-bot cla-bot bot added the cla-signed The CLA has been signed by all contributors label Mar 16, 2026
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
SDSArchive::SDSArchive() {}
SDSArchive::SDSArchive() {
_format = 0;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is more readable to do an inline initialization at the member declaration:

int _format{0};

This also avoid initializing this member twice in different constructors.

if ( name == "format" ) {
if ( !Core::fromString(_format, value) ||
_format < 2 || _format > 3 )
return false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logging an error would be nice, wouldn't it?

bool SDSArchive::setSource(const string &src) {
if ( src.empty() ) {
string arcroots;
size_t pos = src.find('?');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we could use Util::Url to parse the given source. This will give you access to URL parameters and do the proper decoding of all components.

return resolveCha(pathStr, net, sta, loc, cha, requestStartTime, doy, year, first);
bool res = true;

if (_format == 0 || _format == 2)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add spaces within parentheses. Furthermore use curly brackets for conditional blocks even if they are just one-liners.

@gempa-jabe gempa-jabe marked this pull request as draft March 17, 2026 10:07
@gempa-jabe
Copy link
Copy Markdown
Contributor

The code is in general looking good. Is this decision to use 3 as quality flag in the path name of a new ms3 archive file documented somewhere? Is there a version of slarchive which populates an archive like that? And last but not least, there is no option for mixed ms2/ms3 files, right?

@andres-h
Copy link
Copy Markdown
Contributor Author

The code is in general looking good. Is this decision to use 3 as quality flag in the path name of a new ms3 archive file documented somewhere? Is there a version of slarchive which populates an archive like that?

There is a pull request at EarthScope/slarchive#6

Anyway, it's just a proposal.

I don't expect that slarchive4 fully replaces slarchive yet, but people who need mseed3 can use it together with seedlink4 and chain4_plugin from https://github.com/andres-h/seedlink4

I've heard that EarthScope is planning to start seedlink4 streaming in few months.

And last but not least, there is no option for mixed ms2/ms3 files, right?

That would probably break too many tools.

@gempa-jabe
Copy link
Copy Markdown
Contributor

@andres-h, are you done with that PR? Do you consider it as final to be merged?

@andres-h
Copy link
Copy Markdown
Contributor Author

andres-h commented Apr 2, 2026

I will make the requested changes. It is not ready yet.

Furthermore, I think there may be problems with variable blocksize. I haven't tested it.

@andres-h
Copy link
Copy Markdown
Contributor Author

andres-h commented Apr 3, 2026

I tested this with variable blocksize. It seems to work OK, albeit less efficient (linear search) and I get a warning like this:

17:27:12 [debug] R /archive/2026/GE/VSU/BHZ.3/GE.VSU..BHZ.3.2026.093 (first: 1)
17:27:12 [warning] [/archive/2026/GE/VSU/BHZ.3/GE.VSU..BHZ.3.2026.093] Detected mixed record length (680 != 618), abort binary search
17:27:12 [debug] W /archive/2026/GE/VSU/BHZ.3/GE.VSU..BHZ.3.2026.093 (linear search)
17:27:12 [debug] exc: end of stream

or more often this:

17:27:40 [debug] R /archive/2026/GE/VSU/BHZ.3/GE.VSU..BHZ.3.2026.093 (first: 1)
17:27:40 [warning] [/archive/2026/GE/VSU/BHZ.3/GE.VSU..BHZ.3.2026.093@1360] Couldn't read mseed header
17:27:40 [debug] W /archive/2026/GE/VSU/BHZ.3/GE.VSU..BHZ.3.2026.093 (linear search)
17:27:40 [debug] exc: end of stream

Not sure if anything needs to be done. I created variable blocksize artificially and mseed3 with fixed blocksize (all blocks in file having the same size) works without any problems.

@jsaul
Copy link
Copy Markdown
Contributor

jsaul commented Apr 4, 2026

@andres-h Can you quantify "less efficient"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The CLA has been signed by all contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants