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
With the current implementation of sounderpy, it is not possible to know if the data downloaded is successful or not. I tried following simple example as reorted in #27 and only changed different time (ahead of current time):-
import sounderpy as spy
data = spy.get_obs_data("vomm", "2024", "09", "13", "12")
spy.build_sounding(data, save=True, filename="sample.png")
This has resulted in following error:
File "/home/sundar/miniconda3/envs/vatavar/lib/python3.11/site-packages/sounderpy/sounderpy.py", line 845, in get_obs_data
sounding_params(clean_data).print_vals()
File "/home/sundar/miniconda3/envs/vatavar/lib/python3.11/site-packages/sounderpy/calc.py", line 572, in print_vals
thermo = self.calc()[1]
^^^^^^^^^^^
File "/home/sundar/miniconda3/envs/vatavar/lib/python3.11/site-packages/sounderpy/calc.py", line 94, in calc
general['sfc_pressure'] = (p[0].m*(1-(0.0065*(general['elevation']))/(T[0].m+(0.0065*(general['elevation']))+273.15))**-5.257)*units.hPa
~^^^
File "/home/sundar/miniconda3/envs/vatavar/lib/python3.11/site-packages/pint/facets/numpy/quantity.py", line 257, in __getitem__
return type(self)(self._magnitude[key], self._units)
~~~~~~~~~~~~~~~^^^^^
IndexError: index 0 is out of bounds for axis 0 with size 0
I think it is due to the fact that cleaning is done as part of the download function. It would be better to separate this clean function and provide api access to user to check if data is downloaded first and then clean the data.
The text was updated successfully, but these errors were encountered:
Here the data did download, noted by the fact that the data is being run through the calc.py module.
Allowing the ability to load in just the 'dirty data' before 'cleaning' is a good idea though. I have an idea on how to do this without disrupting the current API too much.
I will plan to include this in the next upcoming release.
I will close this issue after its been implemented.
I am pretty sure it did not. I placed a download request ahead of current time in UTC. For example, if I provide similar request through browser with following url:-
Where the calc.py module comes into play in spy.get_obs_data() is after the download was completed. As such, the code would never have made it to the line sounding_params(clean_data).print_vals(), that references the calc.py module, if the data wasn't downloaded.
With the current implementation of sounderpy, it is not possible to know if the data downloaded is successful or not. I tried following simple example as reorted in #27 and only changed different time (ahead of current time):-
This has resulted in following error:
I think it is due to the fact that cleaning is done as part of the download function. It would be better to separate this clean function and provide api access to user to check if data is downloaded first and then clean the data.
The text was updated successfully, but these errors were encountered: