87
       Arulalan.T       Final Year MCA       Saveetha Engg College

Contour Ilugc Demo Presentation

Embed Size (px)

Citation preview

Page 1: Contour Ilugc Demo Presentation

        Arulalan.T

       Final Year MCA

       Saveetha Engg College

Page 2: Contour Ilugc Demo Presentation

Project Title              

            Contour Analysis And                        Visualization

Guide

    Mr.Thyagarajan Shanmugham

Page 3: Contour Ilugc Demo Presentation

Thanks To . . .              

            Mr.Charles Doutriaux                      CDAT Developer 

       Dr. Krishna AchutaRao          Center for Atmospheric Science  

IIT Delhi

Page 4: Contour Ilugc Demo Presentation

             

            CDAT              Climate Data Analysis Tool

Page 5: Contour Ilugc Demo Presentation

Installation 

Working in Cdat

Edit Cdat Map

Isolines

NetCDF

Demo on creating current isotherm lines over on India map 

Page 6: Contour Ilugc Demo Presentation

System requirement

 Hardware

  * Dual Core Intel 2 Ghz Processor Machine  * Decent Broadband Connection

Software

  * A linux distro ­ in my case Ubuntu 9.10  * CDAT

* Dependencies of CDAT 

Page 7: Contour Ilugc Demo Presentation

Dependencies :

# bison *# byacc *# flex *# gawk *# g++# gfortran (for contrib packages)# libxt­dev# libx11­dev# tcsh (just highly recomended)# xorg­dev (also called xserver­xorg­dev)#libpng (1.1 or later ) and freetype (1.4 or later)

Page 8: Contour Ilugc Demo Presentation

Installation :

export CC=gccexport FC=gfortranexport CXX=g++

svn export http://www­pcmdi.llnl.gov/svn/repository/cdat/tags/5.2    cdat­5.2­src

./configure ­­prefix=/usr/local/cdat5.2/                         ­­with­externals=/usr/local/cdat5.2/cdat_ext.

sudo make

Page 9: Contour Ilugc Demo Presentation

Cdat Working Directory :

# You can now start CDAT with the command

$ cd /usr/local/cdat5.2/bin

$ ./cdat

Page 10: Contour Ilugc Demo Presentation

Cdat Working Directory :

# You can now start CDAT with the command

$ cd /usr/local/cdat5.2/bin

$ ./cdat

Page 11: Contour Ilugc Demo Presentation

Example Program

Page 12: Contour Ilugc Demo Presentation

#sample.py

import vcs, cdms2, cdutil, time, os, sysimport time

v = vcs.init()

filepath = os.path.join(sys.prefix,'sample_data/clt.nc')cdmsfile = cdms2.open( filepath )

cf_asd = v.getboxfill( 'ASD' )cf_asd.datawc(1e20,1e20,1e20,1e20) cf_asd.level_1=1e20        cf_asd.level_2=1e20         cf_asd.color_1=240        cf_asd.color_2=240  

data = cdmsfile('clt', longitude=(­180, 180), latitude = (­180., 180.)) 

#data = cdmsfile('clt', longitude=(60, 100), latitude = (5., 40.))  # For India

v.plot( data,cf_asd )

Page 13: Contour Ilugc Demo Presentation

 Cdat   World Map ­ Outline

Page 14: Contour Ilugc Demo Presentation

   Cdat   India Map ­ Outline

Page 15: Contour Ilugc Demo Presentation

#sample1.py

import vcs, cdms2, cdutil, time, os, sysimport time

v = vcs.init()

filepath = os.path.join(sys.prefix,'sample_data/clt.nc')cdmsfile = cdms2.open( filepath )

cf_asd = v.getboxfill( 'ASD' )cf_asd.datawc(1e20,1e20,1e20,1e20) cf_asd.level_1=1e20        cf_asd.level_2=1e20         cf_asd.color_1=240        cf_asd.color_2=240  

data = cdmsfile('clt', longitude=(­180, 180), latitude = (­180., 180.)) 

#data = cdmsfile('clt', longitude=(60, 100), latitude = (5., 40.))  # For Indiav.plot( data,cf_asd , continents=4 )

Page 16: Contour Ilugc Demo Presentation

     Cdat   World Map ­ Continents

Page 17: Contour Ilugc Demo Presentation

       Cdat   India Map ­ Continents

Page 18: Contour Ilugc Demo Presentation

How To Edit Cdat Map

Page 19: Contour Ilugc Demo Presentation

Our Indian Political Map wrongly depicted in CDAT as below

Page 20: Contour Ilugc Demo Presentation

1) Correcting the Pakistan part , which belongs to India

2) Correcting the part of the land which is occupied by the Chinese in the state of jammu and kashmir

While asking help from Mr.Charles Doutriaux [ CDAT ­ Developer ] regarding edit map in cdat, he gave the source data of cdat world map in .shp binary file.

Page 21: Contour Ilugc Demo Presentation

#make_world_co­ordinates.py

import vcsaddons

v = vcs.init()

world_continents = vcsaddons.continents.Guc(x=v)

data = world_continents.load_shapefile('/home/arul/Desktop/WORLD_COUNTRIES.shp')

#wrting the data into out.txt file

fileiter=open("/home/arul/Desktop/out.txt","w")print >> fileiter, data[:]fileiter.close()

Page 22: Contour Ilugc Demo Presentation

200 1 59.790276 83.623596 ­72.830238 ­12.204896 60.238045 ­43.12388660.174297 ­43.10916960.110275 ­43.08666260.082497 ­43.12444360.019024 ­43.14041959.989437 ­43.19347059.992493 ­43.23889260.023605 ­43.33111659.972763 ­43.35889459.928326 ­43.39583259.903320 ­43.50194559.954636 ­43.48825859.914711 ­43.57277759.947212 ­43.72471659.877213 ­43.65388559.804436 ­43.84972459.790276 ­43.90222259.811661 ­44.00695059.800545 ­44.06194359.813538 ­44.109722

There are more than one lakh lines like this. 

These are x,y co­ordinate points. 

Simply says, these are Latitude and Longitude values of the whole [real] world.

 out.txt

Page 23: Contour Ilugc Demo Presentation

My  Hacks On Cdat Map

Page 24: Contour Ilugc Demo Presentation

Over World

Page 25: Contour Ilugc Demo Presentation

  Over  India

Page 26: Contour Ilugc Demo Presentation
Page 27: Contour Ilugc Demo Presentation

My  Construction On           Cdat India Map

Page 28: Contour Ilugc Demo Presentation
Page 29: Contour Ilugc Demo Presentation
Page 30: Contour Ilugc Demo Presentation
Page 31: Contour Ilugc Demo Presentation
Page 32: Contour Ilugc Demo Presentation
Page 33: Contour Ilugc Demo Presentation

Finally

Page 34: Contour Ilugc Demo Presentation

Our India

Page 35: Contour Ilugc Demo Presentation

Now we have to save as the modified  out.txt  file                  i.e WorldContinent.shp's  text file in the name of                             “data_continent_other7” in the path                                          “/home/arul/PCMDI_GRAPHICS/”

v.plot( data,cf_asd , continents=6 )

Page 36: Contour Ilugc Demo Presentation

#sample2.py

import vcs, cdms2, cdutil, time, os, sysimport time

v = vcs.init()

filepath = os.path.join(sys.prefix,'sample_data/clt.nc')cdmsfile = cdms2.open( filepath )

cf_asd = v.getboxfill( 'ASD' )cf_asd.datawc(1e20,1e20,1e20,1e20) cf_asd.level_1=1e20        cf_asd.level_2=1e20         cf_asd.color_1=240        cf_asd.color_2=240  

#data = cdmsfile('clt', longitude=(­180, 180), latitude = (­180., 180.)) # For the world

data = cdmsfile('clt', longitude=(60, 100), latitude = (5., 40.))  

v.plot( data,cf_asd, continents=6 )

Page 37: Contour Ilugc Demo Presentation

 Corrected India Map in Cdat

Page 38: Contour Ilugc Demo Presentation

 Corrected India region in Cdat­World Map

Page 39: Contour Ilugc Demo Presentation

  Isolines

Page 40: Contour Ilugc Demo Presentation

  Isolines­ Contour­ Isotherm­ Isobar

Page 41: Contour Ilugc Demo Presentation

What is Contour ?

Contour is line drawn on a map connecting points of equal height .

Contour lines (also isolines) connect a series of points of equal elevation and are used to illustrate topography, or relief on a map. 

They show the height of ground above Mean Sea Level (M.S.L.) in either feet or meters and can be drawn at any desired interval. 

Page 42: Contour Ilugc Demo Presentation
Page 43: Contour Ilugc Demo Presentation
Page 44: Contour Ilugc Demo Presentation

 What is Isotherm ?

An isotherm ( meaning 'heat') is a line that connects points on a map that have the same temperature.

  Therefore, all points through which an isotherm passes have the same temperatures at the time indicated.

Page 45: Contour Ilugc Demo Presentation

 What is Isobar ?

 A line of constant pressure. Isobars are found ONLY on surface charts. 

They most commonly connect lines of equal pressure in the units of millibars. 

High pressure isobars generally occurs with isobars above 1010 mb while low pressure isobars occur with lower than 1010 millibars.

Page 46: Contour Ilugc Demo Presentation

 What are the Uses of Isotherm ?

Isotherms are used to find regions with 

         * Warm air advection             * Cold air advection 

* Short waves* Fronts* Temperature gradient boundaries    and * Instability zones.

 They are most commonly used at pressure surfaces below 500 millibars and on surface charts.

Page 47: Contour Ilugc Demo Presentation

Isolines in Cdat

Page 48: Contour Ilugc Demo Presentation

Iso Lines Over India Map

Page 49: Contour Ilugc Demo Presentation

CDAT User :

How can a user create their own Isolines on cdat map?

Page 50: Contour Ilugc Demo Presentation

CDAT User :

Generally we can't create our own isolines in cdat map.

We can set only levels on isolines.

Page 51: Contour Ilugc Demo Presentation

levels = [10,20,30]

Page 52: Contour Ilugc Demo Presentation

     Reason is  . . . 

Page 53: Contour Ilugc Demo Presentation

NetCDF file

Page 54: Contour Ilugc Demo Presentation

What is NetCDF File ?

NetCDF (network Common Data Form)

is a set of software libraries and machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data.

Page 55: Contour Ilugc Demo Presentation

Purpose of NetCDF (.nc)File

The main purpose of netCDF is to protect the user from having to know the details of how the data is stored in the netCDF file.

Cdat have clt.nc file which is reason to create isolines on map.

Page 56: Contour Ilugc Demo Presentation

My Project

is going to create our own isolines on cdat map.

Page 57: Contour Ilugc Demo Presentation

How to read/write NetCDF (clt.nc) file ?

Page 58: Contour Ilugc Demo Presentation

$ sudo apt-get install netcdf-bin

To convert .nc binary into editable text $ ncdump clt.nc > clt.cdl

To generate clt.nc from edited clt.cdl file$ ncgen -b clt.cdl

Page 59: Contour Ilugc Demo Presentation

What is My Project ?

My Project going to create the isotherm lines, which will be plot on India Cdat Map.

We have 4 processes to do this . . ..

Page 60: Contour Ilugc Demo Presentation

Process 1:

  1.1 WebScrape the current temperature and barometer (millibar) of all over cities in India and its surroundings countries from the Internet.

1.2 Store the city name, temperature, millibar into the file.

Page 61: Contour Ilugc Demo Presentation

Process 2:

2.1 Combine the temperature and mb values with latitude and longitude of corresponding cities, which is already collected info file.

2.2  Make decision and covert lat into 4 intervals & lon into 5 intervals

Page 62: Contour Ilugc Demo Presentation

Process 3:

3.1  Create the binary iso.nc file which contains 

current temperature values along with lat & lon. 

3.2  Move the “iso.nc” to the cdat location in our system.

Page 63: Contour Ilugc Demo Presentation

Process 4:

4.1  Run the “isotherm.py” to create our isolines on 

cdat India Map. 

4.2  E­Mail to us with the attachment of the output image, which is created by “isotherm.py”

Page 64: Contour Ilugc Demo Presentation

To automate all the 4 processes we may use “crontab” 

to get isotherm update on India for every one hour or . . .

Page 65: Contour Ilugc Demo Presentation

Web Scraping Program

Isothermal Lines On Cdat Map

Google Temperature Values

Store the GoogleTemperature Valuesinto the File

Draw Isothermal Lines from the File Values

Data Flow Diagram For Generating Isothermal Lines From Google Temperature

Page 66: Contour Ilugc Demo Presentation

Before going to Demo . . .

Page 67: Contour Ilugc Demo Presentation

 On 12 th Mar 2010 isothermlines on India from 

1 pm to 11 pm

Page 68: Contour Ilugc Demo Presentation

               1 pm

Page 69: Contour Ilugc Demo Presentation

  4 pm

Page 70: Contour Ilugc Demo Presentation

5 pm

Page 71: Contour Ilugc Demo Presentation

6 pm

Page 72: Contour Ilugc Demo Presentation

7 pm

Page 73: Contour Ilugc Demo Presentation

  8 pm

Page 74: Contour Ilugc Demo Presentation

 9 pm

Page 75: Contour Ilugc Demo Presentation

 10 pm

Page 76: Contour Ilugc Demo Presentation

11 pm

Page 77: Contour Ilugc Demo Presentation

12 am

Page 78: Contour Ilugc Demo Presentation

Demo . . . !

Page 79: Contour Ilugc Demo Presentation

Coding . . .

Page 80: Contour Ilugc Demo Presentation

Applications :

 

By the visualization of Isothermal lines on map, we can analyses and obtain the temperature and pressure values.

Using this we can analysis/predict the climate changes.

  

Page 81: Contour Ilugc Demo Presentation

Applications :

 .

  Advection ­ The horizontal transfer of heat

       Forecaster ­  Someone who makes 

predictions of the future

   

      

Page 82: Contour Ilugc Demo Presentation

Applications of isolines :           ­By Meteorologist Jeff Haby

Q1. What is meteorologically significant about isobars or isohypses being closely spaced?

Answer: A forecaster can determine the amount of thermal advection (temperature advection). Closely spaced contours indicate stronger wind.

  

Source : http://www.theweatherprediction.com/basic/isopleths/

Page 83: Contour Ilugc Demo Presentation

Applications of isolines :           ­By Meteorologist Jeff Haby

Q2. Negative thickness advection is lower values of thickness moving toward a fixed point. How can this be determined by examining a thickness chart?

Answer: If height contours or isobars are overlaid on the thickness field, a forecaster can determine the speed and direction cold air will have. If the lower thicknesses are advected by the height contours or isobars toward a fixed point, that fixed point will experience a cooling of weather.

  Source : http://www.theweatherprediction.com/basic/isopleths/

Page 84: Contour Ilugc Demo Presentation

Applications of isolines :           ­By Meteorologist Jeff Haby

Q3. In feet and meters, what is the average height of the 850, 700, 500 and 300 mb surfaces?

Answer:

850 mb (1,500 meters, 5,000 feet)700 mb (3,100 meters, 10,000 feet)500 mb (5,500 meters, 18,000 feet)300 mb (9,300 meters. 30,000 feet)

  Source : http://www.theweatherprediction.com/basic/isopleths/

Page 85: Contour Ilugc Demo Presentation

Applications :

Isallobar / Height change contours­

 A line of equal pressure change. They are used to forecast the propagation of low and high pressure systems

      

Page 86: Contour Ilugc Demo Presentation

Applications of isolines :           ­By Meteorologist Jeff Haby

Q4. How are isallobars significant to weather forecasting?

Answer: They give the indication of pressure change. Lows tend to move toward the region with the greatest height falls. Values tell a forecaster if a low or high is increase or decreasing in intensity..

  

Source : http://www.theweatherprediction.com/basic/isopleths/

Page 87: Contour Ilugc Demo Presentation

 THANK YOU