Skip to content

Commit

Permalink
Change default units for NUCAPS H2O to g/kg
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Mar 22, 2016
1 parent caa66f2 commit 1956673
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions etc/readers/nucaps.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ pressure_based=true
[file_key:h2o]
variable_name=H2O
pressure_based=true
file_units=g/g
units=g/kg

[file_key:longitude]
variable_name=Longitude
Expand Down
5 changes: 5 additions & 0 deletions satpy/readers/nucaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ def adjust_scaling_factors(self, factors, file_units, output_units):
factors[::2] = np.where(factors[::2] != -999, factors[::2] * 10000.0, -999)
factors[1::2] = np.where(factors[1::2] != -999, factors[1::2] * 10000.0, -999)
return factors
elif file_units == "g/g" and output_units == "g/kg":
LOG.debug("Adjusting scaling factors to convert '%s' to '%s'", file_units, output_units)
factors[::2] = np.where(factors[::2] != -999, factors[::2] * 1000.0, -999)
factors[1::2] = np.where(factors[1::2] != -999, factors[1::2] * 1000.0, -999)
return factors
elif file_units == "1" and output_units == "%":
LOG.debug("Adjusting scaling factors to convert '%s' to '%s'", file_units, output_units)
factors[::2] = np.where(factors[::2] != -999, factors[::2] * 100.0, -999)
Expand Down

0 comments on commit 1956673

Please sign in to comment.