Find peak in the historgram data file - FORTRAN

Click For Summary
SUMMARY

The discussion focuses on finding the peak value in a histogram data file using Fortran. The user, Alexander, seeks to identify the lowest Y point from a set of X Y values stored in 'inputfile.dat'. The provided Fortran code snippet utilizes the OPEN statement to read the data and employs the MINVAL and MINLOC functions to determine the peak value and its location. This method effectively identifies the minimum Y value, which is interpreted as the peak in the context of the user's query.

PREREQUISITES
  • Understanding of Fortran programming language
  • Familiarity with file I/O operations in Fortran
  • Knowledge of array functions such as MINVAL and MINLOC
  • Basic concepts of data analysis and peak detection
NEXT STEPS
  • Explore advanced Fortran array manipulation techniques
  • Learn about numerical methods for peak detection in datasets
  • Investigate the use of derivatives for identifying local minima and maxima
  • Study file handling and data parsing in Fortran for larger datasets
USEFUL FOR

Fortran developers, data analysts, and researchers working with numerical data who need to implement peak detection algorithms in their applications.

gaijin1
Messages
1
Reaction score
0
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
 
Technology news on Phys.org
Seems like...
Code:
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?
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K