Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing type attributes for fields: "variable", "qx", "qy" causing default to incorrect NX_CHAR? #889

Closed
RussBerg opened this issue Mar 22, 2021 · 9 comments · Fixed by #890

Comments

@RussBerg
Copy link
Contributor

when no field type attribute is given the default is NX_CHAR correct? the 3 fields in question do not specify a field type so the result is somewhat ambiguous to me as the default to NX_CHAR types, when it looks like they should be NX_INT or NX_FLOAT.
...

            <field name="variable" axis="1">
              <dimensions rank="1">
                <dim index="1" value="nVars" /></dimensions>
              <attribute name="varied_variable">
                <doc>The real name of the varied variable in the first dim of data, temperature, P, MF etc...</doc></attribute></field>
            <field name="qx" axis="2">
              <doc>Values for the first dimension of Q</doc>
              <dimensions rank="1">
                <dim index="1" value="nQX" /></dimensions></field>
            <field name="qy" axis="3">
              <doc>Values for the second dimension of Q</doc>
              <dimensions rank="1">
                <dim index="1" value="nQY" /></dimensions></field>
@prjemian
Copy link
Contributor

Keep in mind this should be able to describe raw 1-D SAS data.

@rayosborn
Copy link
Contributor

If NeXus does define a default dtype, my guess is that it should be NX_FLOAT. It would make no sense for it to be NX_CHAR, particularly if the field is an array.

@RussBerg
Copy link
Contributor Author

I base the assumption that the default is NX_CHAR solely on the fact that the documentation for the NXiqproc
https://manual.nexusformat.org/classes/applications/NXiqproc.html#nxiqproc
explicitly says NX_CHAR but the nxdl file does not declare any type so I may be assuming too much?.

@prjemian
Copy link
Contributor

Excuse me, not specifically SAS, but any general $I(Q)$ data.

@prjemian
Copy link
Contributor

The default type, when not specified is NX_CHAR.

@RussBerg
Copy link
Contributor Author

so Pete then in this case it would make more sense that the variables explicitly specify a type attribute right?

@prjemian
Copy link
Contributor

Like NX_NUMBER?

@prjemian prjemian added this to the NXDL 2021.10 milestone Mar 22, 2021
@RussBerg RussBerg changed the title NXiqproc: missing type attributes for fields: "variable", "qx", "qy" causing default to incorrect NX_CHAR? missing type attributes for fields: "variable", "qx", "qy" causing default to incorrect NX_CHAR? Mar 22, 2021
@RussBerg
Copy link
Contributor Author

also found similar issue with NXsqom definition where there are fields declared that specify units but will default to type NX_CHAR:

        <doc>Positions for the first dimension of Q</doc>
        <dimensions rank="1">
          <dim index="1" value="nP"/>
        </dimensions>
      </field>
      <field name="qy" axis="1" units="NX_WAVENUMBER">
        <doc>Positions for the the second dimension of Q</doc>
        <dimensions rank="1">
          <dim index="1" value="nP"/>
        </dimensions>
      </field>
      <field name="qz" axis="1" units="NX_WAVENUMBER">
        <doc>Positions for the the third dimension of Q</doc>
        <dimensions rank="1">
          <dim index="1" value="nP"/>
        </dimensions>
      </field>

I propose to add type=NX_NUMBER 

```<field name="qx" axis="1" type="NX_NUMBER" units="NX_WAVENUMBER">
        <doc>Positions for the first dimension of Q</doc>
        <dimensions rank="1">
          <dim index="1" value="nP"/>
        </dimensions>
      </field>
      <field name="qy" axis="1" type="NX_NUMBER" units="NX_WAVENUMBER">
        <doc>Positions for the the second dimension of Q</doc>
        <dimensions rank="1">
          <dim index="1" value="nP"/>
        </dimensions>
      </field>
      <field name="qz" axis="1" type="NX_NUMBER" units="NX_WAVENUMBER">
        <doc>Positions for the the third dimension of Q</doc>
        <dimensions rank="1">
          <dim index="1" value="nP"/>
        </dimensions>
      </field>

@RussBerg
Copy link
Contributor Author

changes were merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants