up [pdf]
from rsf.proj import *

# Download data
Fetch('austin-w.HH','bay')

# Convert to byte form
Flow('byte','austin-w.HH',
     '''
     dd form=native |
     byte pclip=100 allpos=y
     ''')

# Display
Result('byte',
       '''
       grey yreverse=n screenratio=1 
       title="Digital Elevation Map" 
       ''')

# Histogram
Flow('hist','byte',
     '''
     dd type=float |
     histogram n1=256 o1=0 d1=1 |
     dd type=float
     ''')
Plot('hist',
     'graph label1=Value label2=Occurence title=Histogram')

# Cumulative histogram
Flow('cumu','hist','causint')

Result('hist','hist cumu',
       '''
       cat axis=2 ${SOURCES[1]} | scale axis=1 |
       graph label1=Value label2="Normalized Occurence"
       title=Histogram dash=0,1
       ''')

# ADD HISTOGRAM EQUALIZATION

End()

sfdd
sfbyte
sfgrey
sfhistogram
sfgraph
sfcausint
sfcat
sfscale

data/bay/austin-w.HH