SCRIPT: K Index

Strictly for sharing scripts used in Digital Atmosphere and getting assistance from other users.
Post Reply
Guest

SCRIPT: K Index

Post 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*...
Guest

SCRIPT: K Index

Post 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
Guest

Post by Guest »

Did DaWS run this script OK on your system?
Guest

SCRIPT: K Index

Post 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?
Guest

SCRIPT: K Index

Post 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---
Fred
Senior Member
Posts: 198
Joined: Tue Nov 25, 2003 4:22 pm
Location: Suoi Tien, Vietnam

Post 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.
Guest

SCRIPT: K Index

Post by Guest »

Fred
Senior Member
Posts: 198
Joined: Tue Nov 25, 2003 4:22 pm
Location: Suoi Tien, Vietnam

Post by Fred »

It's clear (I think). The weather forecast handbook is wrong.
Guest

Post 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
Fred
Senior Member
Posts: 198
Joined: Tue Nov 25, 2003 4:22 pm
Location: Suoi Tien, Vietnam

Post 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
Post Reply