-
Notifications
You must be signed in to change notification settings - Fork 132
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
Question on variable "date" #47
Comments
Regarding generating the json file, the gfs data looks like:
the latitude values are ordered from -90 to 90, in you json file you have la1=90, la2=-90. Does this mean I need to reverse my array before dumping it to json, OR can I just set la1=-90.0, la2=90.0 and your code will handle it correctly? What value should I place in the data for the fill_value? EDIT: ignore fill_value as it looks like filling is off for this variable. |
|
Here is my Python3 script to fetch and generate a wind json file: So this fixes the issue of the rotated particle trails mentioned above. Also in case you have not seen this post: |
Can you point out where in the code I can control the density of or number of particles that are displayed? EDIT: Well, after looking around some , it looks like it can be set via the input params when the layer is created. I'll need to play around with the values to see how it changes stuff. Also not sure which parameter does what. |
I have been comparing https://windy.com using the GFS layer against the same data loaded into your animator and it seems that most of your animation is roughly rotated 90 deg clockwise from the Windy vectors. IE: if the windy particles are moving SW your particles are moving NW. This could be caused by inverting the data in latitude because of your max(la1, la2) and not changing the sign on dy. |
Ok, sorry to pester you with lots of questions. I have thought about this a little and the wave data has period, height and direction at each lat/lon. I think we could represent this in the animation by creating rectangles where the period is mapped to the thickness of the rectangle, the height is mapped to the color of the rectangle, and direction is mapped to the orientation of the rectangle. Alternatively, period could be mapped to how long the rectangle is displayed, for example long period waves would blink on/off slower than the short period waves. Does this make sense from the point of view of building the display to animate? |
@woodbri Hi~~~ dx: Increment in X direction, cannot be negative
dy: Increment in Y direction, cannot be negative
nx: cols
ny: rows
lo1: xmin
lo2: xmax
la1: ymin
la2: ymax
parameterCategory: 主要用于表示类型
parameterNumber: https://github.com/sakitam-fdd/wind-layer/blob/master/src/windy/windy.js#L92
colorScale: [ // Color configuration. The rendered color is based on the wind speed range and the given color array. You can see the [code](https://github.com/sakitam-fdd/wind-layer/blob/95368f9433/src/windy/windy.js#L385) for this
"rgb(36,104, 180)",
],
minVelocity: 0, // velocity at which particle intensity is minimum (m/s)
maxVelocity: 10, // velocity at which particle intensity is maximum (m/s)
velocityScale: 0.005, // scale for wind velocity,In fact, it's ultimately related to the scope of the view (https://github.com/sakitam-fdd/wind-layer/blob/95368f9433/src/windy/windy.js#L342)
particleAge: 90, // max number of frames a particle is drawn before regeneration
lineWidth: 1, // line width of a drawn particle
particleMultiplier: 1 / 300, // particle count scalar, In fact, it just calculates the number of particles as a coefficient(https://github.com/sakitam-fdd/wind-layer/blob/95368f9433/src/windy/windy.js#L399)
|
1., 2. Thank you for the documentation. That is very helpful.
So back to the wave implementation ideas, I will try to explain how I think the data can be mapped into the current animation engine, with only a high-level understanding the details of that engine.
These parameters are based on observing windy.com So one question is my mind is what is the best format to encode the wave data into json to make it easy to work with and keeps the json file a reasonable size. Another interesting thing I noticed on windy, is that they use a background fill color and render their particles in white. This is a very nice effect. I guess, I need to find a good webgl tutorial so I can read up on it. |
@woodbri As for the new functions, I'd like to try to implement them. And here are some interesting projects that you can play 😄 . |
FYI, Openlayers 6 now has some basic support for webgl in its API, but rewriting this to work in webgl would be a TOTAL rewrite and is probably a separate project all together. I'm looking at astrosat/windgl and seeing if I can map some of those ideas into OL6 but it might be beyond my current skills. |
@sakitam-fdd I notice you have a variable "date" seen here:
https://github.com/sakitam-fdd/wind-layer/blob/master/dist/OlWindy.esm.js#L73
https://github.com/sakitam-fdd/wind-layer/blob/master/dist/OlWindy.esm.js#L138
https://github.com/sakitam-fdd/wind-layer/blob/master/dist/OlWindy.esm.js#L160
This does not seem to be used anywhere. Is this correct?
At L138, you expect
header.refTime
andheader.forecastTime
so I need to have them in my header in the json file. I'm asking because I am writing a python script to fetch gfs data from:And then generating the windy.json file so I can run in a crontab to generate an file that can be used to load the animation layer.
The text was updated successfully, but these errors were encountered: