More careful bounds checking for temperature and density, using new functions exposed by cloudy_tables