[ncl-talk] Reducing file size (Michael Notaro)

Peter Nunekpeku pnunekpeku5 at gmail.com
Thu Jan 18 10:28:57 MST 2018


Dear Michael,

Kindly check the chapter on postprocessing tools in the UserGuide of RegCM.

Sample code from manual is below:

nccopy -k 4 -d 9 -s test_001_SRF.1990060100.nc
test_001_SRF.1990060100_compressed.nc


Hope this is helpful.

Regards,

Peter.

On 18 Jan 2018 15:28, <ncl-talk-request at ucar.edu> wrote:

Send ncl-talk mailing list submissions to
        ncl-talk at ucar.edu

To subscribe or unsubscribe via the World Wide Web, visit
        http://mailman.ucar.edu/mailman/listinfo/ncl-talk
or, via email, send a message with subject or body 'help' to
        ncl-talk-request at ucar.edu

You can reach the person managing the list at
        ncl-talk-owner at ucar.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of ncl-talk digest..."


Today's Topics:

   1. Reducing file size (Michael Notaro)
   2. Re: Reducing file size (Guido Cioni)
   3. Re: ttest values not plotting (Sri Nandini)


----------------------------------------------------------------------

Message: 1
Date: Thu, 18 Jan 2018 15:02:19 +0000
From: Michael Notaro <mnotaro at wisc.edu>
To: "ncl-talk at ucar.edu" <ncl-talk at ucar.edu>
Subject: [ncl-talk] Reducing file size
Message-ID:
        <DM5PR06MB3195ABB7F99D53454D04A6BFCAE80 at DM5PR06MB3195.
namprd06.prod.outlook.com>

Content-Type: text/plain; charset="iso-8859-1"

I have about 10 TB of regional climate model output SRF files

that I need to reduce in size probably to 1 TB.  For example,

one monthly file, as dumped below, IPSL_SRF.1998010100.nc,

is 2.3 GB.  Any recommendations in NCL on how

to effectively accomplish this task? (e.g. command

to convert the contents to short, or way to

compress the content, etc)

Thanks, Michael



[notaro at petenwell ~/processing]# ls -l -h *nc

-rw-r--r-- 1 notaro notaro 2.3G Jan 18 08:35 IPSL_SRF.1998010100.nc

[notaro at petenwell ~/processing]# ncdump -h IPSL_SRF.1998010100.nc

netcdf IPSL_SRF.1998010100 {

dimensions:

jx = 217 ;

iy = 141 ;

kz = 28 ;

time = UNLIMITED ; // (744 currently)

m10 = 1 ;

m2 = 1 ;

soil_layer = 2 ;

time_bounds = 2 ;

variables:

float jx(jx) ;

jx:long_name = "x-coordinate in Cartesian system" ;

jx:standard_name = "projection_x_coordinate" ;

jx:units = "m" ;

jx:axis = "X" ;

jx:_CoordinateAxisType = "GeoX" ;

float iy(iy) ;

iy:long_name = "y-coordinate in Cartesian system" ;

iy:standard_name = "projection_y_coordinate" ;

iy:units = "m" ;

iy:axis = "Y" ;

iy:_CoordinateAxisType = "GeoY" ;

float sigma(kz) ;

sigma:long_name = "Sigma at half model layers" ;

sigma:standard_name = "atmosphere_sigma_coordinate" ;

sigma:units = "1" ;

sigma:axis = "Z" ;

sigma:positive = "down" ;

sigma:formula_terms = "sigma: sigma ps: ps ptop: ptop" ;

sigma:_CoordinateAxisType = "GeoZ" ;

float ptop ;

ptop:long_name = "Pressure at model top" ;

ptop:standard_name = "air_pressure" ;

ptop:units = "hPa" ;

float xlon(iy, jx) ;

xlon:long_name = "Longitude on Cross Points" ;

xlon:standard_name = "longitude" ;

xlon:units = "degrees_east" ;

xlon:grid_mapping = "rcm_map" ;

float xlat(iy, jx) ;

xlat:long_name = "Latitude on Cross Points" ;

xlat:standard_name = "latitude" ;

xlat:units = "degrees_north" ;

xlat:grid_mapping = "rcm_map" ;

float mask(iy, jx) ;

mask:long_name = "Land Mask" ;

mask:standard_name = "land_binary_mask" ;

mask:units = "1" ;

mask:coordinates = "xlat xlon" ;

mask:grid_mapping = "rcm_map" ;

float topo(iy, jx) ;

topo:long_name = "Surface Model Elevation" ;

topo:standard_name = "surface_altitude" ;

topo:units = "m" ;

topo:coordinates = "xlat xlon" ;

topo:grid_mapping = "rcm_map" ;

float ps(time, iy, jx) ;

ps:long_name = "Surface Pressure" ;

ps:standard_name = "surface_air_pressure" ;

ps:units = "hPa" ;

ps:coordinates = "xlat xlon" ;

ps:grid_mapping = "rcm_map" ;

ps:cell_methods = "time: point" ;

float drag(time, iy, jx) ;

drag:long_name = "Surface drag stress coefficient in air" ;

drag:standard_name = "surface_drag_coefficient_in_air" ;

drag:units = "1" ;

drag:coordinates = "xlat xlon" ;

drag:grid_mapping = "rcm_map" ;

drag:cell_methods = "time: point" ;

float ts(time, iy, jx) ;

ts:long_name = "Ground surface temperature" ;

ts:standard_name = "surface_temperature" ;

ts:units = "K" ;

ts:coordinates = "xlat xlon" ;

ts:grid_mapping = "rcm_map" ;

ts:cell_methods = "time: point" ;

float tf(time, iy, jx) ;

tf:long_name = "Foliage canopy temperature" ;

tf:standard_name = "canopy_temperature" ;

tf:units = "K" ;

tf:coordinates = "xlat xlon" ;

tf:grid_mapping = "rcm_map" ;

tf:cell_methods = "time: point" ;

tf:_FillValue = 1.e+20f ;

float pr(time, iy, jx) ;

pr:long_name = "Total precipitation flux" ;

pr:standard_name = "precipitation_flux" ;

pr:units = "kg m-2 s-1" ;

pr:coordinates = "xlat xlon" ;

pr:grid_mapping = "rcm_map" ;

pr:cell_methods = "time: mean" ;

float evspsbl(time, iy, jx) ;

evspsbl:long_name = "Total evapotranspiration flux" ;

evspsbl:standard_name = "water_evaporation_flux" ;

evspsbl:units = "kg m-2 s-1" ;

evspsbl:coordinates = "xlat xlon" ;

evspsbl:grid_mapping = "rcm_map" ;

evspsbl:cell_methods = "time: mean" ;

float snv(time, iy, jx) ;

snv:long_name = "Liquid water equivalent of snow thickness" ;

snv:standard_name = "lwe_thickness_of_surface_snow_amount" ;

snv:units = "kg m-2" ;

snv:coordinates = "xlat xlon" ;

snv:grid_mapping = "rcm_map" ;

snv:cell_methods = "time: mean" ;

snv:_FillValue = 1.e+20f ;

float hfss(time, iy, jx) ;

hfss:long_name = "Sensible heat flux" ;

hfss:standard_name = "surface_upward_sensible_heat_flux" ;

hfss:units = "W m-2" ;

hfss:coordinates = "xlat xlon" ;

hfss:grid_mapping = "rcm_map" ;

hfss:cell_methods = "time: mean" ;

float rsnl(time, iy, jx) ;

rsnl:long_name = "Net upward longwave energy flux" ;

rsnl:standard_name = "net_upward_longwave_flux_in_air" ;

rsnl:units = "W m-2" ;

rsnl:coordinates = "xlat xlon" ;

rsnl:grid_mapping = "rcm_map" ;

rsnl:cell_methods = "time: mean" ;

float rsns(time, iy, jx) ;

rsns:long_name = "Net downward shortwave energy flux" ;

rsns:standard_name = "net_downward_shortwave_flux_in_air" ;

rsns:units = "W m-2" ;

rsns:coordinates = "xlat xlon" ;

rsns:grid_mapping = "rcm_map" ;

rsns:cell_methods = "time: mean" ;

float rsdl(time, iy, jx) ;

rsdl:long_name = "Surface downward longwave flux in air" ;

rsdl:standard_name = "surface_downwelling_longwave_flux_in_air" ;

rsdl:units = "W m-2" ;

rsdl:coordinates = "xlat xlon" ;

rsdl:grid_mapping = "rcm_map" ;

rsdl:cell_methods = "time: mean" ;

float rsds(time, iy, jx) ;

rsds:long_name = "Surface downward shortwave flux in air" ;

rsds:standard_name = "surface_downwelling_shortwave_flux_in_air" ;

rsds:units = "W m-2" ;

rsds:coordinates = "xlat xlon" ;

rsds:grid_mapping = "rcm_map" ;

rsds:cell_methods = "time: mean" ;

float prc(time, iy, jx) ;

prc:long_name = "Convective precipitation flux" ;

prc:standard_name = "convective_rainfall_flux" ;

prc:units = "kg m-2 s-1" ;

prc:coordinates = "xlat xlon" ;

prc:grid_mapping = "rcm_map" ;

prc:cell_methods = "time: mean" ;

float zmla(time, iy, jx) ;

zmla:long_name = "Atmospheric Boundary Layer thickness" ;

zmla:standard_name = "atmosphere_boundary_layer_thickness" ;

zmla:units = "m" ;

zmla:coordinates = "xlat xlon" ;

zmla:grid_mapping = "rcm_map" ;

zmla:cell_methods = "time: point" ;

float aldirs(time, iy, jx) ;

aldirs:long_name = "Surface albedo to direct shortwave radiation" ;

aldirs:standard_name = "surface_albedo_short_wave_direct" ;

aldirs:units = "1" ;

aldirs:coordinates = "xlat xlon" ;

aldirs:grid_mapping = "rcm_map" ;

aldirs:cell_methods = "time: point" ;

float aldifs(time, iy, jx) ;

aldifs:long_name = "Surface albedo to diffuse shortwave radiation" ;

aldifs:standard_name = "surface_albedo_short_wave_diffuse" ;

aldifs:units = "1" ;

aldifs:coordinates = "xlat xlon" ;

aldifs:grid_mapping = "rcm_map" ;

aldifs:cell_methods = "time: point" ;

float sund(time, iy, jx) ;

sund:long_name = "Duration of sunshine" ;

sund:standard_name = "duration_of_sunshine" ;

sund:units = "s" ;

sund:coordinates = "xlat xlon" ;

sund:grid_mapping = "rcm_map" ;

sund:cell_methods = "time: sum" ;

float sndp(time, iy, jx) ;

sndp:long_name = "Actual snow depth" ;

sndp:standard_name = "snow_depth" ;

sndp:units = "mm" ;

sndp:coordinates = "xlat xlon" ;

sndp:grid_mapping = "rcm_map" ;

sndp:cell_methods = "time: mean" ;

sndp:_FillValue = 1.e+20f ;

float snfl(time, iy, jx) ;

snfl:long_name = "Snowfall" ;

snfl:standard_name = "snow_fall" ;

snfl:units = "kg m-2 s-1" ;

snfl:coordinates = "xlat xlon" ;

snfl:grid_mapping = "rcm_map" ;

snfl:cell_methods = "time: mean" ;

float uas(time, m10, iy, jx) ;

uas:long_name = "Anemometric zonal (westerly) wind component" ;

uas:standard_name = "eastward_wind" ;

uas:units = "m s-1" ;

uas:coordinates = "xlat xlon" ;

uas:grid_mapping = "rcm_map" ;

uas:cell_methods = "time: point" ;

float vas(time, m10, iy, jx) ;

vas:long_name = "Anenometric meridional (southerly) wind component" ;

vas:standard_name = "northward_wind" ;

vas:units = "m s-1" ;

vas:coordinates = "xlat xlon" ;

vas:grid_mapping = "rcm_map" ;

vas:cell_methods = "time: point" ;

float tas(time, m2, iy, jx) ;

tas:long_name = "Near surface air temperature" ;

tas:standard_name = "air_temperature" ;

tas:units = "K" ;

tas:coordinates = "xlat xlon" ;

tas:grid_mapping = "rcm_map" ;

tas:cell_methods = "time: point" ;

float qas(time, m2, iy, jx) ;

qas:long_name = "Near surface air specific humidity" ;

qas:standard_name = "specific_humidity" ;

qas:units = "1" ;

qas:coordinates = "xlat xlon" ;

qas:grid_mapping = "rcm_map" ;

qas:cell_methods = "time: point" ;

float mrso(time, soil_layer, iy, jx) ;

mrso:long_name = "Moisture content of the soil layers" ;

mrso:standard_name = "soil_moisture_content_in_layers" ;

mrso:units = "kg m-2" ;

mrso:coordinates = "xlat xlon" ;

mrso:grid_mapping = "rcm_map" ;

mrso:cell_methods = "time: point" ;

mrso:_FillValue = 1.e+20f ;

float mrro(time, soil_layer, iy, jx) ;

mrro:long_name = "Runoff flux" ;

mrro:standard_name = "runoff_flux" ;

mrro:units = "kg m-2 s-1" ;

mrro:coordinates = "xlat xlon" ;

mrro:grid_mapping = "rcm_map" ;

mrro:cell_methods = "time: mean" ;

mrro:_FillValue = 1.e+20f ;

float time(time) ;

time:long_name = "time" ;

time:standard_name = "time" ;

time:units = "hours since 1949-12-01 00:00:00 UTC" ;

time:calendar = "noleap" ;

time:bounds = "time_bnds" ;

float time_bnds(time, time_bounds) ;

time_bnds:units = "hours since 1949-12-01 00:00:00 UTC" ;

time_bnds:calendar = "noleap" ;

char rcm_map ;

rcm_map:grid_mapping_name = "lambert_conformal_conic" ;

rcm_map:standard_parallel = 36., 52. ;

rcm_map:longitude_of_central_meridian = -97. ;

rcm_map:latitude_of_projection_origin = 45. ;

rcm_map:_CoordinateTransformType = "Projection" ;

rcm_map:_CoordinateAxisTypes = "GeoX GeoY" ;


// global attributes:

:title = "ICTP Regional Climatic model V4" ;

:institution = "ICTP" ;

:source = "RegCM Model output file" ;

:Conventions = "CF-1.4" ;

:references = "http://gforge.ictp.it/gf/project/regcm" ;

:model_revision = "tag 4.3.5.6" ;

:history = "2015-01-25 04:40:03 : Created by RegCM RegCM Model program" ;

:experiment = "IPSL" ;

:projection = "LAMCON" ;

:grid_size_in_meters = 25000. ;

:latitude_of_projection_origin = 45. ;

:longitude_of_projection_origin = -97. ;

:standard_parallel = 36., 52. ;

:grid_factor = 0.696943758331507 ;

:boundary_nspgx = 15 ;

:boundary_nspgd = 15 ;

:boundary_high_nudge = 3. ;

:boundary_medium_nudge = 2. ;

:boundary_low_nudge = 1. ;

:model_is_restarted = "Yes" ;

:model_simulation_initial_start = "1977-06-01 00:00:00 UTC" ;

:model_simulation_start = "1998-01-01 00:00:00 UTC" ;

:model_simulation_end = "1999-01-01 00:00:00 UTC" ;

:atmosphere_time_step_in_seconds = 120. ;

:surface_interaction_time_step_in_seconds = 120. ;

:radiation_scheme_time_step_in_minuts = 30. ;

:absorption_emission_time_step_in_hours = 18. ;

:lateral_boundary_condition_scheme = 1 ;

:boundary_layer_scheme = 1 ;

:cumulus_convection_scheme = 2 ;

:grell_scheme_closure = 2 ;

:moisture_scheme = 1 ;

:ocean_flux_scheme = 2 ;

:zeng_ocean_roughness_formula = 1 ;

:pressure_gradient_scheme = 0 ;

:surface_emissivity_factor_computed = 0 ;

:lake_model_activated = 1 ;

:chemical_aerosol_scheme_activated = 0 ;

:ipcc_scenario_code = "RF" ;

:diurnal_cycle_sst_scheme = 0 ;

:simple_sea_ice_scheme = 0 ;

:seasonal_desert_albedo = 1 ;

:convective_lwp_as_large_scale = 1 ;

:rrtm_radiation_scheme_activated = 0 ;

:climatic_ozone_input_dataset = 0 ;

:static_solar_constant_used = 1 ;

:subex_bottom_level_with_no_clouds = 1 ;

:subex_maximum_cloud_fraction_cover = 0.8 ;

:subex_auto_conversion_rate_for_land = 0.00025 ;

:subex_auto_conversion_rate_for_ocean = 0.00025 ;

:subex_gultepe_factor_when_rain_for_land = 0.4 ;

:subex_gultepe_factor_when_rain_for_ocean = 0.4 ;

:subex_rh_with_fcc_one = 1.01 ;

:subex_rh_threshold_for_land = 0.8 ;

:subex_rh_threshold_for_ocean = 0.9 ;

:subex_limit_temperature = 238. ;

:subex_raindrop_evaporation_rate = 0.0008 ;

:subex_raindrop_accretion_rate = 3. ;

:subex_cloud_fraction_maximum = 0.75 ;

:subex_cloud_fraction_max_for_convection = 0.25 ;

:subex_cloud_liqwat_max_for_convection = 5.e-05 ;

:grell_min_shear_on_precip = 0.25 ;

:grell_max_shear_on_precip = 0.5 ;

:grell_min_precip_efficiency = 0.25 ;

:grell_max_precip_efficiency = 0.5 ;

:grell_min_precip_efficiency_o = 0.25 ;

:grell_max_precip_efficiency_o = 0.5 ;

:grell_min_precip_efficiency_x = 0.25 ;

:grell_max_precip_efficiency_x = 0.5 ;

:grell_min_shear_on_precip_on_ocean = 0.25 ;

:grell_max_shear_on_precip_on_ocean = 0.5 ;

:grell_min_precip_efficiency_on_ocean = 0.25 ;

:grell_max_precip_efficiency_on_ocean = 0.5 ;

:grell_min_precip_efficiency_o_on_ocean = 0.25 ;

:grell_max_precip_efficiency_o_on_ocean = 0.5 ;

:grell_min_precip_efficiency_x_on_ocean = 0.25 ;

:grell_max_precip_efficiency_x_on_ocean = 0.5 ;

:grell_max_depth_of_stable_layer = 150. ;

:grell_min_depth_of_cloud = 150. ;

:grell_min_convective_heating = -250. ;

:grell_max_convective_heating = 500. ;

:grell_max_cloud_base_height = 0.4 ;

:grell_FC_ABE_removal_timescale = 30. ;

:holtslag_critical_ocean_richardson = 0.25 ;

:holtslag_critical_land_richardson = 0.25 ;

}



Michael Notaro
Associate Director
Nelson Institute Center for Climatic Research
University of Wisconsin-Madison
Phone: (608) 261-1503
Email: mnotaro at wisc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/
attachments/20180118/cd13d908/attachment-0001.html>

------------------------------

Message: 2
Date: Thu, 18 Jan 2018 16:09:52 +0100
From: Guido Cioni <guidocioni at gmail.com>
To: Michael Notaro <mnotaro at wisc.edu>
Cc: "ncl-talk at ucar.edu" <ncl-talk at ucar.edu>
Subject: Re: [ncl-talk] Reducing file size
Message-ID: <1414CD3F-4265-4335-8AA4-20734B116CC2 at gmail.com>
Content-Type: text/plain; charset="us-ascii"

Michael,
first of all I would strongly suggest you to do that outside of NCL.
If you try to read a 10 TB inside NCL and define some variables you will
likely end up with a segmentation fault or extremely slow execution.
You likely want to use fast-processing techniques that make use of
C++/Fortran architectures, like CDO or NCO.

Regarding your task, however, it is hard to give you a suggestion. If the
original file was created like that it means that all variables have the
correct type/units/attributes (I guess). Thus, I don't know what you can
achieve by changing type, if not a strong headache in trying to read and
write again the file :)

Any chance you have the original GRIB file? You can try to convert it to
GRIB, which will save you at most 50% of the space, but it is tricky....

Anyway it would be nice to know what you want to achieve in the end. Do you
need to process the data? Do a plot? You can still extract a single level,
variable or even time step beforehand (CDO or NCO), and that will surely
reduce the size and the time that you need to read it inside NCL.

Cheers

> On 18. Jan 2018, at 16:02, Michael Notaro via ncl-talk <ncl-talk at ucar.edu>
wrote:
>
> I have about 10 TB of regional climate model output SRF files
> that I need to reduce in size probably to 1 TB.  For example,
> one monthly file, as dumped below, IPSL_SRF.1998010100.nc,
> is 2.3 GB.  Any recommendations in NCL on how
> to effectively accomplish this task? (e.g. command
> to convert the contents to short, or way to
> compress the content, etc)
> Thanks, Michael
>
>
> [notaro at petenwell ~/processing]# ls -l -h *nc
> -rw-r--r-- 1 notaro notaro 2.3G Jan 18 08:35 IPSL_SRF.1998010100.nc
> [notaro at petenwell ~/processing]# ncdump -h IPSL_SRF.1998010100.nc
> netcdf IPSL_SRF.1998010100 {
> dimensions:
> jx = 217 ;
> iy = 141 ;
> kz = 28 ;
> time = UNLIMITED ; // (744 currently)
> m10 = 1 ;
> m2 = 1 ;
> soil_layer = 2 ;
> time_bounds = 2 ;
> variables:
> float jx(jx) ;
> jx:long_name = "x-coordinate in Cartesian system" ;
> jx:standard_name = "projection_x_coordinate" ;
> jx:units = "m" ;
> jx:axis = "X" ;
> jx:_CoordinateAxisType = "GeoX" ;
> float iy(iy) ;
> iy:long_name = "y-coordinate in Cartesian system" ;
> iy:standard_name = "projection_y_coordinate" ;
> iy:units = "m" ;
> iy:axis = "Y" ;
> iy:_CoordinateAxisType = "GeoY" ;
> float sigma(kz) ;
> sigma:long_name = "Sigma at half model layers" ;
> sigma:standard_name = "atmosphere_sigma_coordinate" ;
> sigma:units = "1" ;
> sigma:axis = "Z" ;
> sigma:positive = "down" ;
> sigma:formula_terms = "sigma: sigma ps: ps ptop: ptop" ;
> sigma:_CoordinateAxisType = "GeoZ" ;
> float ptop ;
> ptop:long_name = "Pressure at model top" ;
> ptop:standard_name = "air_pressure" ;
> ptop:units = "hPa" ;
> float xlon(iy, jx) ;
> xlon:long_name = "Longitude on Cross Points" ;
> xlon:standard_name = "longitude" ;
> xlon:units = "degrees_east" ;
> xlon:grid_mapping = "rcm_map" ;
> float xlat(iy, jx) ;
> xlat:long_name = "Latitude on Cross Points" ;
> xlat:standard_name = "latitude" ;
> xlat:units = "degrees_north" ;
> xlat:grid_mapping = "rcm_map" ;
> float mask(iy, jx) ;
> mask:long_name = "Land Mask" ;
> mask:standard_name = "land_binary_mask" ;
> mask:units = "1" ;
> mask:coordinates = "xlat xlon" ;
> mask:grid_mapping = "rcm_map" ;
> float topo(iy, jx) ;
> topo:long_name = "Surface Model Elevation" ;
> topo:standard_name = "surface_altitude" ;
> topo:units = "m" ;
> topo:coordinates = "xlat xlon" ;
> topo:grid_mapping = "rcm_map" ;
> float ps(time, iy, jx) ;
> ps:long_name = "Surface Pressure" ;
> ps:standard_name = "surface_air_pressure" ;
> ps:units = "hPa" ;
> ps:coordinates = "xlat xlon" ;
> ps:grid_mapping = "rcm_map" ;
> ps:cell_methods = "time: point" ;
> float drag(time, iy, jx) ;
> drag:long_name = "Surface drag stress coefficient in air" ;
> drag:standard_name = "surface_drag_coefficient_in_air" ;
> drag:units = "1" ;
> drag:coordinates = "xlat xlon" ;
> drag:grid_mapping = "rcm_map" ;
> drag:cell_methods = "time: point" ;
> float ts(time, iy, jx) ;
> ts:long_name = "Ground surface temperature" ;
> ts:standard_name = "surface_temperature" ;
> ts:units = "K" ;
> ts:coordinates = "xlat xlon" ;
> ts:grid_mapping = "rcm_map" ;
> ts:cell_methods = "time: point" ;
> float tf(time, iy, jx) ;
> tf:long_name = "Foliage canopy temperature" ;
> tf:standard_name = "canopy_temperature" ;
> tf:units = "K" ;
> tf:coordinates = "xlat xlon" ;
> tf:grid_mapping = "rcm_map" ;
> tf:cell_methods = "time: point" ;
> tf:_FillValue = 1.e+20f ;
> float pr(time, iy, jx) ;
> pr:long_name = "Total precipitation flux" ;
> pr:standard_name = "precipitation_flux" ;
> pr:units = "kg m-2 s-1" ;
> pr:coordinates = "xlat xlon" ;
> pr:grid_mapping = "rcm_map" ;
> pr:cell_methods = "time: mean" ;
> float evspsbl(time, iy, jx) ;
> evspsbl:long_name = "Total evapotranspiration flux" ;
> evspsbl:standard_name = "water_evaporation_flux" ;
> evspsbl:units = "kg m-2 s-1" ;
> evspsbl:coordinates = "xlat xlon" ;
> evspsbl:grid_mapping = "rcm_map" ;
> evspsbl:cell_methods = "time: mean" ;
> float snv(time, iy, jx) ;
> snv:long_name = "Liquid water equivalent of snow thickness" ;
> snv:standard_name = "lwe_thickness_of_surface_snow_amount" ;
> snv:units = "kg m-2" ;
> snv:coordinates = "xlat xlon" ;
> snv:grid_mapping = "rcm_map" ;
> snv:cell_methods = "time: mean" ;
> snv:_FillValue = 1.e+20f ;
> float hfss(time, iy, jx) ;
> hfss:long_name = "Sensible heat flux" ;
> hfss:standard_name = "surface_upward_sensible_heat_flux" ;
> hfss:units = "W m-2" ;
> hfss:coordinates = "xlat xlon" ;
> hfss:grid_mapping = "rcm_map" ;
> hfss:cell_methods = "time: mean" ;
> float rsnl(time, iy, jx) ;
> rsnl:long_name = "Net upward longwave energy flux" ;
> rsnl:standard_name = "net_upward_longwave_flux_in_air" ;
> rsnl:units = "W m-2" ;
> rsnl:coordinates = "xlat xlon" ;
> rsnl:grid_mapping = "rcm_map" ;
> rsnl:cell_methods = "time: mean" ;
> float rsns(time, iy, jx) ;
> rsns:long_name = "Net downward shortwave energy flux" ;
> rsns:standard_name = "net_downward_shortwave_flux_in_air" ;
> rsns:units = "W m-2" ;
> rsns:coordinates = "xlat xlon" ;
> rsns:grid_mapping = "rcm_map" ;
> rsns:cell_methods = "time: mean" ;
> float rsdl(time, iy, jx) ;
> rsdl:long_name = "Surface downward longwave flux in air" ;
> rsdl:standard_name = "surface_downwelling_longwave_flux_in_air" ;
> rsdl:units = "W m-2" ;
> rsdl:coordinates = "xlat xlon" ;
> rsdl:grid_mapping = "rcm_map" ;
> rsdl:cell_methods = "time: mean" ;
> float rsds(time, iy, jx) ;
> rsds:long_name = "Surface downward shortwave flux in air" ;
> rsds:standard_name = "surface_downwelling_shortwave_flux_in_air" ;
> rsds:units = "W m-2" ;
> rsds:coordinates = "xlat xlon" ;
> rsds:grid_mapping = "rcm_map" ;
> rsds:cell_methods = "time: mean" ;
> float prc(time, iy, jx) ;
> prc:long_name = "Convective precipitation flux" ;
> prc:standard_name = "convective_rainfall_flux" ;
> prc:units = "kg m-2 s-1" ;
> prc:coordinates = "xlat xlon" ;
> prc:grid_mapping = "rcm_map" ;
> prc:cell_methods = "time: mean" ;
> float zmla(time, iy, jx) ;
> zmla:long_name = "Atmospheric Boundary Layer thickness" ;
> zmla:standard_name = "atmosphere_boundary_layer_thickness" ;
> zmla:units = "m" ;
> zmla:coordinates = "xlat xlon" ;
> zmla:grid_mapping = "rcm_map" ;
> zmla:cell_methods = "time: point" ;
> float aldirs(time, iy, jx) ;
> aldirs:long_name = "Surface albedo to direct shortwave radiation" ;
> aldirs:standard_name = "surface_albedo_short_wave_direct" ;
> aldirs:units = "1" ;
> aldirs:coordinates = "xlat xlon" ;
> aldirs:grid_mapping = "rcm_map" ;
> aldirs:cell_methods = "time: point" ;
> float aldifs(time, iy, jx) ;
> aldifs:long_name = "Surface albedo to diffuse shortwave radiation" ;
> aldifs:standard_name = "surface_albedo_short_wave_diffuse" ;
> aldifs:units = "1" ;
> aldifs:coordinates = "xlat xlon" ;
> aldifs:grid_mapping = "rcm_map" ;
> aldifs:cell_methods = "time: point" ;
> float sund(time, iy, jx) ;
> sund:long_name = "Duration of sunshine" ;
> sund:standard_name = "duration_of_sunshine" ;
> sund:units = "s" ;
> sund:coordinates = "xlat xlon" ;
> sund:grid_mapping = "rcm_map" ;
> sund:cell_methods = "time: sum" ;
> float sndp(time, iy, jx) ;
> sndp:long_name = "Actual snow depth" ;
> sndp:standard_name = "snow_depth" ;
> sndp:units = "mm" ;
> sndp:coordinates = "xlat xlon" ;
> sndp:grid_mapping = "rcm_map" ;
> sndp:cell_methods = "time: mean" ;
> sndp:_FillValue = 1.e+20f ;
> float snfl(time, iy, jx) ;
> snfl:long_name = "Snowfall" ;
> snfl:standard_name = "snow_fall" ;
> snfl:units = "kg m-2 s-1" ;
> snfl:coordinates = "xlat xlon" ;
> snfl:grid_mapping = "rcm_map" ;
> snfl:cell_methods = "time: mean" ;
> float uas(time, m10, iy, jx) ;
> uas:long_name = "Anemometric zonal (westerly) wind component" ;
> uas:standard_name = "eastward_wind" ;
> uas:units = "m s-1" ;
> uas:coordinates = "xlat xlon" ;
> uas:grid_mapping = "rcm_map" ;
> uas:cell_methods = "time: point" ;
> float vas(time, m10, iy, jx) ;
> vas:long_name = "Anenometric meridional (southerly) wind component" ;
> vas:standard_name = "northward_wind" ;
> vas:units = "m s-1" ;
> vas:coordinates = "xlat xlon" ;
> vas:grid_mapping = "rcm_map" ;
> vas:cell_methods = "time: point" ;
> float tas(time, m2, iy, jx) ;
> tas:long_name = "Near surface air temperature" ;
> tas:standard_name = "air_temperature" ;
> tas:units = "K" ;
> tas:coordinates = "xlat xlon" ;
> tas:grid_mapping = "rcm_map" ;
> tas:cell_methods = "time: point" ;
> float qas(time, m2, iy, jx) ;
> qas:long_name = "Near surface air specific humidity" ;
> qas:standard_name = "specific_humidity" ;
> qas:units = "1" ;
> qas:coordinates = "xlat xlon" ;
> qas:grid_mapping = "rcm_map" ;
> qas:cell_methods = "time: point" ;
> float mrso(time, soil_layer, iy, jx) ;
> mrso:long_name = "Moisture content of the soil layers" ;
> mrso:standard_name = "soil_moisture_content_in_layers" ;
> mrso:units = "kg m-2" ;
> mrso:coordinates = "xlat xlon" ;
> mrso:grid_mapping = "rcm_map" ;
> mrso:cell_methods = "time: point" ;
> mrso:_FillValue = 1.e+20f ;
> float mrro(time, soil_layer, iy, jx) ;
> mrro:long_name = "Runoff flux" ;
> mrro:standard_name = "runoff_flux" ;
> mrro:units = "kg m-2 s-1" ;
> mrro:coordinates = "xlat xlon" ;
> mrro:grid_mapping = "rcm_map" ;
> mrro:cell_methods = "time: mean" ;
> mrro:_FillValue = 1.e+20f ;
> float time(time) ;
> time:long_name = "time" ;
> time:standard_name = "time" ;
> time:units = "hours since 1949-12-01 00:00:00 UTC" ;
> time:calendar = "noleap" ;
> time:bounds = "time_bnds" ;
> float time_bnds(time, time_bounds) ;
> time_bnds:units = "hours since 1949-12-01 00:00:00 UTC" ;
> time_bnds:calendar = "noleap" ;
> char rcm_map ;
> rcm_map:grid_mapping_name = "lambert_conformal_conic" ;
> rcm_map:standard_parallel = 36., 52. ;
> rcm_map:longitude_of_central_meridian = -97. ;
> rcm_map:latitude_of_projection_origin = 45. ;
> rcm_map:_CoordinateTransformType = "Projection" ;
> rcm_map:_CoordinateAxisTypes = "GeoX GeoY" ;
>
> // global attributes:
> :title = "ICTP Regional Climatic model V4" ;
> :institution = "ICTP" ;
> :source = "RegCM Model output file" ;
> :Conventions = "CF-1.4" ;
> :references = "http://gforge.ictp.it/gf/project/regcm <
http://gforge.ictp.it/gf/project/regcm>" ;
> :model_revision = "tag 4.3.5.6" ;
> :history = "2015-01-25 04:40:03 : Created by RegCM RegCM Model program" ;
> :experiment = "IPSL" ;
> :projection = "LAMCON" ;
> :grid_size_in_meters = 25000. ;
> :latitude_of_projection_origin = 45. ;
> :longitude_of_projection_origin = -97. ;
> :standard_parallel = 36., 52. ;
> :grid_factor = 0.696943758331507 ;
> :boundary_nspgx = 15 ;
> :boundary_nspgd = 15 ;
> :boundary_high_nudge = 3. ;
> :boundary_medium_nudge = 2. ;
> :boundary_low_nudge = 1. ;
> :model_is_restarted = "Yes" ;
> :model_simulation_initial_start = "1977-06-01 00:00:00 UTC" ;
> :model_simulation_start = "1998-01-01 00:00:00 UTC" ;
> :model_simulation_end = "1999-01-01 00:00:00 UTC" ;
> :atmosphere_time_step_in_seconds = 120. ;
> :surface_interaction_time_step_in_seconds = 120. ;
> :radiation_scheme_time_step_in_minuts = 30. ;
> :absorption_emission_time_step_in_hours = 18. ;
> :lateral_boundary_condition_scheme = 1 ;
> :boundary_layer_scheme = 1 ;
> :cumulus_convection_scheme = 2 ;
> :grell_scheme_closure = 2 ;
> :moisture_scheme = 1 ;
> :ocean_flux_scheme = 2 ;
> :zeng_ocean_roughness_formula = 1 ;
> :pressure_gradient_scheme = 0 ;
> :surface_emissivity_factor_computed = 0 ;
> :lake_model_activated = 1 ;
> :chemical_aerosol_scheme_activated = 0 ;
> :ipcc_scenario_code = "RF" ;
> :diurnal_cycle_sst_scheme = 0 ;
> :simple_sea_ice_scheme = 0 ;
> :seasonal_desert_albedo = 1 ;
> :convective_lwp_as_large_scale = 1 ;
> :rrtm_radiation_scheme_activated = 0 ;
> :climatic_ozone_input_dataset = 0 ;
> :static_solar_constant_used = 1 ;
> :subex_bottom_level_with_no_clouds = 1 ;
> :subex_maximum_cloud_fraction_cover = 0.8 ;
> :subex_auto_conversion_rate_for_land = 0.00025 ;
> :subex_auto_conversion_rate_for_ocean = 0.00025 ;
> :subex_gultepe_factor_when_rain_for_land = 0.4 ;
> :subex_gultepe_factor_when_rain_for_ocean = 0.4 ;
> :subex_rh_with_fcc_one = 1.01 ;
> :subex_rh_threshold_for_land = 0.8 ;
> :subex_rh_threshold_for_ocean = 0.9 ;
> :subex_limit_temperature = 238. ;
> :subex_raindrop_evaporation_rate = 0.0008 ;
> :subex_raindrop_accretion_rate = 3. ;
> :subex_cloud_fraction_maximum = 0.75 ;
> :subex_cloud_fraction_max_for_convection = 0.25 ;
> :subex_cloud_liqwat_max_for_convection = 5.e-05 ;
> :grell_min_shear_on_precip = 0.25 ;
> :grell_max_shear_on_precip = 0.5 ;
> :grell_min_precip_efficiency = 0.25 ;
> :grell_max_precip_efficiency = 0.5 ;
> :grell_min_precip_efficiency_o = 0.25 ;
> :grell_max_precip_efficiency_o = 0.5 ;
> :grell_min_precip_efficiency_x = 0.25 ;
> :grell_max_precip_efficiency_x = 0.5 ;
> :grell_min_shear_on_precip_on_ocean = 0.25 ;
> :grell_max_shear_on_precip_on_ocean = 0.5 ;
> :grell_min_precip_efficiency_on_ocean = 0.25 ;
> :grell_max_precip_efficiency_on_ocean = 0.5 ;
> :grell_min_precip_efficiency_o_on_ocean = 0.25 ;
> :grell_max_precip_efficiency_o_on_ocean = 0.5 ;
> :grell_min_precip_efficiency_x_on_ocean = 0.25 ;
> :grell_max_precip_efficiency_x_on_ocean = 0.5 ;
> :grell_max_depth_of_stable_layer = 150. ;
> :grell_min_depth_of_cloud = 150. ;
> :grell_min_convective_heating = -250. ;
> :grell_max_convective_heating = 500. ;
> :grell_max_cloud_base_height = 0.4 ;
> :grell_FC_ABE_removal_timescale = 30. ;
> :holtslag_critical_ocean_richardson = 0.25 ;
> :holtslag_critical_land_richardson = 0.25 ;
> }
>
>
> Michael Notaro
> Associate Director
> Nelson Institute Center for Climatic Research
> University of Wisconsin-Madison
> Phone: (608) 261-1503
> Email: mnotaro at wisc.edu <mailto:mnotaro at wisc.edu>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk <
http://mailman.ucar.edu/mailman/listinfo/ncl-talk>

Guido Cioni
http://guidocioni.altervista <http://guidocioni.altervista/>.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/
attachments/20180118/18da18c7/attachment-0001.html>

------------------------------

Message: 3
Date: Thu, 18 Jan 2018 15:28:33 +0000
From: "Sri Nandini" <snandini at marum.de>
To: ncl-talk at ucar.edu
Subject: Re: [ncl-talk] ttest values not plotting
Message-ID: <0e969092ce17ab422667e2ce38b5cdfec18d21d6 at marum.de>
Content-Type: text/plain; charset="utf-8"

Hello

It appears now the stippling is being added to the map, see pdf attached,
however the the latlon seem to be shifted, am i wrong about this?
Here is my modified script:


load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"

?yrStrt = 0000
?yrLast = 0100
; ==============================================================
; Open the file: Read only the user specified period
; ==============================================================
f= addfile("T2M_C.nc", "r") ;Model Control
TIME?? = f->time
? YYYY?? = cd_calendar(TIME,-1)/100???????????????? ; entire file
? iYYYY? = ind(YYYY.ge.yrStrt .and. YYYY.le.yrLast)
T41??? = f->TREFHT(iYYYY,:,:)
;printVarSummary(T41)??????????????????????????????? ; (time, lat,lon)
T4??? = lonFlip(T41)
;printVarSummary(T4)??????????????????????????????? ; (time, lat,lon)
T4 at _FillValue = -9.96921e+36?
aveX = dim_avg_n_Wrap(T4, 0)?????????????????? ;; average over the 0th dim
;printVarSummary(aveX)??????????????????????????????? ; (lat,lon)
varX = dim_variance_n_Wrap(T4,0) ; compute variance
;printVarSummary(varX)??????????????????????????????? ; (lat,lon)
;===========================================================
===================

