[gradsusr] maskout

Jeff Duda jeffduda319 at gmail.com
Mon Aug 15 14:33:28 EDT 2016


Ally,
I see no indication in this code for why it won't work. When you said that
the line

 'd tloop(amean(100*swed,x=1,x=98,y=1,y=129))'

works, what do you mean? Does it plot a 1-D time series showing reasonable
values? Are there any error messages anywhere when you run this code? If
the line above works, but

 'd tloop(amean(maskout(100*swed,mask.3(t=1)),x=1,x=98,y=1,y=129))'

doesn't, then it means the inclusion of the maskout(100*swed,mask.3(t=1))
function is resulting an field that is entirely undefined. If swed itself
is defined everywhere, then it must be the case that either mask.3(t=1) is
all negative, or that mask field is itself undefined. Your mask might be
fine if you plot it in isolation, but remember that you're changing your
dimension environment throughout the script (to values that likely differ
from the defaults in the control files), and you have multiple files open
simultaneously, so that will impact whether a field is defined or not. You
can test if the mask is the problem by adding this line

'd mask.3(t=1)'

immediately before your big display command (and then stop the code by
adding *return*). If the mask plots fine, then I'm missing something else.

Jeff

On Mon, Aug 15, 2016 at 1:19 PM, Ally Toure <allytoure at gmail.com> wrote:

> Here is the script
>
> 'reinit'
>
>  'open ../outputs/snowpack.ctl'
>  'open ../../topo_veg/regrid/siksik_topo_veg_20m.ctl'
>  'open ../process/ave_swe_mask/ave_swe_mask.ctl'
>  'open ../../obs/sonic_sounder_149/snowd_daily_2012-2013.ctl'
>
>  'set grads off'
>  'set mproj scaled'
>  'set mpdraw off'
>
> * the aspect ratio is 129/98=1.32.
>  'set parea 1.0 7.5 1.0 9.56'
>
>  'set t 1 303'
>
> * this is the grid cell corresponding to the met tower location.
>  'set x 31'
>  'set y 72'
>
>  'set vrange 0 15'
>
> * plot the domain-averaged swe at each time step.
>
> 'set x 1'
>  'set y 1'
>  'set t 1 303'
>  'd 100*sweave_wi.3'
>
> *'d tloop(amean(100*swed,x=1,x=98,y=1,y=129))'
> * pull dummy
> * something is wrong with this.
>
> *'d tloop(amean(maskout(100*swed,mask.3(t=1)),x=1,x=98,y=1,y=129))'
>
>
>
> Thanks
> Ally
>
>
>
>
>
> On Mon, Aug 15, 2016 at 1:59 PM, Jeff Duda <jeffduda319 at gmail.com> wrote:
>
>> mask.3 implies you've opened at least 3 data files and that the mask is
>> indeed in file #3. Can you verify this in your script code? Also make sure
>> the time in your two files matches up or you use a string to reset the time
>> to correspond to one of the fields. You used (t=1) for mask.3, but if t=1
>> does not represent 00Z 01 January 2001, then you'll have a time mismatch as
>> well. It doesn't appear this is the issue, though. It might help if you
>> sent your script code.
>>
>> On Mon, Aug 15, 2016 at 11:32 AM, Ally Toure <allytoure at gmail.com> wrote:
>>
>>> Hi Jeff,
>>> I plotted the mask
>>> and it look fine for me. attached is the .ctl and .gdat file
>>>
>>> and there is the part of the code
>>> * plot the domain-averaged swe at each time step.
>>>  'set x 1'
>>>  'set y 1'
>>>  'set t 1 303'
>>>  'set cmark 0'
>>>
>>> This works
>>>  'd tloop(amean(100*swed,x=1,x=98,y=1,y=129))'
>>>
>>>
>>> * something is wrong with this.
>>>  'd tloop(amean(maskout(100*swed,mask.3(t=1)),x=1,x=98,y=1,y=129))'
>>>
>>> Thanks
>>> Ally
>>>
>>>
>>> On Mon, Aug 15, 2016 at 11:25 AM, Ally Toure <allytoure at gmail.com>
>>> wrote:
>>>
>>>> Hi Jeff,
>>>> I will do that. Thanks again for your help.
>>>> Ally
>>>>
>>>> On Mon, Aug 15, 2016 at 11:12 AM, Jeff Duda <jeffduda319 at gmail.com>
>>>> wrote:
>>>>
>>>>> That makes it sound like your mask is negative in the entire domain
>>>>> over which you're trying to average. I would verify that the mask is what
>>>>> you want it to be.
>>>>>
>>>>> Jeff
>>>>>
>>>>> On Mon, Aug 15, 2016 at 9:32 AM, Ally Toure <allytoure at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Jeff,
>>>>>> I get a message such as "Entire grid undefined"
>>>>>> Thanks
>>>>>> Ally
>>>>>>
>>>>>> On Mon, Aug 15, 2016 at 1:24 AM, Jeff Duda <jeffduda319 at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> What are you actually seeing?
>>>>>>>
>>>>>>> On Sun, Aug 14, 2016 at 11:25 PM, Ally Toure <allytoure at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi Jeff,
>>>>>>>> thanks so much for you prompt reply
>>>>>>>> I set up
>>>>>>>> 'set t 1 303'
>>>>>>>>   'd tloop(amean(maskout(100*swed,mask.3(t=1)),x=1,x=98,y=1,y=129
>>>>>>>> ))'
>>>>>>>>
>>>>>>>> it still does not work
>>>>>>>> What else should I change?
>>>>>>>> Thanks
>>>>>>>>
>>>>>>>> On Mon, Aug 15, 2016 at 12:02 AM, Jeff Duda <jeffduda319 at gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> You probably need to set your dimension environment to 1-D by
>>>>>>>>> fixing lat/x and lon/y so that only t varies.
>>>>>>>>>
>>>>>>>>> Jeff Duda
>>>>>>>>>
>>>>>>>>> On Sun, Aug 14, 2016 at 10:52 PM, Ally Toure <allytoure at gmail.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Guys,
>>>>>>>>>> I am trying to compute average of swed at points where the mask
>>>>>>>>>> value are positive. I used the command below but it won't plot the line.
>>>>>>>>>> Am I missing something? Your help would be greatly appreciated.
>>>>>>>>>>
>>>>>>>>>> * something is wrong with this.
>>>>>>>>>>   'set t 1'
>>>>>>>>>>   'd tloop(amean(maskout(100*swed,mask.3(t=1)),x=1,x=98,y=1,y=129
>>>>>>>>>> ))'
>>>>>>>>>>
>>>>>>>>>> Ally
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> gradsusr mailing list
>>>>>>>>>> gradsusr at gradsusr.org
>>>>>>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Jeff Duda
>>>>>>>>> Post-doctoral research associate
>>>>>>>>> University of Oklahoma School of Meteorology
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> gradsusr mailing list
>>>>>>>>> gradsusr at gradsusr.org
>>>>>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> gradsusr mailing list
>>>>>>>> gradsusr at gradsusr.org
>>>>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Jeff Duda
>>>>>>> Post-doctoral research associate
>>>>>>> University of Oklahoma School of Meteorology
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> gradsusr mailing list
>>>>>>> gradsusr at gradsusr.org
>>>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> gradsusr mailing list
>>>>>> gradsusr at gradsusr.org
>>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Jeff Duda
>>>>> Post-doctoral research associate
>>>>> University of Oklahoma School of Meteorology
>>>>>
>>>>> _______________________________________________
>>>>> gradsusr mailing list
>>>>> gradsusr at gradsusr.org
>>>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>>>
>>>>>
>>>>
>>>
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>
>>>
>>
>>
>> --
>> Jeff Duda
>> Post-doctoral research associate
>> University of Oklahoma School of Meteorology
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Post-doctoral research associate
University of Oklahoma School of Meteorology
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160815/92b3e6c4/attachment-0001.html 


More information about the gradsusr mailing list