We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import dask.config import dask.array as da import numpy as np from satpy.tests.utils import CustomScheduler from pyspectral.near_infrared_reflectance import Calculator with dask.config.set(scheduler=CustomScheduler(max_computes=0)): calc = Calculator("Meteosat-10", "seviri", 3.9) sunz = da.array([80.], dtype=np.float32) tb3 = da.array([290.], dtype=np.float32) tb4 = da.array([282.], dtype=np.float32) res = calc.reflectance_from_tbs(sunz, tb3, tb4) assert res.dtype == np.float32
If the input data passed to Calculator are as float32, the return value is upcast to float64 by the calculator.
Calculator
float32
float64
Get the NIR reflectance with the same dtype as the inputs.
dtype
Result has dtype=np.float64.
dtype=np.float64
Python 3.11, current Pyspectral main, current Satpy main.
main
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Code Sample, a minimal, complete, and verifiable piece of code
Problem description
If the input data passed to
Calculator
are asfloat32
, the return value is upcast tofloat64
by the calculator.Expected Output
Get the NIR reflectance with the same
dtype
as the inputs.Actual Result, Traceback if applicable
Result has
dtype=np.float64
.Versions of Python, package at hand and relevant dependencies
Python 3.11, current Pyspectral
main
, current Satpymain
.The text was updated successfully, but these errors were encountered: