[ncl-talk] Plotting NDVI from (AVHRR) sensor

Setareh Rahimi setareh.rahimi at gmail.com
Tue Jun 21 05:41:46 MDT 2022


Dear Dennis,
So many thanks for your attention. I did as you suggested and I attached
the result. Please check this out.
Best wishes,

On Sat, Jun 18, 2022 at 8:07 PM Dennis Shea <shea at ucar.edu> wrote:

> re:   "f is undefined"
>
> ??  This indicates that the file pointer is not correct
>
> The script loops over one or more files:
>
> do nf=0,nfili-1
>   pthi = diri+fili(nf)
>   f    = addfile(pthi, "r")
>
> f is a pointer to a file.
> ======================================
>
> You should go into 'debug mode'
>
> print(diri)               ; data path
> print("=====")
> print(fili)               ; print names of one or more files
> print("=====")
> print("nfili="+nfili)     ; number of files
> print("=====")
>
> :
> :
> do nf=0,nfili-1            ; loop over each file
>   pthi = diri+fili(nf)
>
>   print(pthi)
>   print("=====")
>
>   f    = addfile(pthi, "r")
>
>   print(f)     ; equivalent to 'ncdump -h '
>
>
> On Sat, Jun 18, 2022 at 4:50 AM Setareh Rahimi <setareh.rahimi at gmail.com>
> wrote:
>
>> Dear Dennis,
>> So many thanks for your help, but after running the script it said: "f
>> is undefined" !!
>> Why does this happen, please?
>> Best wishes,
>>
>>
>> On Fri, Jun 17, 2022 at 10:49 PM Dennis Shea <shea at ucar.edu> wrote:
>>
>>> Looks like I 'somehow'  deleted a line
>>> ====
>>> Note the script has the following at the top:
>>>
>>> TEST = False
>>> =====
>>>
>>> The published script should be:
>>>
>>>   if (TEST) then   ; <=======  This was inadvertently deleted by 'someone'    :;-)
>>>                                    ;
>>>       ndvi  = short2flt(f->NDVI(:,::50,::25))         ; original unpacked values
>>>   else
>>>       ndvi  = short2flt(f->NDVI)                      ; original unpacked values
>>>   end if
>>>
>>>
>>>
>>> On Fri, Jun 17, 2022 at 4:03 AM Setareh Rahimi via ncl-talk <
>>> ncl-talk at mailman.ucar.edu> wrote:
>>>
>>>> Dear all,
>>>> I would like to use this example "
>>>> https://www.ncl.ucar.edu/Applications/Scripts/ndvi_3.ncl",  available
>>>> at: https://www.ncl.ucar.edu/Applications/ndvi.shtml
>>>> to plot NDVI from Advanced Very High-Resolution Radiometer (AVHRR)
>>>> sensor. But, I got the following error:
>>>>
>>>> fatal:error in statement
>>>> fatal:syntax error: line 55 in file ndvi before or near else
>>>>   else
>>>> -----^
>>>>
>>>> fatal:error in statement
>>>> fatal:syntax error: line 57 in file ndvi before or near if
>>>>   end if
>>>> -------^
>>>> , "IF" statement is not complete. I do not know what condition has been
>>>> considered for the "IF" statement. Would you please kindly advise me?
>>>> Thanks in advance,
>>>> Best wishes,
>>>>
>>>>
>>>>
>>>> --
>>>> S.Rahimi
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at mailman.ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>
>>
>> --
>> S.Rahimi
>>
>>

-- 
S.Rahimi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220621/3d76391f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ss.png
Type: image/png
Size: 280810 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220621/3d76391f/attachment-0001.png>


More information about the ncl-talk mailing list