das-developers / das2java

The original das2 library. Provides interactive publication-ready 2-D plotting
https://das2.org
GNU Lesser General Public License v3.0
4 stars 0 forks source link

QDataSet BUNDLE dependency ambiguity #107

Open jbfaden opened 2 months ago

jbfaden commented 2 months ago

QDataSet's bundle is used to make a set of correlated datasets (Juno density, fce, bmag, mlt) and also a color plot of X,Y → Z. When rendering the first one, we would like a stack of traces vs time. When rendering the second, we would like a color scatter plot. The two datasets are so similar in form that one is often mistaken for the other.

When bundling three rank 1 time series datasets, I was expecting to get the stack of three traces against time, and I forgot that you must manually assert the DEPEND_0 for the bundle to get this behavior.

I'm not sure if this is a documentation issue, or if there should be a new method which is more deliberate. It's also tempting to have the bundle command add the DEPEND_0 property automatically when each dataset has the same DEPEND_0, but I'm sure that would break some people's scripts. This ticket is to address the ambiguity.


BXYZ= getDataSet('vap+hapi:https://cdaweb.gsfc.nasa.gov/hapi?id=AC_K0_MFI&timerange=2024-04-20&parameters=Time,BGSEc')
BX= unbundle(BXYZ,0)
BY= unbundle(BXYZ,1)
BZ= unbundle(BXYZ,2)

ds= bundle( BX, BY, BZ )

plot( 0, ds, ytitle='color scatter' )

ds= bundle( BX, BY, BZ )
ds= dataset( xtags(BX),ds )

plot( 1, ds, ytitle='time series bundle' )
jbfaden commented 2 months ago

See also https://sourceforge.net/p/autoplot/bugs/2555/