Extracting a certain data range from a granule of CloudSat data

From: Satomi Sugaya <satomisu_at_nyahnyahspammersnyahnyah>
Date: Tue May 29 2012 - 16:53:20 MDT

Hello,

I am looking at CloudSat data (it's .hdf ), and from one orbit worth of
data, I want to extract one portion (specifically, the portion
corresponding to tropics) and plot. Following an example (provided by the
HDF group), I have been able to produce a plot with height on the vertical
and the time on the horizontal axes. I want to be able to plot against
latitude and in the tropical regions. I copied my script below. When I ran
it I got the message saying:

ncl 51> plot=gsn_csm_contour(xwks,
dataf(nbin_2B_GEOPROF|:,nray_2B_GEOPROF|:), res)
warning:ScalarFieldSetValues: irregular coordinate array sfXArray
non-monotonic: defaulting sfXArray
(0) get_lat_values: Warning: Your latitude values do not fall between -90 an
d 90 inclusive.
(0) You will not get 'nice' latitude labels.
ncl 52>

By testing on the command line, I know that everything worked until the
very last line, where I try to make the plot.

Also, I can't find a reference page for specifying res@... variables. Could
you please point me out to this also?

Thank you so much,
Satomi

PS The data used here can be downloaded from:
http://www.hdfeos.org/zoo/index_openCDPC_Examples.php#table2
it's the CloudSat swath data.

What I did:

load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin

  file_name = "2010128055614_21420_CS_2B-GEOPROF_GRANULE_P_R04_E03.hdf"

  eos_file=addfile(file_name+ ".he2","r")

  data_raw = eos_file->Radar_Reflectivity_2B_GEOPROF

  lat = eos_file->Latitude_2B_GEOPROF
  lat@long_name = "Latitude"
  lat@units = eos_file@Latitude_units_2B_GEOPROF

  lon = eos_file->Longitude_2B_GEOPROF

  lev = eos_file->Height_2B_GEOPROF

  lev@long_name = "Height"
  lev@units = eos_file@Height_units_2B_GEOPROF

  time = eos_file->Profile_time_2B_GEOPROF

  time@long_name = eos_file@Profile_time_long_name_2B_GEOPROF
  time@units = eos_file@Profile_time_units_2B_GEOPROF

  hdf4_file=addfile(file_name,"r")

  data_hdf4 = hdf4_file->Radar_Reflectivity

  dataf = tofloat(data_raw)
  dataf = dataf / data_hdf4@_FillValue
  dataf@_FillValue = data_hdf4@_FillValue

  dataf = where(dataf.gt.data_hdf4@valid_range(0) .and. dataf.lt.2000,
dataf, data_hdf4@_FillValue)

  dataf!0 = data_raw!0
  dataf!1 = data_raw!1

  dataf&nbin_2B_GEOPROF = lev(0,:)
  dataf&nray_2B_GEOPROF = lat

  xwks = gsn_open_wks("pdf", "test.ncl") ; open workstation

  gsn_define_colormap(xwks,"BlAqGrYeOrReVi200") ; define colormap

  res = True ; plot mods desired
  res@cnFillOn = True ; enable contour fill
  res@gsnMaximize = True ; make plot large
  res@gsnPaperOrientation = "portrait" ; force portrait orientation
  res@cnLinesOn = False ; turn off contour lines
  res@cnLineLabelsOn = False ; turn off contour line labels
  res@gsnSpreadColors = True ; use the entire color spectrum
  res@cnFillMode = "RasterFill" ; faster
  res@lbOrientation = "vertical" ; vertical labels
  res@cnMissingValFillPattern = 0 ; missing value pattern is set to
"SolidFill"
  res@cnMissingValFillColor = 0 ; white color for missing values
  res@lbLabelAutoStride = True ; ensure no label overlap
  res@tiMainString = file_name
  res@tiXAxisString = lat@long_name+" ("+lat@units+")"
  res@tiYAxisString = lev@long_name+" ("+lev@units+")"
  res@gsnLeftString=data_hdf4@long_name
  res@gsnRightString=data_hdf4@units

  plot=gsn_csm_contour(xwks, dataf(nbin_2B_GEOPROF|:,nray_2B_GEOPROF|:),
res)

end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May 29 16:53:30 2012

This archive was generated by hypermail 2.1.8 : Wed Jun 06 2012 - 15:17:44 MDT