# test042. pull out just the ascii formatting

ds1= ripplesTimeSeries(60)
ds2= ripplesTimeSeries(60) + randomn(3554,60)
ds3= ripplesWaveformTimeSeries(60)
ds4= ripplesSpectrogramTimeSeries(60)
ds5= ripplesVectorTimeSeries(60)
ds6= getDataSet( 'http://autoplot.org/data/autoplot.cdf?BGSEc' )

formatDataSet( ds1, 'test042_scalar_noheader.txt?doDep=false' )

formatDataSet(ds1,'test_format_008.dat')

formatDataSet(ds4,'test_format_017.dat')

ds= ds5
formatDataSet( ds,'test042_rich_vector.txt?header=rich')

ds= ds2
formatDataSet( ds,'test042_rich_scalar.txt?header=rich')

ds= ds4
formatDataSet( ds,'test042_rich_spectrogram.txt?header=rich')

nn= getDataSet('vap+inline:ripplesTimeSeries(200)&NAME=Density')
tt= getDataSet('vap+inline:ripplesTimeSeries(200)*2&NAME=Temperature')
bvec= getDataSet('vap+inline:ripplesVectorTimeSeries(200)&NAME=Bfield')
bmag= magnitude(bvec)
ds= bundle( nn, tt, bmag ) 
ds= putProperty( ds, QDataSet.DEPEND_0, nn.property( QDataSet.DEPEND_0 ) )
formatDataSet( ds,'test042_rich_simple_bundle.txt?header=rich')

formatDataSet( ds6, 'test042_none_vector.txt?header=none' )
formatDataSet( ds6, 'test042_none_vector_notimetags.txt?depend0Units=hours+since+2006-01-01&header=none' )
formatDataSet( ds6, 'test042_none_vector_notimetags_format.txt?format=%5.2f&tformat=%9.1f&depend0Units=hours+since+2006-01-01&header=none' )

formatDataSet( ds4, 'test042_spectrogram_noheader.txt?header=none' )
formatDataSet( ds4, 'test042_spectrogram_noheader_notimetags.txt?depend0Units=hours+since+2011-10-24&header=none' )
formatDataSet( ds4, 'test042_spectrogram_notimetags_format.txt?format=%5.2f&tformat=%9.1f&depend0Units=hours+since+2011-10-24&header=none' )
formatDataSet( ds4, 'test042_spectrogram_notimetags_format2.txt?format=%+11.5e&tformat=%+9.3f&depend0Units=hours+since+2011-10-24&header=none' )

formatDataSet( ds1, 'test042_scalar_noheader.txt?header=none' )
formatDataSet( ds1, 'test042_scalar_noheader_notimetags.txt?depend0Units=hours+since+2011-10-24&header=none' )
formatDataSet( ds1, 'test042_scalar_noheader_notimetags.txt?depend0Units=hours+since+2011-10-24&header=none' )

formatDataSet( ds1, 'test042_scalar_doDepFalse.txt?doDep=false' )
formatDataSet( ds4, 'test042_scalar_doDepFalse_noheader.txt?doDep=false&header=none' )


from java.io import File
print 'all datasets formatted to workspace.' 
#print 'all datasets formatted to %s.' % File('.').getCanonicalFile()