One method to do this may be to first read the data into arrays. Then, use the WHERE routine to find elements of the array where the data are above or below your thresholds. Then, change these elements to the quantized values.
Below is an example where a random data set is generated. After that, all values less than 0.05 are set to zero and and all values greater than 0.7 will be set to 1.
IDL> f = randomu(seed, 10)
IDL> print, f
0.246459 0.196312 0.421719 0.000509440 0.891196 0.338354 0.0453506 0.263455 0.283703 0.206776
IDL> below = where(f lt 0.05, count)
IDL> high = where(f gt 0.7, count2)
IDL> f[below]= 0.0
IDL> f[high]=1.0
IDL> print, f
0.246459 0.196312 0.421719 0.000000 1.00000 0.338354 0.000000 0.263455 0.283703 0.206776
|