Friday, November 26, 2021

Sunday, November 21, 2021

Rip current detection

 

[1] Correntes de retorno https://www.youtube.com/watch?v=yKvDOzvjApE

[2] Rip Current  https://www.youtube.com/watch?v=RJ4hcaJ91TY

[3] Paper 2021 https://arxiv.org/pdf/2102.02902.pdf

 

Tuesday, November 16, 2021

3D grid savig methods using struct.pack

 

Python version for ints
def save2grid(filename,volume,dimx,dimy,dimz):

  with open(filename, "wb") as file:
    for i in range(dimx):
      for j in range(dimy):
        for k in range(dimz):
          f = (volume[i][j][k]*255).astype(np.uint8) #numpy.uint8
          #print(type(f))
          b = struct.pack('B', f)  #was f
          file.write(b)
          
def save2gridfast(filename,volume,dimx,dimy,dimz):
  flat=volume.reshape((dimx*dimy*dimz))
  flat=(flat*255).astype(np.uint8)
  with open(filename, "wb") as file:
       b = struct.pack('%sB' % len(flat), *flat)
       file.write(b) 

Python version for floats

def save2grid(filename,volume,dimx,dimy,dimz):

  with open(filename, "wb") as file:
    for i in range(dimx):
      for j in range(dimy):
        for k in range(dimz):
          f = volume[i][j][k] #[3.14, 2.7, 0.0, -1.0, 1.1]
          b = struct.pack('f', f)
          file.write(b)
def save2grid2(filename,volume,dimx,dimy,dimz):
  flat=volume.reshape((dimx*dimy*dimz))
  with open(filename, "wb") as file:
    for i in range(dimx*dimy*dimz):
       f = flat[i]
       b = struct.pack('f', f)
       file.write(b)
def save2grid3(filename,volume,dimx,dimy,dimz):
  flat=volume.reshape((dimx*dimy*dimz))
  with open(filename, "wb") as file:
       b = struct.pack('%sf' % len(flat), *flat)
       #b = struct.pack('f', f)
       file.write(b)

Update Chrome in Ubuntu

 


# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome

wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update 
sudo apt-get install google-chrome-stable


# Update

sudo apt-get --only-upgrade install google-chrome-stable

Sunday, November 14, 2021

Time series forecasting

To review

 

[1] https://machinelearningmastery.com/how-to-develop-lstm-models-for-time-series-forecasting/

[2] https://www.tensorflow.org/tutorials/structured_data/time_series

[3] https://analyticsindiamag.com/tutorial-on-univariate-single-step-style-lstm-in-time-series-forecasting/

[4] https://towardsdatascience.com/multivariate-time-series-forecasting-with-transformers-384dc6ce989b

 

 

Firefox open multiple private window

    /opt/firefox/firefox-bin --profile $(mktemp -d) --private-window www.google.com www.bing.com