# title: Reiners bug 3577243
# label: Reiners bug 3577243
# Reiner's bug, reduced to a simpler case where there are only three channels.

import org.das2.util.filesystem.FileSystem
print 'local cache dir= ', org.das2.util.filesystem.FileSystem.settings().getLocalCacheDir()

import sys
sys.stdout.flush()

getDocumentModel().getOptions().setAutolayout(False);
#fedu= getDataSet('ftp://ectrept@stevens.lanl.gov/rbsp/rbspb/rept/level2/rbspb_*ect-rept-sci-L2_$Y$m$d_v$(v,sep,ge=2).cdf?FEDU&timerange=2012-10-13',monitor)
fedu= getDataSet('file:///home/jbf/ct/data/rbsp/ftp_ectrept/rbsp/rbspb/rept/level2/rbspb_*ect-rept-sci-L2_$Y$m$d_v$(v,sep,ge=2).cdf?FEDU&timerange=2012-10-13',monitor)
print 'got fedu: %s' % fedu.toString()
fedu= fedu[:,:,0:3]

plot( fedu )
dom.plotElements[0].renderType= org.virbo.autoplot.RenderType.spectrogram

import java.lang.Thread.sleep
java.lang.Thread.sleep(1000)
writeToPng( 'test037_3577243_1.png' )

from org.das2.datum import DatumRangeUtil

showBug= True
if ( showBug ):
  dom.plots[0].yaxis.range= DatumRangeUtil.rescale( dom.plots[0].yaxis.range, 0.0, 0.8 )
  waitUntilIdle()
dom.plotElements[0].renderType= org.virbo.autoplot.RenderType.series

writeToPng( 'test037_3577243_2.png' )

