Code Monkey home page Code Monkey logo

tropcyc's Introduction

Tropical cyclone YT content and scripts

Installation of manim

only linux based installation is discussed

  1. cloning and installing from official git repo
  2. simple way is creating an venv (virtual envio) in the same folder and using for manim
git clone https://github.com/3b1b/manim.git
python3 -m venv ./
source bin/activate
pip3 install -r requirement.txt
python3 -m pip install -r requirements.txt
  1. additionally add the env manim to the bashrc

Running Manim

General command

python3 -m manim pythonFile.py className -args

classNames

Manim programs have a certain structure. The Python program file requires you to make classes for all your series of animations. If you make more than a few classes, you have to run commands for every class you make. Seperate videos are made for every class

Args

Args are a list of arguements that can be stated when running the program. The most important agruements and it's explanations are provided in the GO TO GUIDE. I recommend to look at it later, and start with the tutorial.

tropcyc's People

Contributors

nmathewa avatar nirmalalex avatar

Watchers

 avatar

tropcyc's Issues

Data Collection

  • Sea surface temperature
  • low level vorticity
  • mid tropospheric humidity
  • surface pressure
  • wind shear

Annular area average over the cyclone tracks

def angular_average(var_dset,lat,lon,vertical=False):
    latmin = int(lat) - 10
    latmax = int(lat) + 10
    lonmin = int(lon) - 10
    lonmax = int(lon) + 10
    center = (lat,lon)
    
    
    lats = np.arange(latmin,latmax,0.25)
    lons = np.arange(lonmin,lonmax,0.25)
    
    #print(len(lats))
    #print(len(lons))
    
    lat_mesh,lon_mesh = np.meshgrid(lats,lons)

    radius = 1000
    
    distances = np.sqrt((center[0] - lat_mesh)**2 + (center[1] - lon_mesh)**2)
    
    n_distance = distances * 111

    #print(distances.shape)
    
    dist_cond = n_distance <= radius
    
    cond_array = xr.DataArray(dist_cond,dims=['latitude','longitude'])

    if vertical == True:
        var_dset_sub = var_dset.sel(latitude=lats,longitude=lons,method='nearest').mean(dim='level')
    elif vertical == False:
        var_dset_sub = var_dset.sel(latitude=lats,longitude=lons,method='nearest')
        
        
    masked_var_data = var_dset_sub.where(cond_array)
    
    annul_mean = masked_var_data.mean()
    
    return annul_mean

```python

NAN values interpolation (or extrapolation)

Issue 1

  • NAN values exist in the dataset (since sst is only over ocean)

Method 1

The missing values can be filled using linear extrapolation methods

image

def extrapolate_fields(dset):
    try :
        dset_n = dset.reindex(latitude=list(reversed(dset.latitude)
                                        )).interpolate_na(dim='latitude',
                                                          fill_value="extrapolate"
                                                          ).interpolate_na(
                                                              dim='longitude',
                                                              fill_value="extrapolate")
    
    except ValueError:
        dset_n = dset.interpolate_na(dim='latitude',fill_value="extrapolate"
                                                              ).interpolate_na(
                                                                  dim='longitude',
                                                                  fill_value="extrapolate")
    return dset_n

Array vs Images

Two options for data preprocessing

  1. use plotted images (which is interpolated) eg: generated using matplotlib contourfill plots
  2. Images without interpolation (eg: using cv2)
  3. actual data as numpy arrays

LSTM-CNN issues

To Do

  • Run the CNN only network
  • Run the LSTM only network
  • Combined LSTM-CNN network

Dirty codes [Bucket list]

i_ib = group
    print(group['SID'].iloc[0])
    for ii in range(len(i_ib)):
        lat = i_ib['LAT'].iloc[ii]
        lon = i_ib['LON'].iloc[ii]
        time = i_ib['datetime'].iloc[ii]
        lead = i_ib['lead'].iloc[ii]
        try :
            in_data = sh_data.sel(time=time)
        except KeyError:
            print('Time not found')
            continue
        for ii in rh.latitude.values:
            if ii in i_ib.LAT:
                pass
            
            else:
                continue
        
        for jj in rh.longitude.values:
            if jj in i_ib.LON:
                pass
            
            else:
                continue
        
            
        aoi = prepro_features()
        
        
        try:
            rh = aoi.angular_imgs(var_dset=sh_data,lat=lat,lon=lon,box=True)
            rh = extrapolate_fields(rh)
        except ValueError:
            continue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.