print, "--- Start of crib sheet ---"
!quiet=1
wset,0
pos=ptrace(option=1)
del_data,'*'
erase
timespan,'6-10-2',2,/days
thm_load_gmag,site='bmls ccnv fykn',/subtract_average
options,'thg_mag_????',labels=['Bx','By','Bz']
tplot_options, 'title', 'GMAG Examples'
print
print,'Defined TPLOT Variables;'
tplot_names ,/time
print
print,ptrace(),' Deleted old data, (down)loaded GMAG Data, and Displayed tplot names'
print,ptrace(),' Note that 3 sites were loaded each with 2 days of data.'
print,ptrace(),' All files are downloaded automatically if not found.'
stop
wshow,0
tplot,"thg_mag_????"
print,ptrace(),' Plotted all TPLOT variables that match "thg_mag_????" '
stop
split_vec,'thg_mag_ccnv'
options,'*_[xyz]' ,/ynozero
tplot,'thg_mag_ccnv*'
print,ptrace(),' Split the 3 vector into its components. Plot them'
stop
wshow,0
tr = ['2006-10-2/16:00','2006-10-3/05']
timebar,tr
print,ptrace(),' Define and Display a time range'
stop
tlimit,tr
print,ptrace(),' Zoom into the defined time range'
stop
print,ptrace(),' Computing wavelet transform. Please wait.....'
wav_data,'thg_mag_ccnv_x',/kol ,trange=tr ,maxpoints=24l*3600*2
zlim,'*pow', .0001,.01,1
wshow,0,icon=0
tplot,'*ccnv_x*',trange=tr
print,ptrace(),' Computed wavelet transform of one component and plot it.'
stop
tr2 = ['2006-10-03/02:13:30', '2006-10-03/03:46:00']
timebar,tr2
wshow,0
print,ptrace(),' Identify region with Pi2 waves'
stop
tlimit,tr2
print,ptrace(),' Zoom of region with Pi2 waves'
stop
tlimit,tr
tr1 = ['2006-10-02/18:23:00', '2006-10-02/18:49:30']
timebar,tr1
print,ptrace(),' Zoomed out again and displayed region with PC1(?) waves'
stop
tlimit,tr1
print,ptrace(),' Zoom of region with Pc1 waves: [',strjoin(time_string(tr1,tformat='hhmm:ss'),' to '),']'
stop
tlimit,tr
print,ptrace(),' Select your own time range of interest: '
print,ptrace(),' (left click to select time, right click to end)
wshow,0,icon=0
ctime,my_tr,/silent
if n_elements(my_tr) eq 2 then begin
tlimit,my_tr
endif else begin
print,ptrace(),' Invalid selection, must select two times to specify a time range.'
print,ptrace(),' Proceeding to next example.'
endelse
stop
thm_gmag_stations, label, location
loadct,0
set_plot,'z'
device,set_resolution=[750,500]
chars=1.0
map_set,58.5,-108,0.,/stereo,/conti,scale=2.8e7,$
color=250,title='GMAG Stations'
borders=tvrd()
erase
map_set,58.5,-108,0.,/stereo,/conti,scale=2.8e7,$
/usa,e_continents={COUNTRIES:1},color=100
usaborders=tvrd()
erase
map_set,58.5,-108,0.,/stereo,/conti,scale=2.8e7,$
color=255,e_continents={FILL:1}
color_map=tvrd()
erase
color_map[where(usaborders eq 100)]=150
color_map[where(color_map eq 0)]=200
color_map[where(borders eq 250)]=1
tv,color_map
for i=0.1,0.7,0.1 do plots,location[1,*],location[0,*],color=0,psym=4,symsize=i
for i=0,n_elements(label)-1 do xyouts,location[1,i],location[0,i]+0.5,$
label[i],charsize=chars,charthick=2,color=0,alignment=0.5
for i=5,85,5 do plots,findgen(361),fltarr(361)+i,line=1,color=1
for i=0,360,30 do plots,fltarr(91)+i,findgen(91),line=1,color=1
image=tvrd()
device,/close
case !version.os_family of
'Windows': os='win'
'unix': os='x'
endcase
set_plot,os
window,5,xsize=750,ysize=500
tv,image
print, ptrace(),' Plot the locations of all gmag stations available through TDAS'
stop
trange = ['2012-05-10/11:00:00', '2012-05-10/15:00:00']
thm_load_gmag, trange = trange
tnames_list = tnames('thg_mag*')
latitude_range = [60, 65]
longitude_range = [0, 180]
for tnum = 0, n_elements(tnames_list)-1 do begin
get_data, tnames_list[tnum], dlimits=dl
if tag_exist(dl, 'cdf') then begin
str_element, dl.cdf.vatt, 'station_latitude', latitude, SUCCESS=slat
str_element, dl.cdf.vatt, 'station_longitude', longitude, SUCCESS=slong
if (slat ne 0 and slong ne 0) then begin
if (latitude ge latitude_range[0] and latitude le latitude_range[1]) then begin
if (longitude ge longitude_range[0] and longitude le longitude_range[1]) then begin
print, tnames_list[tnum], ' is at: ', string(latitude), ' deg latitude, ', string(longitude), ' deg longitude'
endif
endif
endif
endif
endfor
stop
thm_init,/reset
print, "--- End of crib sheet ---"
end