IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 5, 2016, 3:13:44 PM (11 years ago)
Author:
eugene
Message:

getKeyFloat should return NULL for missing or NAN header values: NULLs are converted to -999 on output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/batch.py

    r39148 r39302  
    239239    '''
    240240    def getKeyFloat(self, header, format, key):
    241 
    242          if key in header:
    243              value = float(format % float(header[key]))
    244          else:
    245              self.logger.errorPair("Missing header field", key)
    246              value = float(format % -999.9)
    247 
    248          return value
     241       
     242        # note header[key] will contain "NULL" if the header had NaN
     243        if key in header:
     244            if (header[key] == "NULL"):
     245                value = "NULL"
     246            else:
     247                value = float(format % float(header[key]))
     248        else:
     249            self.logger.errorPair("Missing header field", key)
     250
     251            # value = float(format % -999.9)
     252            value = "NULL"
     253           
     254        return value
    249255
    250256    '''
Note: See TracChangeset for help on using the changeset viewer.