f2= addfile("T2M_CC.nc", "r") ;Current Caspian
TIME2? = f2->time
? YYYY2?? = cd_calendar(TIME2,-1)/100???????????????? ; entire file
? iYYYY2? = ind(YYYY2.ge.yrStrt .and. YYYY2.le.yrLast)
air22?? = f2->TREFHT(iYYYY2,:,:)
air2??? = lonFlip(air22)
;printVarSummary(air2)??????????????????????????????? ; (time, lat,lon)
air2 at _FillValue = -9.96921e+36?????????????????????????????
aveY = dim_avg_n_Wrap(air2,0)? ; average over the 0th dim
;printVarSummary(aveY)??????????????????????????????? ; (lat,lon)
varY = dim_variance_n_Wrap(air2,0) ; compute variance
;printVarSummary(varY)??????????????????????????????? ; (lat,lon)
;===========================================================
=====================
;Use "ttest" to compute the probabilities? plot: ZeroNegDashLineContour and
ShadeLtContour
;?????????? are in shea_util.ncl.
;===========================================================
======================
? sigr = 0.05??????????????????????? ; critical sig lvl for r

?xEqv = new(dimsizes(varY),typeof(varY),varY at _FillValue)
;printVarSummary(xEqv)?????????????????????????????? ; (lat,lon)
? xEqv = equiv_sample_size (T4(lat|:,lon|:,time|:), sigr,0)??
?copy_VarMeta(varY,xEqv)
;printVarSummary(xEqv)?????????????????????????????? ; (lat,lon)

?yEqv = new(dimsizes(varY),typeof(varY),varY at _FillValue)
;printVarSummary(yEqv)??????????????????????????????? ; (lat,lon)
? yEqv = equiv_sample_size (air2(lat|:,lon|:,time|:), sigr,0)
copy_VarMeta(varY,yEqv)
;printVarSummary(yEqv)??????????????????????????????? ; (lat,lon)
??????????????????
;===========================================================
=======================
?probt = new(dimsizes(varY),typeof(varY),varY at _FillValue)

?;probt = ttest(aveY,varY,xEqv,aveX,varX,yEqv,True,False) ; values are
between 0 and 1

probt = 100.*(1. -ttest(aveY,varY,xEqv,aveX,varX,yEqv,True,False)) ; all
areas whose value > 95 are significant
printVarSummary(probt)??????????????? ; (lat,lon)

copy_VarMeta(varY,probt)
printVarSummary(probt)??????????????? ; (lat,lon)

?printMinMax(probt,0)??????????????????? ;? min=0?? max=97.2842
;============================================================
;calculate the T2M difference
;============================================================
?T2diff = new(dimsizes(aveY),typeof(aveY),aveY at _FillValue)
;printVarSummary(T2diff)????????????????????????????????
copy_VarMeta(aveY,T2diff)
;printVarSummary(T2diff)????????????????????????????????
T2diff=aveY-aveX
? ; printVarSummary(T2diff)??????????????????????????????? ; (lat,lon)
;====================================================================
;Here is a section of my code that draws a color fill plot, and then
;overlays contours of statistical significance.
;====================================================================
?? wks = gsn_open_wks("pdf","T2M_tt")
?? gsn_define_colormap(wks,"BlWhRe")

? res = True
? res at cnFillOn???????????? = True??????????????? ; turn on color
? res at gsnSpreadColors????? = True??????????????? ; use full colormap

? res at cnLinesOn??????????? = False?????????????? ; turn off contour lines
? res at cnLevelSelectionMode = "ManualLevels"? ; set manual contour levels
? res at cnMinLevelValF?????? = -2.???????????? ; set min contour level
? res at cnMaxLevelValF?????? =? 2.???????????? ; set max contour level
? res at cnLevelSpacingF????? =? 0.2??????????? ; set contour spacing

? res at gsnDraw????????????? = False?????????? ; Do not draw plot
? res at gsnFrame???????????? = False?????????? ; Do not advance frome

? res at tiMainString???????? = "T2M Difference: 50yrs overlay with ttest"
? ;res at gsnCenterString????? = "5% stippled"
? ;res at gsnLeftString??????? = "K"
???? res at cnFillMode?????? = "RasterFill"?????? ; Raster Mode
?? res at cnRasterModeOn????????????? = True????????????? ; Raster mode shows
grid cells
?? plot = gsn_csm_contour_map(wks,T2diff,res)?
?? plot = ZeroNegDashLineContour (plot)??????????? ; a shea_util.ncl
function

?aa=stat_dispersion(probt,True)?? ; Make sure your data has values less
than? or equal to 0.95 that can be plotted
???
? res2 = True??????????????????????????? ; res2 probability plots
? res2 at gsnDraw???????????? = False?????? ; Do not draw plot
? res2 at gsnFrame??????????? = False?????? ; Do not advance frome
? res2 at cnLevelSelectionMode = "ExplicitLevels" ; set explicit cnlev
? res2 at cnLevels?? = (/.95/)??? ; only have 1 contour level
? res2 at cnInfoLabelOn?????? = False
? res2 at cnLinesOn?????????? = False?????? ; do not draw contour lines
? res2 at cnLineLabelsOn????? = False?????? ; do not draw contour labels
? res2 at cnFillScaleF??????? = 0.6???????? ; add extra density
???????????????????????????????????????? ; add cyclic point
? ;res at gsnAddCyclic??????????????? = True????????????? ; add cyclic point

? plot2?? = gsn_csm_contour(wks,gsn_add_cyclic_point(probt(:,:)), res2)
? opt = True??????????????????? ; set up parameters for pattern fill
? opt at gsnShadeFillType = "pattern"? ; specify pattern fill
? opt at gsnShadeLow????? = 17???????? ; stipple pattern
? plot2?? = gsn_contour_shade(plot2, 0.95, 3., opt) ; stipple all areas <
95 contour??????????????????????????????
? overlay (plot, plot2)

? draw (plot)
? frame(wks)

;=====================================================================
;T2diff contains the temperature difference, probt contains the ttest
;values.
;=====================================================================






On Jan 17, 2018 9:36:03 PM, Adam Phillips wrote:

> Hi Sri,> I think the issue is that you are letting NCL create the contour
levels (for plot2), as you are setting?> res2 at cnLevelSelectionMode =
"ExplicitLevels" but you are?> not setting res2 at cnLevels.?
> > gsn_contour_shade uses the existing contour levels to modify the plot,
it does not add them itself. I would suggest doing this:
>
>
> ? stat_dispersion(probt,True)? ?;?Make sure your data has values less
than? or equal to .05 that can be plotted
> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ;?>
https://www.ncl.ucar.edu/Document/Functions/Contributed/stat_dispersion.
shtml
>
> ? res2 = True??????????????????????????> ? ; res2 probability plots
> ? res2 at gsnDraw???????????? = False?????? ; Do not draw plot
> ? res2 at gsnFrame??????????? = False?????? ; Do not advance frome
> ? res2 at cnLevelSelectionMode = "ExplicitLevels" ; set explicit cnlev
> ? res2 at cnLevels?? = (/.05/)??? ; only have 1 contour level
> ? ;res2 at cnFillPatterns = (/-1,17/) ; don't fill <0.95, stipple >=0.95
> ? res at cnFillOn = True
>
> ? res2 at cnInfoLabelOn?????? = False
> ? res2 at cnLinesOn?????????? = False?????? ; do not draw contour lines
> ? res2 at cnLineLabelsOn????? = False?????? ; do not draw contour labels
> ? res2 at cnFillScaleF??????? = 0.6???????? ; add extra density
>
> ? plot2 = gsn_csm_contour(wks,probt,> res2)?????????????????????????>
??????????? ; add cyclic point
>
> ? opt = True??????????????????? ; set up parameters for pattern fill
> ? opt at gsnShadeFillType = "pattern"? ; specify pattern fill
> ? opt at gsnShadeLow????? = 17???????? ; stipple pattern
> ? plot2?? = gsn_contour_shade(plot2, 0.05, 3., opt) ; stipple all areas
<= 0.05 contour
> ? overlay (plot, plot2)


> > or, more simply, do not even use gsn_contour_shade:
> > stat_dispersion(probt,True)? ?;?Make sure your data has values less
than? or equal to .05 that can be plotted
> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ;?>
https://www.ncl.ucar.edu/Document/Functions/Contributed/stat_dispersion.
shtml
>
> > ? res2 = True??????????????????????????> ? ; res2 probability plots
> ? res2 at gsnDraw???????????? = False?????? ; Do not draw plot
> ? res2 at gsnFrame??????????? = False?????? ; Do not advance frome
> ? res2 at cnLevelSelectionMode = "ExplicitLevels" ; set explicit cnlev
> ? res2 at cnLevels?? = (/.05/)??? ; only have 1 contour level
> ? res2 at cnFillPatterns = (/17,-1/) ; don't fill <0.95, stipple >=0.95
> ? res at cnFillOn = True
>
> ? res2 at cnInfoLabelOn?????? = False
> ? res2 at cnLinesOn?????????? = False?????? ; do not draw contour lines
> ? res2 at cnLineLabelsOn????? = False?????? ; do not draw contour labels
> ? res2 at cnFillScaleF??????? = 0.6???????? ; add extra density
>
> ? plot2 = gsn_csm_contour(wks,probt,> res2)?????????????????????????>
??????????? ; add cyclic point
> ??> overlay (plot, plot2)
>

> > Hope that helps. If you have any further questions please respond to
the ncl-talk email list.
> > Adam
>
>
> On Wed, Jan 17, 2018 at 1:18 PM, Sri Nandini via ncl-talk > <>
ncl-talk at ucar.edu> >>  wrote:
> > Hello
> >
> > I am trying to plot ttest values overlay onto the T2m differences, but
it is not being plotted nor shaded region according to 95%confidence limits
with ttest.
> > Below is the script, i would be grateful if someone could let me know
of my omission or deletion in the resources plotting attributes.
> >
> > ;Use NCL's named dimensions to reorder in time.
> > ;Calculate the temporal means and variances using the dim_avg and
dim_variance functions.
> > ;Specify a critical significance level to test the lag-one
auto-correlation coefficient and determine the (temporal) number of
equivalent sample sizes in each grid point using equiv_sample_size.
> > ;Specify a critical significance level for the ttest and test if the
means are different at each grid point.
> > ; This file still has to be loaded manually
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> >
> > ?yrStrt = 0000
> > ?yrLast = 0100
> > ; ==============================================================
> > ; Open the file: Read only the user specified period
> > ; ==============================================================
> > f= addfile("T2M_C.nc", "r") ;Model Control
> > TIME?? = f->time
> > ? YYYY?? = cd_calendar(TIME,-1)/100???????????????? ; entire file
> > ? iYYYY? = ind(YYYY.ge.yrStrt .and. YYYY.le.yrLast)
> > T41??? = f->TREFHT(iYYYY,:,:)
> > printVarSummary(T41)??????????????????????????????? ; (time, lat,lon)
> > T4??? = lonFlip(T41)
> > printVarSummary(T4)??????????????????????????????? ; (time, lat,lon)
> > T4 at _FillValue = -9.96921e+36?
> > aveX = dim_avg_n_Wrap(T4, 0)?????????????????? ;; average over the 0th
dim
> > printVarSummary(aveX)??????????????????????????????? ; (lat,lon)
> > varX = dim_variance_n_Wrap(T4,0)?????????????? ; compute variance
> > printVarSummary(varX)??????????????????????????????? ; (lat,lon)
> > ;===========================================================
===================
> >
> > f2= addfile("T2M_CC.nc", "r") ;Current Caspian
> > TIME2? = f2->time
> > ? YYYY2?? = cd_calendar(TIME2,-1)/100???????????????? ; entire file
> > ? iYYYY2? = ind(YYYY2.ge.yrStrt .and. YYYY2.le.yrLast)
> > air22?? = f2->TREFHT(iYYYY2,:,:)
> > air2??? = lonFlip(air22)
> > printVarSummary(air2)??????????????????????????????? ; (time, lat,lon)
> > air2 at _FillValue = -9.96921e+36?????????????????????????????
> > aveY = dim_avg_n_Wrap(air2,0)? ; average over the 0th dim
> > printVarSummary(aveY)??????????????????????????????? ; (lat,lon)
> > varY = dim_variance_n_Wrap(air2,0) ; compute variance
> > printVarSummary(varY)??????????????????????????????? ; (lat,lon)
> > ;===========================================================
=====================
> > ;Use "ttest" to compute the probabilities
> > ;===========================================================
======================
> >
> > ? sigr = 0.05??????????????????????? ; critical sig lvl for r
> >
> > ?xEqv = new(dimsizes(varY),typeof(varY),varY at _FillValue)
> > printVarSummary(xEqv)?????????????????????????????? ; (lat,lon)
> > ? xEqv = equiv_sample_size (T4(lat|:,lon|:,time|:), sigr,0)??
> > ?copy_VarMeta(varY,xEqv)
> > printVarSummary(xEqv)?????????????????????????????? ; (lat,lon)
> >
> > ?yEqv = new(dimsizes(varY),typeof(varY),varY at _FillValue)
> > printVarSummary(yEqv)??????????????????????????????? ; (lat,lon)
> > ? yEqv = equiv_sample_size (air2(lat|:,lon|:,time|:), sigr,0)
> > copy_VarMeta(varY,yEqv)
> > printVarSummary(yEqv)??????????????????????????????? ; (lat,lon)
> > ??????????????????
> > ;===========================================================
=======================
> > ?probt = new(dimsizes(varY),typeof(varY),varY at _FillValue)
> >
> > ?probt = ttest(aveY,varY,xEqv,aveX,varX,yEqv,True,False) ; values are
between 0 and 1
> >
> > ;probt = 100.*(1. -ttest(aveY,varY,xEqv,aveX,varX,yEqv,True,False)) ;
all areas whose value > 95 are significant
> > printVarSummary(probt)??????????????? ; (lat,lon)
> > copy_VarMeta(varY,probt)
> > printVarSummary(probt)??????????????? ; (lat,lon)
> > print(probt)?????????????????? ;check to make sure values are between 0
and 1.
> > ;============================================================
> > ;calculate the T2M difference
> > ;============================================================
> > ?T2diff = new(dimsizes(aveY),typeof(aveY),aveY at _FillValue)
> > printVarSummary(T2diff)????????????????????????????????
> > copy_VarMeta(aveY,T2diff)
> > printVarSummary(T2diff)????????????????????????????????
> > T2diff=aveY-aveX
> > ?? printVarSummary(T2diff)??????????????????????????????? ; (lat,lon)
> > ;====================================================================
> > ;Here is a section of my code that draws a color fill plot, and then
> > ;overlays contours of statistical significance.
> > ;====================================================================
> > ?? wks = gsn_open_wks("pdf","T2M_ttest")
> > ?? gsn_define_colormap(wks,"BlWhRe")
> >
> > ? res = True
> > ? res at cnFillOn???????????? = True??????????????? ; turn on color
> > ? res at gsnSpreadColors????? = True??????????????? ; use full colormap
> >
> > ? res at cnLinesOn??????????? = False?????????????? ; turn off contour
lines
> > ? res at cnLevelSelectionMode = "ManualLevels"? ; set manual contour levels
> > ? res at cnMinLevelValF?????? = -2.???????????? ; set min contour level
> > ? res at cnMaxLevelValF?????? =? 2.???????????? ; set max contour level
> > ? res at cnLevelSpacingF????? =? 0.2??????????? ; set contour spacing
> >
> > ? res at gsnDraw????????????? = False?????????? ; Do not draw plot
> > ? res at gsnFrame???????????? = False?????????? ; Do not advance frome
> >
> > ? res at tiMainString???????? = "T2M Difference: 50yrs overlay with ttest"
> > ? res at gsnCenterString????? = "5% stippled"
> > ? res at gsnLeftString??????? = "K"
> >
> > ?? res at cnRasterModeOn????????????? = True????????????? ; Raster mode
shows grid cells
> > ?? plot = gsn_csm_contour_map_ce(wks,T2diff,res)?
> > ?? plot = ZeroNegDashLineContour (plot)
> >
> > ? res2 = True??????????????????????????? ; res2 probability plots
> > ? res2 at gsnDraw???????????? = False?????? ; Do not draw plot
> > ? res2 at gsnFrame??????????? = False?????? ; Do not advance frome
> > ? res2 at cnLevelSelectionMode = "ExplicitLevels" ; set explicit cnlev
> > ? ;res2 at cnLevels?? = (/.95/)??? ; only have 1 contour level
> > ? ;res2 at cnFillPatterns = (/-1,17/) ; don't fill <0.95, stipple >=0.95
> > ? res at cnFillOn = False
> >
> > ? res2 at cnInfoLabelOn?????? = False
> > ? res2 at cnLinesOn?????????? = False?????? ; do not draw contour lines
> > ? res2 at cnLineLabelsOn????? = False?????? ; do not draw contour labels
> > ? res2 at cnFillScaleF??????? = 0.6???????? ; add extra density
> >
> > ? plot2 = gsn_csm_contour(wks,probt,res2)????????????????????????????????????
; add cyclic point
> >
> > ? opt = True??????????????????? ; set up parameters for pattern fill
> > ? opt at gsnShadeFillType = "pattern"? ; specify pattern fill
> > ? opt at gsnShadeLow????? = 17???????? ; stipple pattern
> > ? plot2?? = gsn_contour_shade(plot2, 0.091, 3., opt) ; stipple all
areas < 0.09 contour
> > ? overlay (plot, plot2)
> >
> > ? draw (plot)
> > ? frame(wks)
> >

> > _______________________________________________
> >
ncl-talk mailing list
> > ncl-talk at ucar.edu
> >
List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >

>

> --
> Adam Phillips

> > Associate Scientist,? > Climate and Global Dynamics Laboratory, NCAR

>
> > www.cgd.ucar.edu/staff/asphilli/> ?? > 303-497-1726
>

>
>
>
>
>
>
>
>
>
>
> >
>



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/
attachments/20180118/26db6d69/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: T2M_tt.pdf
Type: application/pdf
Size: 171332 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/
attachments/20180118/26db6d69/attachment.pdf>

------------------------------

Subject: Digest Footer

_______________________________________________
ncl-talk mailing list
ncl-talk at ucar.edu
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk


------------------------------

End of ncl-talk Digest, Vol 170, Issue 32
*****************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180118/3c4034a4/attachment.html>


More information about the ncl-talk mailing list