[gradsusr] [EXTERNAL] Re: Plotting xcbar.gs Even When There is No Valid Data

Perry, Aaron axp09171 at alumni.northernvermont.edu
Tue Apr 12 16:52:08 EDT 2022


I've modified (highlighted text) Lines 157 through 189 in xcbar.gs to save the result (a text file called ref_shade_info) of 'q shades' for future use. I'm having trouble figuring out how to use the _shdinfo variable you had suggested for use outside of xcbar.gs.

I've also attached ref_shade_info to this email for reference.

My colorbar is

My Attempt:

*** get shade information ***
  if( cnum = -1 )
*    'q shades'
     istat = 0
     while (istat != 2)

     data = read('ref_shade_info')
     shdinfo = sublin(data,2)
     say shdinfo
*    dummy=write('ref_shade_info',shdinfo)
    if ( subwrd( shdinfo, 1 ) = 'None' )
      say 'Error in xcbar.gs: No shading information'
      return
    endif

* number of colors
    cnum = subwrd( shdinfo, 5 )
    if( cnum <= 0 )
      say 'Error in xcbar.gs: Number of color is zero'
      return
    endif

* color and (higher) levels
    i = 1
    while( i <= cnum )
      rec = sublin( shdinfo, i+1 )
      col.i = subwrd( rec, 1 )
      hi.i = subwrd( rec, 3 )
      i = i + 1
    endwhile
    endwhile

  endif

Am I on the right track?

Aaron Perry
Meteorologist
Class of '16
Northern Vermont University-Lyndon
(formerly Lyndon State College)
Boston, Mass.
Twitter: @AaronPerryWx<https://twitter.com/AaronPerryWx><https://twitter.com/arnpry><https://twitter.com/AaronPerryWx>
Email: axp09171 at vsc.edu<mailto:axp09171 at vsc.edu>
________________________________
From: gradsusr <gradsusr-bounces at gradsusr.org> on behalf of Perry, Aaron <axp09171 at alumni.northernvermont.edu>
Sent: Tuesday, April 12, 2022 9:08 AM
To: GrADS Users Forum <gradsusr at gradsusr.org>
Subject: Re: [gradsusr] [EXTERNAL] Re: Plotting xcbar.gs Even When There is No Valid Data

This message is from an external sender. Please be careful when clicking on links and attachments.


Ok, thank you for that clarification!

I will give the process a try and update back later today.

Aaron Perry
Meteorologist
Class of '16
Northern Vermont University-Lyndon
(formerly Lyndon State College)
Boston, Mass.
Twitter: @AaronPerryWx<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FAaronPerryWx&data=04%7C01%7Caxp09171%40alumni.northernvermont.edu%7C6b8e23658adc4d3da1d908da1c85936b%7Cb17e9703dbdd49fa909c03dfd13086af%7C0%7C0%7C637853657280406001%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=vEITpmkWlT0v3np04coH2eVD0lnENPdXcm1i81gQZL4%3D&reserved=0><https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Farnpry&data=04%7C01%7Caxp09171%40alumni.northernvermont.edu%7C6b8e23658adc4d3da1d908da1c85936b%7Cb17e9703dbdd49fa909c03dfd13086af%7C0%7C0%7C637853657280406001%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=EVRRI4Ir6rf9ngT7E7aIV5UsOtl%2FHRzRHhqHv7lH5Kk%3D&reserved=0><https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FAaronPerryWx&data=04%7C01%7Caxp09171%40alumni.northernvermont.edu%7C6b8e23658adc4d3da1d908da1c85936b%7Cb17e9703dbdd49fa909c03dfd13086af%7C0%7C0%7C637853657280406001%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=vEITpmkWlT0v3np04coH2eVD0lnENPdXcm1i81gQZL4%3D&reserved=0>
Email: axp09171 at vsc.edu<mailto:axp09171 at vsc.edu>
________________________________
From: gradsusr <gradsusr-bounces at gradsusr.org> on behalf of Adams, Jennifer M. (GSFC-610.2)[ADNET SYSTEMS INC] <jennifer.m.adams at nasa.gov>
Sent: Tuesday, April 12, 2022 8:49 AM
To: GrADS Users Forum <gradsusr at gradsusr.org>
Subject: Re: [gradsusr] [EXTERNAL] Re: Plotting xcbar.gs Even When There is No Valid Data

This message is from an external sender. Please be careful when clicking on links and attachments.



Yes, but you also need to use a modified version of xcbar.gs that uses your saved shade information instead of calling ‘q shades’ again.



--
Jennifer Miletta Adams
Senior Scientific Software Developer
Goddard Earth Sciences Data and Information Services Center (GES DISC)

NASA/GSFC, Code 610.2

Building 32, Room S159





From: gradsusr <gradsusr-bounces at gradsusr.org> on behalf of "Perry, Aaron" <axp09171 at alumni.northernvermont.edu>
Reply-To: GrADS Users Forum <gradsusr at gradsusr.org>
Date: Tuesday, April 12, 2022 at 8:45 AM
To: GrADS Users Forum <gradsusr at gradsusr.org>
Subject: [EXTERNAL] Re: [gradsusr] Plotting xcbar.gs Even When There is No Valid Data



Thank you very much for the quick reply, Jennifer!



So to reiterate, I need to save the 'q shades' output from a forecast hour with valid data and then use that same output for a forecast hour that has no data, (instead of running 'q shades' again on the forecast hour with no data) therefore preserving the desired colorbar on the plot.





Aaron Perry

Meteorologist
Class of '16
Northern Vermont University-Lyndon

(formerly Lyndon State College)
Boston, Mass.

Twitter: @AaronPerryWx<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2FAaronPerryWx&data=04%7C01%7Caxp09171%40alumni.northernvermont.edu%7C6b8e23658adc4d3da1d908da1c85936b%7Cb17e9703dbdd49fa909c03dfd13086af%7C0%7C0%7C637853657280406001%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=vEITpmkWlT0v3np04coH2eVD0lnENPdXcm1i81gQZL4%3D&reserved=0>

Email: axp09171 at vsc.edu<mailto:axp09171 at vsc.edu>

________________________________

From: gradsusr <gradsusr-bounces at gradsusr.org> on behalf of Jennifer M Adams <jadams21 at gmu.edu>
Sent: Tuesday, April 12, 2022 7:31 AM
To: (gradsusr at gradsusr.org) <gradsusr at gradsusr.org>
Subject: Re: [gradsusr] Plotting xcbar.gs Even When There is No Valid Data



This message is from an external sender. Please be careful when clicking on links and attachments.



The colorbar scripts generally run 'q shades' and then parse the output in the 'result' variable. I have worked around this by setting up a plot with the contour levels and colors I want, then saving the output from 'q shades' in a script variable for later use:
'q shades'
_shdinfo = result

Then I append a modified copy of the colorbar script as a function in my main drawing script that uses _shdinfo instead of running 'q shades' again.

--Jennifer



________________________________

From: gradsusr <gradsusr-bounces at gradsusr.org> on behalf of Perry, Aaron <axp09171 at alumni.northernvermont.edu>
Sent: Tuesday, April 12, 2022 4:29 AM
To: (gradsusr at gradsusr.org) <gradsusr at gradsusr.org>
Subject: [gradsusr] Plotting xcbar.gs Even When There is No Valid Data



Good Morning All,



I am trying to figure out a way to plot xcbar.gs even when there is no valid data in the grid to plot.



For instance, there is no GFS precipitation values in a certain domain, say the Northeastern US, for Forecast Hour 12. xcbar.gs says that there is no shading information and therefore, does not plot a colorbar for that one frame. I want to have that precipitation colorbar plot for every frame regardless of if there is data in the grid or not.



I've tried going into xcbar.gs to see if there is an override to plot regardless of valid data or not but, there doesn't appear to be.



Any and all suggestions would be greatly appreciated.



Aaron Perry

Meteorologist
Class of '16
Northern Vermont University-Lyndon

(formerly Lyndon State College)
Boston, Mass.

Twitter: @AaronPerryWx<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsecure-web.cisco.com%2F1egToesz6FY1dQvl09040rrssQtgZSpZ37u0JC_BhMIqqGXDaOKm_GcDP8OZxfw5NJlqqFuoRKoKn2aXLLHz9lGrlKhdHibrlncd2fl0OlueWSALz8zjKx2Izbrd-LyQCFWj0MqKzgH_mksX34UIKC1VbG1_FBggf_vjEgGoxBL4zBoj1MVHm6S4jxv_uKfwbNLx3eKyftRZwBp2AWbzJ1CmTLAzSyX6MIl2g5HJ1zXFiGCIsLCK13RYrT53_lKb3Td_kTlxK4Q5KlGLw1UjBqktTn1Tp-yowSGIvKMO9CTBSsEyShaWNwIN6GLt1aw4CJj1NXJPDTnS4ANRpo3RphXFkpbfklh77_t-H9dgk-5yCcr3D8gt8zas1IivafPUV0EgxvOIzWrcY5zClfmgVUq2nOZUWKttKxLA2XKWtwLgt9CSk1kLr63d5eQykYA2fPEs3gXwIs5wJ7We-gs1AzQ%2Fhttps%253A%252F%252Ftwitter.com%252FAaronPerryWx&data=04%7C01%7Caxp09171%40alumni.northernvermont.edu%7C6b8e23658adc4d3da1d908da1c85936b%7Cb17e9703dbdd49fa909c03dfd13086af%7C0%7C0%7C637853657280406001%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=aCZ4zn5ezSyngffCAkEoK2hvEnU154arCKFzegvQGgY%3D&reserved=0>

Email: axp09171 at vsc.edu<mailto:axp09171 at vsc.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20220412/93f94f8c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: colorbar.PNG
Type: image/png
Size: 48504 bytes
Desc: colorbar.PNG
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20220412/93f94f8c/attachment-0001.png>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ref_shade_info.txt
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20220412/93f94f8c/attachment-0001.txt>


More information about the gradsusr mailing list