Fusion-Data-Platform / fdf

Obsolete FDF repo - see FDP repo for current development
MIT License
2 stars 0 forks source link

odd dim_of behavior for time axis in BES module #17

Closed drsmith48 closed 9 years ago

drsmith48 commented 9 years ago

@ktritz @hyyuh When you get a chance, checkout branch 'bes' and run the following lines:

nstx = Machine(shotlist=141000)
nstx.s141000.bes.ch_01.plot()

You'll see that the time axis in the plot window is array indices, and some diagnostic print()'s in Machine._get_mdsdata() yield:

start: dim of
(0, 3078015)
[0 1 2 3 4 5 6 7 8 9]
end: dim of

Any idea why Machine._get_mdsdata() and bes.xml fail to grab proper time data?

ktritz commented 9 years ago

Hey Dave, I can't find your time data on the MDS tree. How did you get to it from Matlab and/or IDL?

drsmith48 commented 9 years ago

Matlab:

timetag = 'dim_of(\activesp_raw::be_dt32_01:input_01)';
time = mdsvalue(timetag);

IDL:

timetag =  'DIM_OF(\ACTIVESP_RAW::BE_DT32_01:INPUT_01)'
time = mdsvalue(timetag, status=stat1)
ktritz commented 9 years ago

Yeah, for some reason doing that through python doesn't produce the time array, it just gives the indices. Wonder if this is a problem with the MDS client. You're not dividing by your sampling frequency or something later on to get your time array, are you?

ktritz commented 9 years ago

Also, check out my bes.xml in master, you can see how I used the 'range' tag to generate your channels. I also stuck your plot method as the default 1D plot in container which is inherited by all signals because I wanted to use it for USXR too. We may stick default methods somewhere else in the future, but you can use the default for your BES if you want.

drsmith48 commented 9 years ago

@ktritz nope, I'm not modifying the time array. thanks for the range edit. I saw that in usxr, but I didn't know how to start the range at 1.

ktritz commented 9 years ago

Ok, I'll double check to see if it's working for the usxr, which uses the same dim_of language I think. This might be a python client thing, but you would think that this would have been caught and fixed by now if that were the case.

drsmith48 commented 9 years ago

I get the same index list for the time axis with usxr data. it seems dim_of='0' does not return the proper time axis. ip, vloop, and mpts all have separate signal nodes for the time axis and do not use dim_of='0'.

ktritz commented 9 years ago

Ok, sounds like we need to hit up the mdsplus mailing list to find the answer.

ktritz commented 9 years ago

weird, 'dim_of()' seems to work now, and I could have sworn it didn't before. I'll try modifying the code to see if it fixes it.

ktritz commented 9 years ago

yup, tested working for both bes and usxr on the PC and linux.