; ; image_scale.pro scales an array ; pro image_scale, dataname, data, image,stime,etime,hrfrac,sheight,eheight,height,dmax,dmin ; ; Change the format of ReflectivityBestEstimate ; if dataname eq 'ReflectivityBestEstimate' then begin data=float(data) result=where(data ne -9999, count) if count ne 0 then data[result]=data[result]/100.0 endif ; ; Zoom in on the image ; result=where(hrfrac ge stime and hrfrac le etime, count) if count ne 0 then newdata=data[result,*] result=where(height ge sheight and height le eheight, count) if count ne 0 then newdata=newdata[*,result] ; ; Find the data range and set the null values to 1e6 ; dmax=max(newdata) ;max data value mresult=where(newdata eq -9999,count) if count gt 0 then newdata[mresult]=1e6 nresult=where(newdata eq -8888,count) if count gt 0 then newdata[nresult]=1e5 dmin=min(newdata) if dataname eq 'CloudFraction' then begin newdata[mresult]=0 newdata[nresult]=0 endif print,'min', dmin, 'max', dmax ; ; Scale the data values and insert them into image ; if dataname eq 'ReflectivityBestEstimate' then begin dmax=15.0 dmin=-65.0 endif else begin dmax=dmax dmin=dmin endelse ;for onyx ;image=bytscl(newdata, max=dmax, min=dmin,top=180) ;for uncinus image=bytscl(newdata, max=dmax, min=dmin,top=255) return end