Page 1 of 1

SCRIPT: K Index

Posted: Mon Feb 07, 2005 6:30 am
by Guest
Quick script to generate K Index for stability monitoring.

Someone check my math...

(T850 - T500)+Td850-(T700-Td700)

Here's the script:

CONT GRTN=10 CINT=1 DASH COLOR=200:100:100 SDIF=7:8 STOR=8 SDIF=6:3 STOR=7 SDIF=4:5 STOR=6 SDIF=1:2 STOR=5 DEGC DWPT H700 STOR=4 TEMP H700 STOR=3 DEGC DWPT H850 STOR=2 TEMP H500 STOR=1 TEMP H850

Writing scripts backwards is *weird*...

SCRIPT: K Index

Posted: Mon Feb 07, 2005 4:48 pm
by Guest
*sigh*

That's what happens when you write quick scripts..

Corrected version here, substituted SDIF for SSUM in STOR=8.

Still not sure about the precedence.. maybe there's a way of marking up meteo equations, sort of like Mathematica does? Would make it a lot easier to create stability indexes..

If anyone has any ideas for ways to script a CAPE calculation, post them here...

CONT GRTN=0 CINT=1 DASH COLOR=200:100:100 SDIF=7:8 STOR=8 SSUM=6:3 STOR=7 SDIF=4:5 STOR=6 SDIF=1:2 STOR=5 DEGC DWPT H700 STOR=4 TEMP H700 STOR=3 DEGC DWPT H850 STOR=2 TEMP H500 STOR=1 TEMP H850

Posted: Mon Feb 07, 2005 11:30 pm
by Guest
Did DaWS run this script OK on your system?

SCRIPT: K Index

Posted: Wed Feb 09, 2005 6:58 am
by Guest
Well, it displays... until the thunderstorm season rolls around, I can't tell if it works... I also managed to generate fills at 25%, 35% and 45%, so it's definitely calculating a value for each point reporting upper air data.

Having problems running it, or having problems with the data it produces?

SCRIPT: K Index

Posted: Wed Feb 09, 2005 7:25 am
by Guest
I should also point out that it's written for a menu entry, which assumes an
ANALYZE at the start... for a script you'll need to add that.

K_Script.dsf
---start here---
ERASE
ANALYZE,CONT GRTN=0 CINT=1 DASH COLOR=200:100:100 SDIF=7:8 STOR=8 SSUM=6:3 STOR=7 SDIF=4:5 STOR=6 SDIF=1:2 STOR=5 DEGC DWPT H700 STOR=4 TEMP H700 STOR=3 DEGC DWPT H850 STOR=2 TEMP H500 STOR=1 TEMP H850
STAMP
EXPORT,C:\WX\DIGATM\TEMP_WIND\@FFZ@MMZ@DDZ@HHZ@NNZ_KIndex.jpg
---end here---

K_Fills_Script.dsf
---start here---
ERASE
ANALYZE,OVER FILL COLOR=255:0:0 FILS=0 GRTN=45 SDIF=7:8 OVER FILL COLOR=255:255:0 FILS=0 GRTN=35 SDIF=7:8 OVER FILL COLOR=0:255:0 FILS=0 GRTN=25 SDIF=7:8 STOR=8 SSUM=6:3 STOR=7 SDIF=4:5 STOR=6 SDIF=1:2 STOR=5 DEGC DWPT H700 STOR=4 TEMP H700 STOR=3 DEGC DWPT H850 STOR=2 TEMP H500 STOR=1 TEMP H850
STAMP
EXPORT,C:\WX\DIGATM\TEMP_WIND\@FFZ@MMZ@DDZ@HHZ@NNZ_KIFills.jpg
---end here---

Posted: Wed Feb 09, 2005 6:44 pm
by Fred
As a beginner in meteorology a question about the formula.
Weather map handbook page 146: T850-T500+Td850-D700
Weather forecasting handb. p.138: T850-T500+Td850-D850.

Who is right?

Greetings

Fred

PS. The script gives a nice output. I changed some colors to match the ranges in the map handbook. As a beginner I don't know if the result of the script is correct.

SCRIPT: K Index

Posted: Wed Feb 09, 2005 8:01 pm
by Guest

Posted: Wed Feb 09, 2005 8:28 pm
by Fred
It's clear (I think). The weather forecast handbook is wrong.

Posted: Wed Feb 09, 2005 10:00 pm
by Guest
I'm sure it's just a typo in the forecasting handbook.


this site covers most any meteorological formula you can think of:
http://www.aprweather.com/pages/calc.htm

Posted: Thu Feb 10, 2005 12:36 pm
by Fred
I also think it's a typo. Thanks for the sites, I added them to my favourites.

Looking to the CAPE formule my first impression is that it's much to complex to calculate with the present set of commands. In my opinion it's the best that CAPE will become a predefined command like TEMP etc..

Greetings

Fred