olmozavala / particleviz

Software to generate visualizations of large number of particles from Lagrangian output.
MIT License
10 stars 6 forks source link

Lines cross the screen for particles moving between 180 and -180 #16

Open olmozavala opened 2 years ago

olmozavala commented 2 years ago

When PV displays lines of locations that are crossing from 180 to -180 or vice-versa, a line crossing the map appears. After brainstorming we consider the best opinion is not to display that single line. One way to do it is during the preprocessing step at /https://github.com/olmozavala/particleviz/blob/master/ParticleViz_DataPreproc/PreprocParticleViz.py#71 identify the particles that will have this behaviour and include them in the bit_dispaly_array.

philippemiron commented 2 years ago

Adding this in drawParticlesAsLines():

if(disp_part && (Math.abs(clon-nlon)<180)){
}

and for the case without NaN

if (Math.abs(clon-nlon)<180){

fixes the problem.

If we do this in the preprocessing, it might be a bit cleaner, probably faster, but then we will need the extra data_int because we are adding NaN to the longitude and latitude. What do you think?