[gradsusr] [non-nasa source] Re: Plotting daily average

Saunders, Emily (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC] emily.saunders at nasa.gov
Thu Apr 25 09:35:26 EDT 2019


Hi Jennifer,

I have a couple questions about your approach to create the daily means. I created a script that would create the daily means for all days in 2018, but I am unsure how to use the dailymean.dat file when creating the plot. I tried adding the .dat file to a ctl file, but I received the following error message: 

"Error: nc_open failed to open file /nfs3m/archive/sfa_cache04/users/g00/esaunde2/grads_scripts/scripts/GEOS_CF_Total/All_Species/dailymean_totcolco_2018.dat
NetCDF: Unknown file format
gadsdf: Couldn't ingest SDF metadata.
SDF Descriptor file GEOS_CF_hindcast_tavg1_2d_xgc_Nx_daily_totcolco.ctl was not successfully opened & parsed."

Here is the format of the ctl file including the .dat file 
"Dset/nfs3m/archive/sfa_cache04/users/g00/esaunde2/grads_scripts/scripts/GEOS_CF_Total/All_Species/dailymean_totcolco_2018.dat
TITLE Daily Mean totcol_co Jan012018
XDEF lon 1440 LINEAR -180.0 0.25
YDEF lat 721 LINEAR  -90.0 0.25
TDEF time 9000 LINEAR 00:30z01JAN2018 1hr"
Is there a particular format to use when adding a .dat file to a ctl file or do I have to convert the .dat file to a netcdf format. 
Thanks for your help in advance.


Emily 

 

On 3/4/19, 4:45 PM, "gradsusr on behalf of Adams, Jennifer M. (GSFC-610.2)[ADNET SYSTEMS INC]" <gradsusr-bounces at gradsusr.org on behalf of jennifer.m.adams at nasa.gov> wrote:

    Hi, Emily -- 
    If you want to convert a dataset that is hourly to one that is daily, you need to use fwrite (or sdfwrite) to build it explicitly. This is a bare-bones outline for what you need to do, my syntax is not guaranteed to work:
    
    tbeg=1
    tend=365
    'set t 'tbeg' 'tend
    areaavg = tloop(aave(var,g))   ;* define your hourly area average time series first, so you do the I/O only once
    'set fwrite -ap dailymean.dat' 
    '!/bin/rm -f dailymean.dat'    ;* make sure that dailymean.dat does not already exist
    'set gxout fwrite'
    t=tbeg
    while (t<tend)
       'set t 't
       'd ave(areaavg,t+0,t+23)    ;* this is the daily mean 
       t=t+24
    endwhile
    'disable fwrite'
    
    
    -- 
    Jennifer Miletta Adams
    ADNET Systems, Inc.
    NASA/GSFC, Code 610.2
    Building 32, Room S159
    (301) 614-6070
     
    
    On 3/4/19, 12:34 PM, "gradsusr on behalf of Saunders, Emily (GSFC-610.0)[SCIENCE SYSTEMS AND APPLICATIONS INC]" <gradsusr-bounces at gradsusr.org on behalf of emily.saunders at nasa.gov> wrote:
    
        Hi all,
        
        I need some help plotting the daily average for the total CO burden. In 
        my script I am trying to plot the calculated Total CO burden daily 
        average and plot the daily average value for each day, but instead it 
        plots the value for each hour instead of the average of the hours. Here 
        is part of the script I am working with:
        
        'set time 01JAN2019
        'set time 05JAN2019
        'set z 1'
        'set lon 0'
        'set lat 0'
        'set ccolor 14'
        'set cstyle 1'
        'set cthick 10'
        'cons = 2.687e+20/6.022e+23*48/1.0e+12'
        'define tseries = 
        cons*aave(totcol_co,lon=0,lon=360,lat=-90,lat=90)*510.1*1000000000000'
        'define a = ave(tseries, time=00:30z01JAN2019, time=23:30z05JAN2019)'
        'set parea 1.5 9 1.5 7.5'
        'set digsiz 0.10'
        'set cmark 3'
        'd a'
        
        Thank you for your help in advance.
        
        -- 
        Emily Saunders, PhD.
        Senior Research Scientist
        Global Modeling and Assimilation Office/SSAI
        NASA Goddard Space Flight Center Bldg 33, Room H-111B
        Code 610.1, Greenbelt, MD, 20771
        Phone: +1-301-614-6532
        
        _______________________________________________
        gradsusr mailing list
        gradsusr at gradsusr.org
        https://urldefense.proofpoint.com/v2/url?u=http-3A__gradsusr.org_mailman_listinfo_gradsusr&d=DwICAg&c=ApwzowJNAKKw3xye91w7BE1XMRKi2LN9kiMk5Csz9Zk&r=M2mFZsxo0ZoztoK2Lyoypu1kKkBVKyEoM9CXGWO42zk&m=BqvJ1gpPp6UsVJ8xCQgeUVsTqQIUMaKSioEo-DIvRtA&s=iROw_ETmciLifggPzeiuiHIma3NfoWMm6wxnWw40Mds&e=
        
    
    
    _______________________________________________
    gradsusr mailing list
    gradsusr at gradsusr.org
    https://urldefense.proofpoint.com/v2/url?u=http-3A__gradsusr.org_mailman_listinfo_gradsusr&d=DwIGaQ&c=ApwzowJNAKKw3xye91w7BE1XMRKi2LN9kiMk5Csz9Zk&r=-SHQ4f_MglXELUyjmwhuOCNwyN_2_7nEdE9kM7s5Wi0&m=EzYGKrT6gAONwIUhc3Eg38SRp7U9im6HuuZSF2wlmk0&s=oNBsdJCsYTwz2FRjhfF-c38tOjyIgHMbe3nga1GLvZY&e=
    




More information about the gradsusr mailing list