IDL常用命令.docx_第1页
IDL常用命令.docx_第2页
IDL常用命令.docx_第3页
IDL常用命令.docx_第4页
IDL常用命令.docx_第5页
已阅读5页,还剩16页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Slice 2Dprobe = 1level = l2species = hplusdata_rate = srvyname = mms+probe+_hpca_+species+_phase_space_densitytimespan, 2015-10-16/13:06:00, 1, /min ;time range to loadtrange = timerange()time = trange0 ;slice time;load data into tplotmms_load_hpca, probes=probe, trange=trange, data_rate=data_rate, level=level, datatype=ion;reformat data from tplot variables into compatible 3D structuresdist = mms_get_dist(name);get single distribution; -3d/2d interpolation show smooth contours; -3d interpolates entire volume; -2d interpolates projection of a subset of data near the slice plane; -geometric interpolation is slow but shows bin boundaries;-slice = spd_slice2d(dist, time=time) ;3D interpolation;slice = spd_slice2d(dist, time=time, /two) ;2D interpolation;slice = spd_slice2d(dist, time=time, /geo) ;geometric interpolation;average all data in specified time window;slice = spd_slice2d(dist, time=time, /geo, window=20) ; window (sec) starts at TIME;slice = spd_slice2d(dist, time=time, /geo, window=20, /center_time) ; window centered on TIME;average specific number of distributions (uses N closest to specified time);slice = spd_slice2d(dist, time=time, /geo, samples=3);plotspd_slice2d_plot, slicestop;=; Field-aligned slices;=probe = 1level = l2species = hplusdata_rate = srvyname = mms+probe+_hpca_+species+_phase_space_densitybname = mms+probe+_fgm_b_gse_srvy_l2_bvec ;name of bfield vectorvname = mms+probe+_hpca_+species+_ion_bulk_velocity ;name of bulk velocity vectortimespan, 2015-10-16/13:06:00, 1, /min ;time range to loadtrange = timerange()time = trange0 ;slice timemms_load_hpca, probes=probe, trange=trange, data_rate=data_rate, level=level, datatype=iondist = mms_get_dist(name);load B field datamms_load_fgm, probe=probe, trange=trange, level=l2;load velocity momentmms_load_hpca, probes=probe, trange=trange, data_rate=data_rate, level=level, $ datatype=moments, varformat=*_+species+_ion_bulk_velocity;field/velocity aligned slice; -the plots x axis is parallel to the B field; -the plots y axis is defined by the bulk velocity direction;-slice = spd_slice2d(dist, time=time, window=window, $ rotation=bv, mag_data=bname, vel_data=vname);plotspd_slice2d_plot, slicestop;=; Export time series;=probe = 1level = l2species = hplusdata_rate = srvyname = mms+probe+_hpca_+species+_phase_space_densitytimespan, 2015-10-16/13:06:00, 1, /min ;time range to loadtrange = timerange()mms_load_hpca, probes=probe, trange=trange, data_rate=data_rate, level=level, datatype=iondist = mms_get_dist(name);produce a plot of the closest 2 distributions every 20 seconds for 1 minutetimes = trange0 + 20 * findgen(4)samples = 2for i=0, n_elements(times)-1 do begin slice = spd_slice2d(dist, time=timesi, samples=samples) filename = mms+probe+_+species+_+time_string(timesi,format=2) ;plot and write .png image to current directory spd_slice2d_plot, slice, export=filename ;,/epsendforstopend;+;Purpose:; Crib sheet demonstrating how to obtain particle distribution slices ; from MMS HPCA data using spd_slice2d.; Run as script or copy-paste to command line.; (examples containing loops cannot be copy-pasted to command line);Field-aligned coordinate descriptions:; BV: The x axis is parallel to B field; the bulk velocity defines the x-y plane; BE: The x axis is parallel to B field; the B x V(bulk) vector defines the x-y plane; xy: (default) The x axis is along the coordinates x axis and y is along the coordinates y axis; xz: The x axis is along the coordinates x axis and y is along the coordinates z axis; yz: The x axis is along the coordinates y axis and y is along the coordinates z axis; xvel: The x axis is along the coordinates x axis; the x-y plane is defined by the bulk velocity ; perp: The x axis is the bulk velocity projected onto the plane normal to the B field; y is B x V(bulk); perp_xy: The coordinates x & y axes are projected onto the plane normal to the B field; perp_xz: The coordinates x & z axes are projected onto the plane normal to the B field; perp_yz: The coordinates y & z axes are projected onto the plane normal to the B field;$LastChangedBy: egrimes $;$LastChangedDate: 2016-05-25 13:37:25 -0700 (Wed, 25 May 2016) $;$LastChangedRevision: 21200 $;$URL: svn+ssh://repos/spdsoft/trunk/projects/mms/examples/advanced/mms_slice2d_hpca_ $;-;=; Basic;=;setupprobe = 1level = l2species = hplusdata_rate = srvyname = mms+probe+_hpca_+species+_phase_space_densitytimespan, 2015-10-16/13:06:00, 1, /min ;time range to loadtrange = timerange()time = trange0 ;slice time ;load data into tplotmms_load_hpca, probes=probe, trange=trange, data_rate=data_rate, level=level, datatype=ion;reformat data from tplot variables into compatible 3D structuresdist = mms_get_dist(name);get single distribution; -3d/2d interpolation show smooth contours; -3d interpolates entire volume; -2d interpolates projection of a subset of data near the slice plane ; -geometric interpolation is slow but shows bin boundaries;-slice = spd_slice2d(dist, time=time) ;3D interpolation;slice = spd_slice2d(dist, time=time, /two) ;2D interpolation;slice = spd_slice2d(dist, time=time, /geo) ;geometric interpolation;average all data in specified time window;slice = spd_slice2d(dist, time=time, /geo, window=20) ; window (sec) starts at TIME ;slice = spd_slice2d(dist, time=time, /geo, window=20, /center_time) ; window centered on TIME;average specific number of distributions (uses N closest to specified time);slice = spd_slice2d(dist, time=time, /geo, samples=3) ;plotspd_slice2d_plot, slicestop;=; Field-aligned slices;=probe = 1level = l2species = hplusdata_rate = srvyname = mms+probe+_hpca_+species+_phase_space_densitybname = mms+probe+_fgm_b_gse_srvy_l2_bvec ;name of bfield vectorvname = mms+probe+_hpca_+species+_ion_bulk_velocity ;name of bulk velocity vectortimespan, 2015-10-16/13:06:00, 1, /min ;time range to loadtrange = timerange()time = trange0 ;slice time mms_load_hpca, probes=probe, trange=trange, data_rate=data_rate, level=level, datatype=iondist = mms_get_dist(name);load B field datamms_load_fgm, probe=probe, trange=trange, level=l2;load velocity momentmms_load_hpca, probes=probe, trange=trange, data_rate=data_rate, level=level, $ datatype=moments, varformat=*_+species+_ion_bulk_velocity;field/velocity aligned slice; -the plots x axis is parallel to the B field; -the plots y axis is defined by the bulk velocity direction;-slice = spd_slice2d(dist, time=time, window=window, $ rotation=bv, mag_data=bname, vel_data=vname);plotspd_slice2d_plot, slicestop;=; Export time series;=probe = 1level = l2species = hplusdata_rate = srvyname = mms+probe+_hpca_+species+_phase_space_densitytimespan, 2015-10-16/13:06:00, 1, /min ;time range to loadtrange = timerange()mms_load_hpca, probes=probe, trange=trange, data_rate=data_rate, level=level, datatype=iondist = mms_get_dist(name);produce a plot of the closest 2 distributions every 20 seconds for 1 minutetimes = trange0 + 20 * findgen(4)samples = 2for i=0, n_elements(times)-1 do begin slice = spd_slice2d(dist, time=timesi, samples=samples) filename = mms+probe+_+species+_+time_string(timesi,format=2) ;plot and write .png image to current directory spd_slice2d_plot, slice, export=filename ;,/epsendforstopend;Purpose: A basic overview of how to obtain and plot two-dimentional slices of ; SST and/or ESA particle distributions. ; ; Run thm_ui_slice2d on the IDL console to use for the GUI version.;Methods:; Geomtric:; Each point on the plot is given the value of the bin it instersects.; This allows bin boundaries to be drawn at high resolutions.; ; 2D Interpolation:; Datapoints within the specified theta or z-axis range are projected onto ; the slice plane and linearly interpolated onto a regular 2D grid. ; ; 3D Interpolation:; The entire 3-dimensional distribution is linearly interpolated onto a ; regular 3D grid and a slice is extracted from the volume.; ;Coordinates:; The coordinate system in which the slice will be oriented.; Options are DSL (default), GSM, GSE and the following magnetic; field aligned coordinates (field parallel to z axis).; ; xgse: The x axis is the projection of the GSE x-axis; ygsm: The y axis is the projection of the GSM y-axis; zdsl: The y axis is the projection of the DSL z-axis; RGeo: The x is the projection of radial spacecraft position vector (GEI); mRGeo: The x axis is the projection of the negative radial spacecraft position vector (GEI); phiGeo: The y axis is the projection of the azimuthal spacecraft position vector (GEI), positive eastward; mphiGeo: The y axis is the projection of the azimuthal spacecraft position vector (GEI), positive westward; phiSM: The y axis is the projection of the azimuthal spacecraft position vector in Solar Magnetic coords; mphiSM: The y axis is the projection of the negative azimuthal spacecraft position vector in Solar Magnetic coords; ;Slice Orientation; The slice plane is oriented by using the following options to specify; its x and y axes with respect to the coordinate system.; (BV, BE, and perp will be invariant between coordinate systems).; ; BV: The x axis is parallel to B field; the bulk velocity defines the x-y plane; BE: The x axis is parallel to B field; the B x V(bulk) vector defines the x-y plane; xy: (default) The x axis is along the coordinates x axis and y is along the coordinates y axis; xz: The x axis is along the coordinates x axis and y is along the coordinates z axis; yz: The x axis is along the coordinates y axis and y is along the coordinates z axis; xvel: The x axis is along the coordinates x axis; the x-y plane is defined by the bulk velocity ; perp: The x axis is the bulk velocity projected onto the plane normal to the B field; y is B x V(bulk); perp_xy: The coordinates x & y axes are projected onto the plane normal to the B field; perp_xz: The coordinates x & z axes are projected onto the plane normal to the B field; perp_yz: The coordinates y & z axes are projected onto the plane normal to the B field; ;OTHER: ; For more detailed/advanced usage see:; thm_crib_part_slice2d_; thm_crib_part_slice2d_;NOTES: ;$LastChangedBy: aaflores $;$LastChangedDate: 2016-08-25 13:12:48 -0700 (Thu, 25 Aug 2016) $;$LastChangedRevision: 21727 $;$URL: svn+ssh://repos/spdsoft/trunk/projects/themis/examples/basic/thm_crib_part_ $;-compile_opt idl2thm_initnl = ssl_newline()print, nl,Starting basic 2D particle distribution slice crib.,nl;-;Generate basic slice from ESA data;-;set time rangetrange = 2008-02-26/ + 04:54,04:55;esa ion burst datadist_arr = thm_part_dist_array(probe=b,type=peib, trange=trange);generate a 30 second slice starting at the beginning of the time rangethm_part_slice2d, dist_arr, slice_time=trange0, timewin=30, part_slice=slice;plot the outputthm_part_slice2d_plot, sliceprint, nl,This example shows a basic slice of ESA burst data (ions) along the DSL xy plane.print, The default method will produce a plot with visible bin boundaries.print, The red line is the projection of the bulk velocity vector.,nlstop;-;Generate basic slice using 2D interpolation;-;set time rangetrange = 2008-02-26/ + 04:54,04:55;esa ion burst datadist_arr = thm_part_dist_array(probe=b,type=peib, trange=trange);generate an identical cut using 2D interpolationthm_part_slice2d, dist_arr, slice_time=trange0, timewin=30, part_slice=slice, $ /two_d_interpthm_part_slice2d_plot, sliceprint, nl,This is an identical cut produced using the 2D interplation method.print, This method linearly interpolates all data within a specified range print, onto the slice plane (default is +-20 degrees),nl stop;-;Generate basic slice using 3D interpolation;-;set time rangetrange = 2008-02-26/ + 04:54,04:55;esa ion burst datadist_arr = thm_part_dist_array(probe=b,type=peib, trange=trange);generate an identical cut using 3D interpolationthm_part_slice2d, dist_arr, slice_time=trange0, timewin=30, part_slice=slice, $ /three_d_interpthm_part_slice2d_plot, sliceprint, nl,Another identical cut using the 3D interpolation method,print, Here the entire distribution is linearly interpolated in print, three dimensions and a slice is extracted.,nlstop;-;Basic ESA background removal;-;set time rangetrange = 2008-02-26/ + 04:54,04:55;esa ion burst datadist_arr = thm_part_dist_array(probe=b,type=peib, trange=trange);Background removal is enabled by default with the options listed below.;See thm_crib_esa_bgnd_remove for more info.; bgnd_remove/esa_bgnd_remove: Flag to switch background removal on/off (set to 0 to disable); bgnd_type: Type of removal (anode, omni, angle); bgnd_npoints: Number of points used to calculate background; bgnd_scale: Factor to multiply calculated background bythm_part_slice2d, dist_arr, slice_time=trange0, timewin=30, part_slice=slice, $ /bgnd_remove, bgnd_type=anode, bgnd_npoints=3, bgnd_scale=1.0, $ /three_d_interpthm_part_slice2d_plot, sliceprint, nl,Another identical cut using the 3D interpolation method,print, Here the entire distribution is linearly interpolated in print, three dimensions and a slice is extracted.,nlstop;-;Smoothing;-;set time rangetrange = 2008-02-26/ + 04:54,04:55;esa ion burst datadist_arr = thm_part_dist_array(probe=b,type=peib, trange=trange);Increase the smoothing width to create smoother plots.;The value supplied to the SMOOTH keyword is the width (in points);of the gaussian blur that is applied to the slice data.;2D interpolate and 3D interpolation use smooth=3 by default.thm_part_slice2d, dist_arr, slice_time=trange0, timewin=30, part_slice=slice, $ smooth=15, /three_d_interp;Add contour lines to the plotthm_part_slice2d_plot, sliceprint,nl,Set the SMOOTH keyword to specify the width of the smoothing window.print, (in # of points). 2D interpolate and 3D interpolation use smooth=3 print, by default.,nlstop;-;Units / Show N count level;-;set time rangetrange = 2008-02-26/ + 04:54,04:55;esa ion burst datadist_arr = thm_part_dist_array(probe=b,type=peib, trange=trange);This example uses the UNITS keyword to create a slice in counts.; valid units are: df, flux, eflux, counts, and ratethm_part_slice2d, dist_arr, slice_time=trange0, timewin=30, part_slice=slice_

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论