Skip to content

Need to deal with npts=0 data in a consistent way #106

Description

@mdecleir

In some parts of the code, unit transformations and other calculations are done on both the good data (npts>0) and the bad data (npts=0). However, in other parts, the npts=0 data are ignored. In the example below, the extinction values will be converted from E(lambda-V) to E(lambda-V)/E(B-V) for all data (npts=0 and >0), but the uncertainties are only converted for good data (npts>0). We should discuss what the goal is of the npts=0, and if we want to make sure that all calculations still propagate correctly for those data, or if we want to completely ignore those data throughout, or if we want to set extinctions and uncertainties to 0 for those data, etc. Once a decision has been made, this should be applied consistently throughout the code.

Also, special considerations need to be made for the V-band (see issue #105).

# only compute where there is data and exts is not zero
gvals = (self.exts[curname] != 0) & (self.npts[curname] > 0)
self.uncs[curname][gvals] = (self.exts[curname][gvals] / fullebv[0]) * np.sqrt(
np.square(self.uncs[curname][gvals] / self.exts[curname][gvals])
+ np.square(fullebv[1] / fullebv[0])
)
self.exts[curname] /= fullebv[0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions