Re: [netcdfgroup] [EXTERNAL] Re: Handling netcdf data

  • To: Dave Allured - NOAA Affiliate <dave.allured@xxxxxxxx>, Miranti Indri Hastuti <mirantihastuti@xxxxxxxxx>
  • Subject: Re: [netcdfgroup] [EXTERNAL] Re: Handling netcdf data
  • From: "Lynnes, Christopher S. (GSFC-5860)" <christopher.s.lynnes@xxxxxxxx>
  • Date: Thu, 28 Jan 2021 13:51:49 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nasa.gov; dmarc=pass action=none header.from=nasa.gov; dkim=pass header.d=nasa.gov; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=iq6L9YNbdMYBTtXA7zOnyeNt8QAdwvnFmnRA0rnQw8c=; b=hS+cbwhoCCWJebvXEqavsFlFUz7ljMVw5lvfUqCsFAGjjWR664JKORFIo6+nl4ntyWArufFfkk13uiwP2S0kqZpGTbP7JHsBEhETg2byyfBD/7gQ7slhTT41+09/Bg+lDaTUO/VvJhSQqbeww3hc49lRdUbjv6AiV1OzYWbEWtWeIYY26lfFId7ku/8S0LJetoEcJ84COmaCepnWQq6iktF/tCCic0kxquSnpZ8JdTMkNqFi4mujjqI1ii+bsi2NnXWDBJnj9okLjulT6H1q7WdUkYJqxl+RUchhx0Ts6PtANMXbNoFocTMKgyRQRQpyzGRhf01fAjM3eLdkrNjduA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GcmiXEIQ87Apf33kvWQf8GfN1GlZptBDnv+BqcARoJqHTK/kVO0gBI5AAWNTdbCXMo+YkzvRFXA6PjYSeHR9LdTqq3atlZE1GOaJ8ZTEK635BnEpVzjhS6w4yh4EXyw3fkEt6DH/e5ay5bbmPdo9nkbUB7B3QrtrD9q4Uwnq1RpogliCfCwrs5f7oRaIEWgcyeRHkkGXNdxIcLD0DFa9H95/bcYqhfMTBHcR1DPmNQnTwrmVfeazlvdHGPjFkU7HowKJOCtOFY/5vhUwoq0BAGmOLxvZW4fdtWOmTNnonu4Yplx30Uk8MK67G8JxX6mQYVTyyx4nK119NoxMPwpNgw==
  • Authentication-results: noaa.gov; dkim=none (message not signed) header.d=none;noaa.gov; dmarc=none action=none header.from=nasa.gov;
Also, I believe there is a Python binding for NCO:  e.g., 
https://github.com/nco/pynco

—
Christopher Lynnes   NASA/GSFC    mobile: 410-231-4573
“Perfection is achieved, not when there is nothing more to add, but when there 
is nothing left to take away.” A. de St. Exupery

On 1/27/21, 21:05, "netcdfgroup on behalf of Dave Allured - NOAA Affiliate via 
netcdfgroup" 
<netcdfgroup-bounces@xxxxxxxxxxxxxxxx<mailto:netcdfgroup-bounces@xxxxxxxxxxxxxxxx>
 on behalf of 
netcdfgroup@xxxxxxxxxxxxxxxx<mailto:netcdfgroup@xxxxxxxxxxxxxxxx>> wrote:

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<https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fnco.sourceforge.net%2Fnco.html%23ncatted-netCDF-Attribute-Editor&data=04%7C01%7Cchristopher.s.lynnes%40nasa.gov%7C729cfc043d354973d16c08d8c3313910%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C637473963470447657%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=XZnYIDD8L6ggVxC7eeTJkNDXnUoBAc5Wi1%2BVd6l1Xlk%3D&reserved=0>

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<https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Ffilename.nc%2F&data=04%7C01%7Cchristopher.s.lynnes%40nasa.gov%7C729cfc043d354973d16c08d8c3313910%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C637473963470447657%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=cr4e1aXRhQtkB0E25YjzLSY%2B8IKZC2VxRlO55VO3bYM%3D&reserved=0>
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<mailto: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 :
[cid:image001.png@01D6F552.D068C9A0]
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<mailto: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<mailto: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: