Hi everyone, I am trying to draw vector maps with IDL from a list of vector catalogs by using the VECTOR and LEGEND functions. However, I encountered two frustrating problems that may force me to find alternative methods in order to get publishable results. First, let me explain what I need to do: I am trying to compare on the same plot two vector catalogues containing information about astronomical polarisation vectors. These vectors are plotted on top of a contour map of the astronomical source being studied. A polarisation vector has two important characteristics: a polarisation fraction (length), and a polarisation angle (between 0-180 degrees). Furthermore, each vector has a set of coordinates (x,y). What I do is that I obtain the (u,v) properties required by VECTOR for each vector directly from their (fraction, angle) properties. This looks something like this for a given catalog: ---------------- ; The equation is -sin(angle), but it needs to be mirrored to fit the IAU convention scupol_u = scupol_p * ( 1.0D ) * sin(scupol_angle) scupol_v = scupol_p * cos(scupol_angle) ---------------- And here is how I call VECTOR and LEGEND for a given catalog: ---------------- ; Drawing the SCUPOL vector catalog on top of the active contour plot vectors_scupol = vector(scupol_u, scupol_v, scupol_x, scupol_y, THICK=2.5, LENGTH_SCALE=scale_scupol, COLOR='orange', HEAD_SIZE=0, /OVERPLOT) ; Drawing the legend on top of the active contour plot legend_pol2 = legend(TARGET=[vectors_scupol,vectors_pol2], POSITION=[0.1,0.9], HORIZONTAL_SPACING= 0.1, SAMPLE_MAGNITUDE=5, UNITS='%', /RELATIVE) ---------------- This seems to work great, and I have no problem getting the vectors to be drawn on the contour map. Furthermore, it seems like the LEGEND function works fine to give the correct reference length. However, some of the details are a bit off and I do not know if it is possible to fix them. Here is a link to an example figure (in png form): https://drive.google.com/file/d/0B6W64Fp3BvTtZXBBeVk0ZWN2WWs/view?usp=sharing Here are the main problems: ============================================== 1) Is it possible to get two different vector plots to automatically share the same length scales? Since I want to show two vector catalogs on the same plot, I want their polarisation fraction to be perfectly comparable. That means that I need a 5% vector in a given catalog to be the EXACT same length as a 5% vector in the other catalog. However, since the distribution of vector lengths in each catalog isn't the same, the automatic length scale calculated by the VECTOR function is different. From what I understand, it's supposed to be related to the mean magnitude of the vectors. Sadly, when I try to account for it and link the LENGTH_SCALE parameters of both catalogs, it doesn’t really seem to work. Here is what I attempted: ---------------- ; Measurement of the mean amplitude for each studied catalog mean_amplitude_scupol = mean(scupol_p) mean_amplitude_pol2 = mean(fraction_p) ; Ration of the mean amplitudes between two catalogs ratio_scales = mean_amplitude_pol2 / mean_amplitude_scupol ; Length scales to be used for VECTOR scale_scupol = 1.5 scale_pol2 = scale_scupol * ratio_scales ---------------- But that just doesn’t work. When I input these values into each catalog’s VECTOR function it always gives vectors that aren’t exactly on the same scale (according to the legend produced by LEGEND anyway). This is frustrating since it means that I need to manually modify each function so that the relative scales end up kinda maybe matching by eye. This is not what I feel is an acceptable approach from a scientific point of view. ============================================== 2) Is it possible to eliminate the arrowhead when using LEGEND on a vector plot? Since my vectors can only have values between 0 and 180 degrees, there is no real “direction” to them. For example, a vector with an angle of 45 degrees is exactly the same as a vector of 225 degrees. For this reason, when I call VECTOR, I set the HEAD_SIZE parameter to 0.0. However, and that is the frustrating part, it is apparently impossible to modify the HEAD_SIZE of the vector plotted by LEGEND. So it draws a vector of correct length and colour, but with a arrowhead (even if none of the vectors in the plot have them). So the legend doesn’t actually represent the content of the plot, which is a bit of a big problem if you ask me. ============================================== Any help with these issues would be appreciated. A lot of work has gone into making these polarisation figures with IDL. If there is a way to fix those two issues, then I would almost immediately have figures of publishable quality. If not, then it means I will have to find alternative ways to make them (therefore wasting valuable time). This would completely defeat the purpose of using IDL in the first place to obtain high quality figures. Thanks for the help.
|