Personal tools
You are here: Home Codes ZEUS MP/2 Examples hdblastrho
Document Actions

hdblastrho

by streeter last modified 2005-08-18 03:11

Click here to get the file

Size 1.5 kB - File type text/plain

File contents

;hdfSim - a general plotting routine for visualising 
;         2-d data on a 2-d plot
; hdfsim.pro
; by Charlotte Dirk
; ********************************
pro go

infile = FindFile('hdfaa.*', Count=numfiles)

thisDevice = !D.NAME
Set_Plot, 'Z', /COPY

Device, Set_Resolution=[640,320], Z_Buffer=0
Erase

LoadCT, 13

jstart = 0
jend   = numfiles-1
jskip  = 1

for j=jstart,jend,jskip do begin

 filename = infile(j)
 FileID   = HDF_SD_START(filename, /READ)

 pi      = dataselect(FileID, 12)
 angle   = dataselect(FileID, 13)
 radius  = dataselect(FileID, 14)

 density = dataselect(FileID, 15)

 hdf_sd_end, FileID

 circle2d,radius,angle,pi,density,file='HD Blast Wave: Density'

 image = tvrd()
 TVLCT, red, green, blue, /GET
 outfile = 'HDblast' + String(j, Format='(I3.3)') + '.png'
 write_png, outfile, image, red, green, blue

endfor

end

;******************************************** 
;		circle using angles
;******************************************** 
pro circle2d,r,angle,pi,z,file=file;type=type
		; z is the value at each radius
		
z=transpose(z)
nr= size(r)
nr = nr[1];
nz = size(z)

nlevels    = 256
step       = (Max(z)-Min(z)) / nlevels
userlevels = Min(z) + Indgen(nlevels)*step

polar_contour,z,angle,r, Levels=userlevels,/isotropic,/fill,color=110,title=file

return

end
;****************************************** dataselect
Function dataselect,FileID, nn
        sds= HDF_SD_SELECT(FileID, nn)
        HDF_SD_GETDATA, SDS, newData
        return,  newData
end


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: