PDA

View Full Version : Find peak in the historgram data file... - FORTRAN!


gaijin1
Oct6-09, 11:02 PM
Hello guys,

I have a file with X Y values (separated by space)

I want to scan the data to find the PEAK in the file. (It will probably be a lowest Y point...)

How do I do this is Fortran?

Thank you,

Alexander

minger
Oct7-09, 08:00 AM
Seems like...

OPEN(11,file='inputfile.dat',form='formatted')
DO n=1,nPts
READ(11,*) x,y
END DO
peak_val = MINVAL(y)
peak_loc = MINLOC(y)

Can you elaborate a little more on this "peak" that you need to find? Do you need to take derivatives?