You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which worked, but I am suspicious of how multiple values for zt and zu are used. This behavior is not documented since we say the only allowed int types for those inputs. From the above we get two output values that are identical (here for the latent heatflux as example)
This seems fishy to start with, as I would expect the vastly different values for the height to produce different outputs (when all other inputs are kept identical).
We actually get different results for the different height inputs
What seems to happen is that in the original case something in our code is silently taking the first value of zt and zu and applying that to all data.
For context this was brought up in the context of #79 by @juliasimpson97 who wants to use aerobulk-python for observational data. This data can be described as a timeseries of inputs where the height of measurement is also varying in time (hence is provided as a dataarray of equal length).
I think that for that specific use case, we might possibly run up agains the way aerobulk (the fortran code) is set up - it is very much designed for model datasets where the height for a large 2/3 d array is going to be a constant.
A short solution for @juliasimpson97 could be to loop over all the values, calculate them one by one, and concatenate the results. This will be slow, but the other way of doing this seems to produce results that are incorrect.
In the longer run we need to see if there is a way to replicate this solution as part of the .apply_ufunc call and thus allow xr.Dataarray input for zt/zu. If that is not possible/desired we might consider at least warning the user about this and adding an explicit check for those inputs.
The text was updated successfully, but these errors were encountered:
Looking at the above, are you sure that you're calling different values to create ql_0, qh_0, tau_0, tauy_0, evap_0 as opposed to ql_1, qh_1, tau_1, tauy_1, evap_1? it looks like sst/all the inputs are unchanged?
Looking at the above, are you sure that you're calling different values to create ql_0, qh_0, tau_0, tauy_0, evap_0 as opposed to ql_1, qh_1, tau_1, tauy_1, evap_1? it looks like sst/all the inputs are unchanged?
Yes that is intentional. In the first example both datapoints only differ in the height input, and return the exact same value.
The other test cases show that these different height values should actually produce different values (compare q1 to q0). I admit, its a bit confusing that both return two values each, but basically just compare the first value of q0 with the first value of q1, those are the two (distinct) values I would have expected from the output of the initial code.
I just ran this example:
Which worked, but I am suspicious of how multiple values for
zt
andzu
are used. This behavior is not documented since we say the only allowed int types for those inputs. From the above we get two output values that are identical (here for the latent heatflux as example)This seems fishy to start with, as I would expect the vastly different values for the height to produce different outputs (when all other inputs are kept identical).
Indeed when running some further tests:
We actually get different results for the different height inputs
What seems to happen is that in the original case something in our code is silently taking the first value of
zt
andzu
and applying that to all data.For context this was brought up in the context of #79 by @juliasimpson97 who wants to use aerobulk-python for observational data. This data can be described as a timeseries of inputs where the height of measurement is also varying in time (hence is provided as a dataarray of equal length).
I think that for that specific use case, we might possibly run up agains the way aerobulk (the fortran code) is set up - it is very much designed for model datasets where the height for a large 2/3 d array is going to be a constant.
A short solution for @juliasimpson97 could be to loop over all the values, calculate them one by one, and concatenate the results. This will be slow, but the other way of doing this seems to produce results that are incorrect.
In the longer run we need to see if there is a way to replicate this solution as part of the .apply_ufunc call and thus allow xr.Dataarray input for
zt
/zu
. If that is not possible/desired we might consider at least warning the user about this and adding an explicit check for those inputs.The text was updated successfully, but these errors were encountered: