smrt-model / smrt

Snow Microwave Radiative Transfert model to compute thermal emission and backscatter from snowpack
Other
49 stars 20 forks source link

Raise an error if ice density is calculated as negative #8

Closed robbiemallett closed 4 years ago

robbiemallett commented 4 years ago

Currently if the user supplies a porosity value of >1 to make_ice_column, it is passed to bulk_ice_density and a negative density is generated.

When SMRT is called to run, it throws an error because the imaginary part of the permittivity is negative.

This pull request generates an error within the bulk_ice_density function as soon as the density is recognised as negative. I've also changed the docs for make_ice_column to indicate that porosity should be 0-1 and not %.

I ran the test_make_medium.py script and all five tests were passed.

ghislainp commented 4 years ago

Thanks!