Page 1 of 1
Bug saving database with SAC files, XML error
Posted: Thu Jan 30, 2025 8:26 pm
by joel.jansen
Hello --
I have HVSR data saved in SAC format using SmartSolo's Sololite software. I can load, view, and process the dataset in Geopsy as expected, but when I try to re-open the GPY database file I get the following error:
"Errors occured while opening database, for more details read log."
The log then reads:
"Truncated context at the end of XML (D:/<directory path>/test.gpy at line 14).
Truncated context at the end of XML (D:/<directory path>/_Geopsy/test.gpy)."
Line 14 is the "Name" line, so it appears that the XML importer is unable to parse it correctly.
My workaround is to delete the three instances of the Name line (one per component) from the GPY XML file (I use the "Kate" editor) and save the file, after which I can open the GPY file normally.
Please let me know if you require more information or uploaded files (each component is 50MB).
Thank you,
Joel
Re: Bug saving database with SAC files, XML error
Posted: Fri Jan 31, 2025 10:08 am
by admin
Hi Joel,
Can you upload the .gpy file. Not the SAC files?
Re: Bug saving database with SAC files, XML error
Posted: Fri Jan 31, 2025 10:51 pm
by joel.jansen
Hi -- GPY file as requested.
My workaround is to delete lines 14, 39, and 64.
LMK if you need anything else.
J
Re: Bug saving database with SAC files, XML error
Posted: Thu Feb 13, 2025 9:19 am
by admin
This is an issue I recently discovered with text fields of SAC headers. Fields have a fixed number of characters (KSTNM 8 for the station name). Until recently, the extra characters were blank spaces if the actual station name is shorter than 8 characters. You are providing a second example where the extra characters are 0 which is the end of string character in C.
If you upgrade to 3.6.0-preview accessible through
git only (see download page), upon the import of SAC files the station name will be properly extracted even if there are null characters. When saving the database you won't encounter any error.
To fix existing databases, edit the <name> fields and remove the last strange characters.
Code: Select all
<Signal>
<ID>4</ID>
<Name>3026290^@</Name>
Re: Bug saving database with SAC files, XML error
Posted: Sat Apr 19, 2025 11:10 am
by sunxu
I am using version 3.5.2 of geopsy and encountered the same issue. I modified the .gpy file according to your solution, but it still reports an error as follows:
Truncated tag at the end of XML (D:/kt/test - 副本.gpy at line 1).
Truncated tag at the end of XML (D:/kt/test - 副本.gpy).
I have attached the original test.gpy and the modified test_modified.gpy.
Hope to get your help.
Thank you!
Sunxu
Re: Bug saving database with SAC files, XML error
Posted: Tue Apr 22, 2025 7:20 am
by admin
Hi Sunxu,
Effectively, you have the same issue with
test.gpy.
At first, I was not able to open
test_modified.gpy with the ad hoc method:
I tried with
unzip and
gunzip. After renaming the .gpy file,
Code: Select all
mv test_modified.gpy test_modified.gz
gunzip test_modified.gz
The obtained file is a text file with the xml code. Hence, I guess that you compressed
contents.xml with
gzip. The format read by geopsy is slightly different. It is a
tar file compressed with
gzip.
Hence the only way to compress the xml file is
Code: Select all
tar cvfz test_modified.gpy contents.xml
Note that you can also rename
contents.xml to
test_modify.gpy without compressing. It should work also.
Hope it helps,
Marc
Re: Bug saving database with SAC files, XML error
Posted: Tue Apr 22, 2025 9:30 am
by sunxu
Hi! Thank you for your reply!
In fact, I directly used Kate to edit the original file test.gpy and obtained test_modified.gpy.
According to your instructions, I followed these steps:
1. Use tar xvfz test.gpy to get the context.xml file.
2. Modify all the field Name in the context.xml file, removing the space after the station name.
like Line 14: <Name>3015469 </Name>
3. Rename context.xml to test.gpy.
Then I successfully read the test.gpy file!
Thank you for your help!
Sunxu