def update_histogram(self):
        rawdata = map(lambda x: (x==0)*1 + (x!=0)*x, 
                     self.writer.get_return_num())
        #if self.version == "1.3":
        #    histDict = {1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0}
        #elif self.version in ["1.0", "1.1", "1.2"]:
        #    histDict = {1:0, 2:0, 3:0, 4:0, 5:0}
        #else:
        #    raise LaspyException("Invalid file version: " + self.version)
        #for i in rawdata:
        #    histDict[i] += 1        
        #raw_hist = histDict.values()
        #if self.data_format_id in (range(6)):
        if self.version != "1.4":
            raw_hist = np.histogram(rawdata, bins = range(1,7))
            
        else:
            raw_hist = np.histogram(rawdata, bins = range(1,17)) 
        #print("Raw Hist: " + str(raw_hist))
        #t = raw_hist[0][4]
        #for ret in [3,2,1,0]:
        #    raw_hist[0][ret] -= t
        #    t += raw_hist[0][ret]
        try:
            self.writer.set_header_property("point_return_count", raw_hist[0])
        except(util.LaspyException):
            raise util.LaspyException("There was an error updating the num_points_by_return header field. " + 
        "This is often caused by mal-formed header information. LAS Specifications differ on the length of this field, "+ 
        "and it is therefore important to set the header version correctly. In the meantime, try File.close(ignore_header_changes = True)" 
        )
Update the histogram of returns by number
dataset/ETHPy150Open grantbrown/laspy/laspy/header.py/HeaderManager.update_histogram