Re: [netcdfgroup] Handling netcdf data

Indri,

Please keep the conversation on the mailing list by using CC or Reply All.

The attributes that you highlighted are simple text strings, which are easy
to change.  This can be done on the unix command line with no programming,
with freeware packages such as *NCO* (NetCDF Operators).  There are several
examples in the description of the *ncatted* utility (attribute editor) in
the *NCO* documentation:

http://nco.sourceforge.net/nco.html#ncatted-netCDF-Attribute-Editor

Here is an example that might work on your actual data file:

ncatted -h -a START_DATE,global,o,c,'2099-01-01_18:00:00' \
    -a SIMULATION_START_DATE,global,o,c,'2099-01-01_18:00:00' filename.nc

I am sure there is also an easy way to do this in python.  Perhaps one of
the python programmers here can give an example.


On Wed, Jan 27, 2021 at 5:36 PM Miranti Indri Hastuti <
mirantihastuti@xxxxxxxxx> wrote:

> Hi Dave,
>
> Thank you for answering my question,
> what I'm going to edit is to change the attributes of ncfile, for example :
> [image: image.png]
> In this ncdef file, I want to change start date and simulation start date.
> Is that possible?
> And my language programming is python.
>
> I am really grateful for your help for answering my questions associated
> on my research.
> Thank you in advance.
>
> sincerely
>
> Indri
>
>
> On Thu, Jan 28, 2021 at 7:34 AM Dave Allured - NOAA Affiliate <
> dave.allured@xxxxxxxx> wrote:
>
>> Indri, there is more than one way to store date and time in a netcdf
>> file.  Please show an actual short example, and describe the general nature
>> of how you want to change it.  Also, what programming languages do you like
>> to use for data work?
>>
>>
>> On Sat, Jan 23, 2021 at 8:50 AM Miranti Indri Hastuti <
>> mirantihastuti@xxxxxxxxx> wrote:
>>
>>> Hi my name is Indri. I want to change the date and time on my netcdf
>>> data. So, is there a way to edit date and time on the netcdf data?
>>>
>>> I am really grateful for your help for answering my questions associated
>>> on my research.
>>> Thank you very much.
>>>
>>> Best Regards
>>> Miranti Indri,
>>>
>>

PNG image

  • 2021 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: