Skip to content

Put x axis values first in CSV#1780

Merged
axelboc merged 2 commits intomainfrom
csv-x
Apr 3, 2025
Merged

Put x axis values first in CSV#1780
axelboc merged 2 commits intomainfrom
csv-x

Conversation

@axelboc
Copy link
Contributor

@axelboc axelboc commented Mar 31, 2025

@Blackclaws in #1619 (comment) correctly pointed out that axis values are expected to come first in CSV exports, like in XY and XYE files. Sorry for missing this in #1763.

NeXus export with axis values

image

NeXus export without axis values

The indices are used so that signal values remain in the second column; the column is labelled x:

image

Basic 1D export

No axis values, no column headers — does that make sense @t20100 @loichuder?

image

@axelboc axelboc force-pushed the csv-x branch 2 times, most recently from 03d195c to d8f9748 Compare March 31, 2025 12:25
@axelboc axelboc requested review from loichuder and t20100 March 31, 2025 12:27
@loichuder
Copy link
Member

I would perhaps add the dataset name as the column header for the basic 1D export?

Comment on lines +34 to +36
csv += isNexus
? `${(abscissaParams.value ? abscissaParams.value[i] : i).toString()},`
: '';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
csv += isNexus
? `${(abscissaParams.value ? abscissaParams.value[i] : i).toString()},`
: '';
if(isNexus) {
csv += `${(abscissaParams.value ? abscissaParams.value[i] : i).toString()},`
}

@axelboc
Copy link
Contributor Author

axelboc commented Apr 2, 2025

I would perhaps add the dataset name as the column header for the basic 1D export?

Okay, so in that case, I can have the indices in the first column to basically end up with a "bare minimal" NeXus export (i.e. NXdata group with only a signal attribute):

image

@loichuder
Copy link
Member

I would perhaps add the dataset name as the column header for the basic 1D export?

Okay, so in that case, I can have the indices in the first column to basically end up with a "bare minimal" NeXus export (i.e. NXdata group with only a signal attribute):

That looks excellent! Good call 👍

@loichuder loichuder self-requested a review April 2, 2025 15:01
Copy link
Member

@loichuder loichuder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me approves again

@axelboc axelboc merged commit 9f9265f into main Apr 3, 2025
8 checks passed
@axelboc axelboc deleted the csv-x branch April 3, 2025 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants