Thursday, February 19, 2015

Tutorial: Use basemap.gs to make a beautiful map of "SST", Sea Ice and Snow in GrADS

This tutorial will draw upon many of the skills discussed in several other tutorials on this site, e.g., how to handle multiple files at once, or how to use basemap.gs.  There isn't too much "new" information in this tutorial on how to use these different features and functions of GrADS, rather this tutorial will show you how to specifically make a very pretty map of sea-surface temperature, sea ice, and snow.  The final outcome is shown below.

For this tutorial you will need:

Snow Cover and Sea Ice on the Robinson Map Projection



So before we start, I want to give a full disclaimer: The plot is not actually showing any observed SST.  In this tutorial I'm going to use the 0.25 degree GFS surface temperature.  In practice the surface temperature should be roughly equal to the SST over the Oceans.

The first thing we need to do is open both the GFS data and the sea ice data.  This data will come from NOMADS and will be opened using the 'sdfopen' command.  Note, the files below are for February 2015, so keep in mind, that you will need to change the date on files if you wish to copy paste the example code below.


   'reinit'

   gfsfile='http://nomads.ncep.noaa.gov:9090/dods/gfs_0p25/gfs20150218/gfs_0p25_18z'
   icefile='http://nomads.ncep.noaa.gov:9090/dods/ice/ice20150218/ice.00z'

  'sdfopen 'gfsfile
  'sdfopen 'icefile


Now that the files are open we will simply set up the map.  Since we are using the Robinson Projection, we need to set the longitude to range from -180 to 180 and the latitude -90 to 90.  

   'set gxout shaded'
   'set mpdset hires'
   'set lon -180 180'
   'set lat -90 90'
   'set mproj robinson'
   'colormaps -l 272 307 0.5 -map jet' ;*Note the use of colormaps.gs



Then we display the variable:

   'd tmpsfc'
   'xcbar -fs 4'

  
After a moment, the surface temperature will be displayed following the "jet" color map.
Now, we are going to mask out the land using the land basemap from basemap.gs.

Note, in my version of basemap.gs, I did not want to include the frame around the map projection.  So I opened up basemap.gs and commented out the lines at the bottom that draw the rectangle:

   * Draw a new square frame around the plot
   * If you have 'set frame off' or 'set frame circle' before running basemap,
   * you may want to comment out the next 2 lines
   *'set line 1 1 6'
   *'draw rec 'x1' 'y1' 'x2' 'y2


We are going to use the "medium (M)" resolution option for the coastlines, and we are going to define a custom dark gray color for the land.

   'set rgb 73 80 80 80'
   'basemap L 73 0 M'         ;*L = Land, 73 = Fill Color, 0 = outline Color, M=Medium resolution


SST only!
  This will fill in the land areas with a gray map and you will have an image like this:

Now that we are done with the "SST" and the land mask, we are going to open up the sea-ice file and plot the sea ice.  It is important that you use the maskout function when plotting the sea-ice, otherwise you will overwrite all of the SST data with zeros.

  'set gxout shaded'
  'set dfile 2'                   ;*Sets Default file to file 2 (Sea ice)
  'set z 1'                        ;*Set z to 1
  'set t 1'                        ;*Set t to 1
  'set map 0 1 6'   
  'color 0 0.6 0.1 -kind dimgray->seashell->white'           ;*Note use of color.gs
  'd maskout(icecmsl,icecmsl-0.1)'                                     ;*Need to mask out ice.



After a few moments, the sea ice will plot and you will have an image like this:

Sea Ice and SST only!


Now this is all well and good, but our knowledge is limited to the ice over the oceans, we don't really get any sense of how ice and snow covers the land masses.  So the final touch that we'll add to the map is to plot the GFS snow water equivalent (SWE) using a similar color scale as ice cover.  To do that, we need to reset the file to our first file and then reset our time our vertical level.  Lastly, we plot SWE (again using maskout to avoid plotting over everything).

  'set dfile 1'
  'color 10 100 5 -kind dimgray->seashell->white'
  'set z 1'
  'set t 1'
  'set map 0 1 6'
  'd maskout(weasdsfc,weasdsfc-10)'


And after a few moments, you have a map like the one shown at the beginning of the tutorial.
You can play around with your minimum values for ice and snow, I used 0.1 for sea-ice and 10 mm for SWE.  That seemed to produce a good looking map.  Experiment as you like!  This plot is really basic, no special formatting outside of the actual plot (titles, etc).  Hopefully you enjoyed this tutorial, I know it was oddly specific, and didn't really present anything new, hopefully you learned something anyway!

Download Example Script





8 comments:

  1. Hye there, there is a problem with the basemap scripts. I try to do your tutorial but for the basemap it's said error reading 1poly_mres.asc

    ReplyDelete
  2. I am wondering how to use ESRI shape files in order to maskout the area of interest in GrADS.

    ReplyDelete
    Replies
    1. Hi, it sounds like this should be a fairly straightforward problem, should just be able to draw a shapefile with the fill option after plotting.

      I don't know if you've seen some of the other tutorials on this site, but there are a few that deal with using shapefiles:

      http://gradsaddict.blogspot.com/2013/05/tutorial-shapefile-basics.html
      http://gradsaddict.blogspot.com/2013/05/tutorial-shapefile-look-at-dbf-file.html
      http://gradsaddict.blogspot.com/2013/05/tutorial-use-grads-to-draw-shapefiles.html

      Good Luck!

      Delete
  3. Please share the grads scripts which could draw the icon forecast as the global forecast centers prepares from the grib data which is the output of the WRF weather model.

    ReplyDelete
  4. Hello please check here now ,,
    gclub
    gclub casino
    gclub

    ReplyDelete
  5. is there any way to mask countries in GrADS, ie for instance I want to see tempersture over a particular country? How can this be done? Any help is much appreciated

    ReplyDelete
  6. เล่นเกม คาสิโนออนไลน์ บนโทรศัพท์มือถือแบบถูกต้องตามกฎหมายกับเกมดังในตำนาน
    จำเป็นต้องเห็นด้วยว่าในหลายๆประเทศ เกม สล็อต นั้นยังเกิดเรื่องที่ไม่ถูกต้องตามกฎหมายอยู่ เนื่องจากว่าถือได้ว่าหนึ่งในเกมการเดิมพันรวมทั้งเกมคาสิโนที่พนันด้วยเงิน ทำให้โดนเห็นว่าไม่ดี มีการเสี่ยงหมดกระเป๋า และไม่เป็นที่ยอมรับให้ลงบัญชีถูกตามกฎหมายสำหรับในการเปิดให้บริการ

    แม้กระนั้นวันนี้พวกเรามีเกมการเดิมพันแล้วก็เกมคาสิโนรูปแบบใหม่ซึ่งสามารถเล่นได้ผ่านมือถือ คอมพิวเตอร์ โน้ตบุ๊ค แล้วก็แล็บท็อป รองรับกับทุกระบบปฏิบัติการ ไม่ว่าจะเป็น Android, IOS, Windows รวมทั้ง MacOS ก็สามารถเข้าเล่นได้ทั้งหมด เพียงแต่เชื่อต่อกับอินเตอร์เน็ต ไม่ต้องเสี่ยงถูกจับเนื่องจากว่าถูกการันตีการให้บริการเกมคาสิโนบนแพลตฟอร์มออนไลน์สากล ไม่ต้องเดินทางผ่านไปยังประเทศที่คาสิโนถูกตามกฎหมาย เล่นได้แม้ว่าจะนอนอยู่ที่บ้าน ก็สามารถเบิกบานเพลินไปกับเกมต่างๆมากมายก่ายกอง รูปแบบใหม่ๆพร้อมยังสามารถสร้างรายได้ได้อีกด้วย

    มารู้จะกับเกมดังในตำนานบนแพลตฟอร์มเว็บกัน
    เกมดังในตำนานที่พวกเราได้เอ๋ยถึงไปก่อนหน้าที่ผ่านมาก็คือเกม สล็อตออนไลน์ ที่เป็นชื่อเรียกแบบใหม่เมื่อเปิดให้บริการอยู่บนแพลตฟอร์มเว็บ ในส่วนของลักษณะนี้นั้น นักพัฒนาต่อได้กระทำการวางแบบแบบเกมใหม่ๆเพื่อสร้างความสนุกรวมทั้งความน่าตื่นตาตื่นใจแบบไม่รู้จักจบสิ้น เอาอกเอาใจนักเสี่ยงโชคคอแฟนเกม

    โดยมีการเพิ่มเรื่องราวเกมที่ต่างกันมาก โดยบางทีอาจจะกล่าวถึงเอาผู้แสดงดัง การ์ตูนอนิเมชั่นสุดน่ารักน่าเอ็นดูมาสร้างเป็นเรื่องราวเกม มีการปรับประสิทธิภาพความแหลมคมชัดระดับ Full HD พร้อมทั้งระบบเสียงซาวน์เอฟเฟคเหมือนจริง ที่จะทำให้อรรถรสสำหรับในการเล่นนั้นมากขึ้นไปถึงจุดสุดยอด

    จุดเด่นจุดเด่นของเกมรูปแบบใหม่ผ่านแพลตฟอร์มเว็บ มีอะไรบ้าง
    สำหรับตัวจุดเด่น เด่นๆของเกม สล็อต ที่ถูกเอามาทำใหม่แล้วก็เปิดให้บริการอยู่บนแพลตฟอร์มเว็บ ก็มีจุดเด่นเยอะแยะอีกทั้งจากตัวเกมแล้วก็จากเว็บผู้ให้บริการเองอีกด้วยอย่างเดียวกัน โดยมีจุดเด่นสำคัญๆดังนี้
    เล่นง่ายผ่านมือถือหากแม้อยู่ที่บ้าน ไม่ต้องเดินทางด้วยเหตุว่าถูกต้องตามกฎหมายแล้ว
    ระบบฝาก - เบิกเงินอัตโนมัติซึ่งสามารถทำได้ด้วยตัวเองโดยมีบอท AI รอดูแล ไม่มีความจำเป็นที่จะต้องผ่านคณะทำงาน
    การลงทุนอย่างต่ำเพียงหลักร้อยแต่ว่าสามารถสร้างรายได้หลักแสน
    ต้นแบบเกมแบบใหม่กับเรื่องราวมากมายที่จะสร้างความสนุกสนานร่าเริงเพลิดเพลินใจแบบไม่รู้จักจบสิ้น
    การพนันแสนง่ายกับสูตรทุจริตเกมและก็แนวทางเอาชนะเกมต่างๆที่ถูกพินิจพิจารณาด้วยระบบ AI อัจฉริยะ
    เงินโบนัสที่เพิ่มมากยิ่งกว่าเดิมเข้ามาในเกม pgslot
    เป็นยังไงบ้างกับจุดเด่นจุดเด่นของเกม คาสิโนออนไลน์ ซึ่งสามารถเล่นได้ผ่านมือถือแบบถูกกฎหมาย ไม่ต้องเสี่ยง ไม่ต้องเดินทาง ทั้งได้โอกาสสำหรับเพื่อการทำเงินมากยิ่งกว่าเดิมอีกด้วย

    ReplyDelete
  7. เครดิตฟรี ไม่ต้องฝาก ไม่ต้องเเชร์ เล่นได้เลย 24 ชม. เล่นง่าย ได้เงินไว มีบริการฝากถอนเงินแบบออโต้ที่รวดเร็วที่สุด สล็อตออนไลน์ สล็อต ที่มาแรงที่สุดในปี 2022 นี้ สะดวกสบายมากที่สุด

    ReplyDelete