Q2: Are there any other contributions to these NaN values from the algorithm that created the NXSPE file?
Q3: When normalizing/binning the data (to get phonon dispersions/lineshapes) , what should we do with these NaN values? Count them in as zeros or simply ignore them?
1 and 2. Yes - the NaN in the files most probably comes from masked detectors. I can’t think of another reason for the reduction routines to put NaNs in. Certainly if in the data table you see entire rows which are NaNs then this means that row is a masked detector. If it’s just a single element which is a NaN, then I don’t know where it comes from…
I think you should ignore the NaN values - definitely you should not treat them as zeros because that would skew the averages. Zero counts should be stored as zero intensity values (and zero error value) in the NXSPE files. If you’re rebinning and the new bins contain only NaN’s then the new bin should be a NaN, otherwise it should only contain the counts of the non-NaN old bins.