Re: script

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 25 2013 - 21:01:25 MDT

On Jul 25, 2013, at 9:56 AM, Mateus Dias Nunes <nunes.mateusdias@gmail.com> wrote:

> Hello
> I have a problem in my script.
> Daily data have total SO2 column, however when I plot my graph the monthly scipt runs smoothly. Already when I try to run for a period of one year he shows a problem in the time dimension that the script does the loop. There is this problem and I can not identify.
>
> Can someone help me with this?
>
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
>
> begin
>
> fils = systemfunc("ls OMI-Aura_L3-OMSO2e_2012m03*.he5")
> f = addfiles(fils,"r")
> ListSetType (f,"join")
>
> n_files = dimsizes(fils)
>
> so2 = f[:]->ColumnAmountSO2_PBL_OMI_Total_Column_Amount_SO2
>
>
> so2!1= "lat"
> so2!2= "lon"
> lat = f[1]->YDim_OMI_Total_Column_Amount_SO2
> lat@units="degrees_north"
> lon = f[1]->XDim_OMI_Total_Column_Amount_SO2
> lon@units="degrees_east"
> so2&lat = lat
> so2&lon = lon
>
> d = fspan(0,n_files-1,100)

I think your problem is with the above line. You are setting "d" to an array with 100 elements, that have 100 equally-spaced values between 0 and n_files-1.

It looks to me like you just want the maximum value across the time dimension, so instead of this code:

d = fspan(0,n_files-1,100)
      do n=0,n_files-1
        d(n)=(max(so2(n,{-60:20},{-60:-50})))
      end do

Try this code:

 d = dim_max_n_Wrap(so2(:,{-60:20},{-60:-50}),(/1,2/))

This will give you, for every time step, the average of so2 across the range of lat/lon that you give it.
The return "d" should be a 1D array of the same length as the rightmost dimension of so2 (n_files).

This is not really an error, but instead of this code:

y1 = d(:)
data = new((/1,dimsizes(y1)/),float)
data(0,:) = y1(:)

try:

data = conform_dims((/1,dimsizes(d)/),d)

--Mary

>
> wks = gsn_open_wks ("pdf","Regiao_metroplitana_sao_paulo_marco")
>
> res = True
> res@tiMainString = "Metropolitan Region of Sao paulo"
> res@gsnLeftString = "Dobson Units"
> res@gsnRightString ="PBL"
> res@tiXAxisString = "2012"
> res@tiYAxisString = "Coloumn Total of Sulfur Dioxide"
> res@tiXAxisFontHeightF = 0.02
> res@tiYAxisFontHeightF = 0.02
> res@trXMinF = 0.
> res@trXMaxF = 31.
> res@trYMinF = 0.
> res@trYMaxF = 30.
> res@tmYROn = False ; Turn off right tickmarks
> res@tmXTOn = False ; Turn off top tickmarks
> res@tmXBOn = True ; Turn off base tickmarks
> res@tmYLOn = True ; Turn off left tickmarks
> res@tmXBLabelFontHeightF = 0.008 ;altura da latitude
> res@tmYLLabelFontHeightF = 0.008 ;altura da longitude
> res@gsnMaximize=True; make plot large
> res@xyLineColors = (/"red"/) ; line color
> res@xyExplicitLegendLabels = (/"SO2"/)
>
> plot = gsn_csm_y (wks,data,res)
>
> end
> _________________________________________
> MATEUS DIAS NUNES
> UNIVERSIDADE FEDERAL DE PELOTAS - UFPEL
> FACULDADE DE METEOROLOGIA
> TELEFONE: (53) 81125154
> _________________________________________
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jul 25 21:01:36 2013

This archive was generated by hypermail 2.1.8 : Thu Jul 25 2013 - 21:02:42 MDT