subtracting 2 seismic unix files - subtraction

I hope that you are familiar with Seismic Unix (su) for displaying wiggle. I've tried but can't find a way of subtracting the values in these two files.
If you have been working with Seismic Unix and have any ideas, would you please give a recommendation ?

I looked for a cross-post on the Earthscience stackexchange but didn't see it.
Anyway, you have two ways to subtract two files, assuming they are identical with respect to number of traces, samples per trace and sampling rate:
sudiff file1.su file2.su > diff.su
or:
suop2 file1.su file2.su op=diff > diff.su
They are equivalent.

Related

Reducing sampling in simulation

Is there any way in Modelica, to reduce the sampeling during simulations? I have a DCDC converter with high frequency, consequently generating huge dataset. I am wondering, if there is any way to reduce the size of the dataset during simulation/exportation?
Thanks
Trying to create smaller dataset from models that generate huge ones (models with high frequencies).
Basically when you simulate, do not press the -> press the S on the toolbar and you get several tabs and the ones you care about are General and Output.
In General you can specify the number of intervals to reduce the data stored. It will only be stored at each interval.
In the Output you can say not to store events for example. You can also filter out variables that you are not interested in to reduce the result file size. Note that "Equidistant Time Grid" is activated by default, if not this would generate quite a lot of output maybe even several times per interval.
See more here about the things you have in General/Output:
https://openmodelica.org/doc/OpenModelicaUsersGuide/1.20/omedit.html#simulating-a-model
By including our desired variables in the Variable Filter in Output tab one can reduce the size of the output file without compromising the interval points. Each entry follows a POSIX EXTENDED regular expression format, say:
for a list of x,y,z it is ^x|y|z$. Another best practice could be unchecking the flag Store variables at Events. The best answer for this question is already answered by Adrian Pop.

Power BI | Combine Measures into one VIsual

Alright - After completely checking google and all the forums I now really need help.
The Situation:
There are two measures. One shows the "SUM" (222) and the other shows the "SUM%" in % (2,81%)
If I show the each measures in an separate card visual, everything is fine
The Need:
Combine these two measures into one card visual
The Problem:
When I combine these two measures with "&" or "COMBINEVALUES", the % value completely freaks out and shows "2,80550992038418e-02". Yes, the Measure is formatted as percentage and limited to two decimal value places
Sounds easy - But seems impossible. Any Ideas? For now I need to combine only two measures - but maybe there is an solution to combine even more than only two measures?
Goddamnit! Sometimes the solution is so simple...
COMBINEDMEASURENAME = CONCATENATE([MEASURE 1], CONCATENATE(" (", FORMAT([Measure2WITH%], "0.00%)")))
With the FORMAT-Function you can override the format of the measure and define it to fit your needs

Compare common value of a timeseries

I have timeseries that don't have the same start time and I would like to find the common part of them.
EX:
a=[ 0,1,2,3,4,5,6,7]
b=[ 2,3,4,5,6,7,8,9]
c=[-1,0,1,2,3,4,5,6]
result=[2,3,4,5,6]
Is there a matlab function to do that ?
EDIT:
I found an algorithm, but it is taking for ever and it is saturating my memory to analyse 6 timeseries of 100000 points. Is the algorithm not written properly or is it the way Longest common substring problem is?
The problem is called the Longest common substring problem.
http://en.wikipedia.org/wiki/Longest_common_substring_problem
It is not really hard to implement, and you you can probably also find Matlab code online. It is important to observe that if you know how to solve for 2 time series, you know how to solve for N, because: c(x,y,z) = c(x,c(y,z))

Matlab: Is it possible to save in the workspace a vector that contains 4 millions of values?

I am calculating something and, as result I have a vector 4 millions elements. I am not still finished to calculate it. I´ve calculate it will take 2 and a half hours more. When I will have finished I could save it?
It is not possible, what can I do?
Thank you.
On Windows 32-bit you can have at maximum a double array of 155-200 millions of elements. Check other OSs on Mathworks support page.
Yes, just use the command save. If you just need it for later Matlab computations, then it is best to save it in .mat format.
save('SavedFile.mat','largeVector')
You can then load your file whenever you need it using the load function.
load('SavedFile.mat')
On my machine it takes 0.01 sec to get a random vector with 4 million elements, with whos you can see that it takes (only) 32 MB.
It would take only few seconds to save such amount of data with MATLAB. If you are working with post-R2007b then maybe it is better to save with '-v7.3' option, newer MATLAB versions use by default general HDF5 format but there could be some performance/disc usage issues.

How do I calculate a p-value if I have the t-statistic and d.f. (in Perl)?

I have written a Perl script that performs many one-sample t-tests. I get thousands of t-statistics with their degrees of freedom (df). I need to upgrade the script to also return their p-values (there are too many to look them up manually in a table). Is there some kind of formula I can use for this with the t-statistic and d.f as input? I hope someone can help me with this, many thanks in advance!
A.A.
Using Statistics::Distributions seems pretty straightforward:
print Statistics::Distributions::tprob($dof,$tstat);
A search of MetaCPAN reveals the following:
https://metacpan.org/pod/Statistics::Distributions
If you are doing a two-tailed test, then your p-value = 2*P(T > t), where t is your calculated test statistic. So essentially, you need a way to model the T-dist in order to integrate(T-dist from t to INFINITY). Here is a demo: http://www.stat.tamu.edu/~west/applets/tdemo.html
I'm not familiar with Perl and its libraries, but hopefully this gets you started. You can write a rudimentary integrator and check some values to make sure that it is accurate enough.