Skip to content
New issue

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

more api / examples plz ! #5

Open
ghost opened this issue Mar 15, 2019 · 6 comments
Open

more api / examples plz ! #5

ghost opened this issue Mar 15, 2019 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 15, 2019

hi Georgy:
I feel so excited on your Rainymotion project. I believe that it will give me great help in the field of nowcasting.
However, I find it a little bit difficult in preparing suitable input data (as I am a raw hand of python and hdf5 format). Also, I have no idea in choosing the proper functions (i.e. SparseSD or Sparse?) in different conditions.
Could you give a little bit more introduction in the following update of the upcoming tutorial(if there is a upcoming one)?

@hydrogo
Copy link
Owner

hydrogo commented Mar 16, 2019

Hi @IncubatorShokuhou,
thank you for your interest in rainymotion!

rainymotion models require inputs in the form of 3D numpy array (frames, dim_x, dim_y) of radar data for previous timesteps where "frames" dimension must be > 2. After model initialization, you can attribute data to the model via model.input_data. Also, important to attribute Scaler which you think better suits for rainfall data conversion from intensities (or accumulation) to uint8 data type (which is the requirement for optical flow algorithms). You can set up Scaler via model.scaler. Maybe models' docstrings will be more helpful than the documentation (https://github.com/hydrogo/rainymotion/blob/master/rainymotion/models.py).

Thus, first of all, you have to find the way how to read your data to 3D numpy array, and then create a Scaler which fits your data the best (by default you can use our RY_Scaler, or try MinMaxScaler from the sklearn library).

As for the choice of different models we recommend you to try all of them on your data :-) For Germany, the Dense model works the best (see our paper for particular evaluation results).

At the moment, we focus on our paper revision and have no plans for an additional tutorial. If data you use is open, you can send us the link, and we will try our best to help you with preprocessing.

Best,
Georgy

Our paper:
Ayzel, G., Heistermann, M., and Winterrath, T.: Optical flow models as an open benchmark for radar-based precipitation nowcasting (rainymotion v0.1), Geosci. Model Dev. Discuss., https://doi.org/10.5194/gmd-2018-166, in review, 2018.

@ElmerJeanpierreLopez
Copy link
Contributor

Hi @IncubatorShokuhou

I already created an example to ilustrate how to use this library. Nevertheless, don't let be fooled by the example. I say this because data corresponds a light drizzly, so it's normal obtain bad results starting from this data. After all, I hope this example serve to you to fammiliarize with rainymotion

Example:
https://github.com/ElmerJeanpierreLopez/nowcasting_examples/blob/master/Nowcasting_Rainymotion.ipynb

@GiovanniVignoli95
Copy link

Hi Elmer, thanks for yout example!!
I have a question.
When you rune the model, where are the results saved? In which format?
Could you send me your input file?

Thanks you

Giovanni

@ElmerJeanpierreLopez
Copy link
Contributor

Hi @GiovanniVignoli95

Results are not saved, model.run() returns an array-like that contains the predicted data. About the input file, it's available in the same repository. If you want to run the code, just change the file direction.

@GiovanniVignoli95
Copy link

Thanks you @ElmerJeanpierreLopez !!
But if I want to reuse the output array, where do I find it?
If I use (with Dense for example)

#import Dense

from rainymotion.models import Dense

model = Dense()

#enter the right path

model.input_data = h5py.File("..............", "r")

nowcast = model.run()

There are no error, but what do I get?

Thank
Giovanni

@ElmerJeanpierreLopez
Copy link
Contributor

Hello again @GiovanniVignoli95
You have a big mistake, because you need to pass an array-like with 3 dimentions and instead you pass an instance of the h5py class. So, your code, I guess doesn't work. As I said, you get an array like (object of numpy.ndarray). For the previous example, nowcast contains the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants