[ncl-talk] How to combine many separate nc files together and convert them to monthly?

Dennis Shea shea at ucar.edu
Tue Jun 28 11:37:24 MDT 2022


As indicated before, your path is wrong.
====
The attached works just fine.

%>  ncl NDVI_TimeSeries.ncl >&! NDVI.Daily_to_Monthly.txt

On Tue, Jun 28, 2022 at 10:25 AM Setareh Rahimi via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Dear all,
>
> I have downloaded the Normalized Difference Vegetation Index (NDVI), from
> the Advanced Very High-Resolution Radiometer (AVHRR) sensor from the link
> below:
>
> https://www.ncei.noaa.gov/metadata/geoportal/rest/metadata/item/gov.noaa.ncdc:C01558/html
>
> As you can see this link provides daily data. And I have downloaded daily
> data from 1986 to 2021. I put the daily data for each year in a separate
> folder.
> Now I tend to calculate the monthly anomaly of NDVI and do not know how to
> combine all these files.
>
> I used the below commands to call the files:
> ========================================
> fils = systemfunc("ls [1-2][8-9-0-1]*/*nc")
>    print(fils)
>
>    f   = addfiles (fils, "r")
>
>    x   = short2flt(f[:]->NDVI)
>
>    printVarSummary(x)
> =========================================
> but got the attached error! Please have a look at the attached screenshot.
> How can I combine all those files together, please?
> I really appreciate any help you can provide.
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220628/63573d06/attachment.htm>
-------------- next part --------------
 Copyright (C) 1995-2017 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.5.0 -29Mar2018_0148
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.


Variable: fils
Type: string
Total Size: 40 bytes
            5 values
Number of Dimensions: 1
Dimensions and sizes:	[5]
Coordinates: 
(0)	AVHRR-Land_v005_AVH13C1_NOAA-09_19860101_c20170612092103.nc
(1)	AVHRR-Land_v005_AVH13C1_NOAA-09_19860102_c20170612093403.nc
(2)	AVHRR-Land_v005_AVH13C1_NOAA-09_19861229_c20170612212717.nc
(3)	AVHRR-Land_v005_AVH13C1_NOAA-09_19861230_c20170612214313.nc
(4)	AVHRR-Land_v005_AVH13C1_NOAA-09_19861231_c20170612215936.nc

Variable: x
Type: float
Total Size: 518400000 bytes
            129600000 values
Number of Dimensions: 3
Dimensions and sizes:	[time | 5] x [latitude | 3600] x [longitude | 7200]
Coordinates: 
            time: [1826..2190]
            latitude: [89.975..-89.97499]
            longitude: [-179.975..179.975]
Number Of Attributes: 7
  long_name :	NOAA Climate Data Record of Normalized Difference Vegetation Index
  units :	1
  grid_mapping :	crs
  standard_name :	normalized_difference_vegetation_index
  _FillValue_original :	-9999
  _FillValue :	-9999
  valid_range :	( -0.09999999,  1 )

Variable: xM
Type: float
Total Size: 207360000 bytes
            51840000 values
Number of Dimensions: 3
Dimensions and sizes:	[time | 2] x [latitude | 3600] x [longitude | 7200]
Coordinates: 
            time: [1826..2188]
            latitude: [89.975..-89.97499]
            longitude: [-179.975..179.975]
Number Of Attributes: 9
  _FillValue :	-9999
  long_name :	NOAA Climate Data Record of Normalized Difference Vegetation Index
  units :	1
  grid_mapping :	crs
  standard_name :	normalized_difference_vegetation_index
  _FillValue_original :	-9999
  valid_range :	( -0.09999999,  1 )
  time :	1826
  NCL_tag :	calculate_monthly_values: arith=avg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NDVI_TimeSeries.ncl
Type: application/octet-stream
Size: 533 bytes
Desc: not available
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220628/63573d06/attachment.obj>


More information about the ncl-talk mailing list