Thread: How to silence sacio and return codes from rsac<1|2>

Started: 2016-02-09 14:15:17
Last activity: 2016-02-09 14:15:17
Topics: SAC Help
Peter Schmidt
2016-02-09 14:15:17

version sac-101.6a (compiled from source 14/10 2014)

I currently writing a small C-utility that needs to be able to read SAC files and for this I'm trying to use the sacio library. The utility shall be able to handle both evenly sampled time-domain data as well as spectral data, thus I first attempt reading the sac file using rsac1, check the error code, nerr, and then attempt with rsac2. Further, in order to silence I first run sac_warning_off(); sac_error_off(); sac_output_off();

Now attempting to read an evenly sampled time-domain file rsac1 returns nerr=-803, so since it is indicated in the sample scripts in the documentation to expect nerr=0 upon success the utility proceeds to attempt rsac2, resulting in an output from the library of "ERROR 802: File is not unevenly spaced: ..."

Thus two questions arises:
1. what error codes are safe to ignore from rsac1 and rsac2 (I note that the actual code samples in the documentation neglects all error codes < 1)

2. How do I properly silence output from the library

Thanks in advance


p.s. sample code and input file can be provided if needed
16:19:05 v.28f29ea9