IDL programming and data smoothing

In summary, the individual is experiencing issues with vertical lines appearing when using higher order smoothers in their IDL code. They suspect it may be due to defining too many points in the array, but are unsure. They are seeking assistance in troubleshooting the issue with their code and are open to any suggestions.
  • #1
big man
254
1
I know this is a long shot, but I thought that I'd try my luck. I've just started programming in IDL and I'm wanting to smooth data. It's fine when I do low order binomial or running average smoothers, but whenever I get to higher order smoothers I get these lines going vertically down from the data.|
| ________________
||.....|
||.....|
||.....|
||.....|
|__________________

Above is a crude example of this. The figure should just be a straight horizontal line, but instead it has vertical lines extending from the endpoints. The dots are just there so that the figure looks right when I post it.

I'd expect this to happen if I was defining too many points in the array and obviously it wouldn't have any data to smooth, but I swear I didn't give too many points for the smoothing.
Below is an example of the one smoother that doesn't have a problem and the higher order smoother where I do have the vertical line problem.
The array is 216 columns obviously.

LOW ORDER SMOOTHING WITHOUT VERTICAL LINES
rsmooth=fltarr(216)
rsmooth(0)=Co2(0)
rsmooth(215)=Co2(215)
for l=1,214 do rsmooth(l)=(Co2(l-1)+Co2(l)+Co2(l+1))/3.0
resultr=moment(rsmooth)
window, 0
plot, Date, rsmooth, background=255, color=0

HIGHER ORDER SMOOTHING WITH VERTICAL LINES
rsmooth5=fltarr(216)
rsmooth5(0)=Co2(0)
rsmooth5(215)=Co2(215)
for l=2,213 do rsmooth5(l)=(Co2(l-2)+Co2(l-1)+Co2(l)+Co2(l+1)+Co2(l+2))/5.0
resultr5=moment(rsmooth5)
window, 1
plot, Date, rsmooth5, background=255, color=0

N.B. I'm new to this so there is a good chance I'm missing something really obvious. If someone has an idea and can spare the time to check those few lines of the IDL code then I'd really appreciate it.
Thanks :)
 
Last edited:
Physics news on Phys.org
  • #2


Hello! Thank you for reaching out with your question about smoothing data in IDL. I can understand your frustration with the vertical lines appearing in your higher order smoothers.

From looking at your code, it seems like the issue may be with the way you are defining the array for your higher order smoothing. In the first line, you are creating an array with 216 columns, but in the for loop, you are only looping through 213 columns. This may be causing the issue with the vertical lines. I would recommend checking your array and making sure that it is properly defined with the correct number of columns for your data.

Additionally, it may be helpful to check the values in your array to make sure they are all valid data points. Sometimes, if there are missing or incorrect values in the data, it can cause unexpected results when smoothing.

I hope this helps and please let me know if you have any further questions. Good luck with your programming in IDL!
 
  • #3


Hello there,

Thank you for reaching out about your IDL programming and data smoothing issue. I understand the importance of accurately smoothing data to get a clear understanding of trends and patterns.

Based on the information you provided, it seems like the issue may be related to how you are defining the points in your array. It is possible that you may have too many points for the higher order smoothing, causing the vertical lines to appear.

I would recommend checking your array and making sure that you are not defining too many points. You can also try adjusting the number of points in your higher order smoothing to see if that resolves the issue.

Additionally, it may be helpful to consult with other IDL programmers or look for online resources that can provide guidance on data smoothing in IDL. Sometimes, a fresh perspective or a different approach can help resolve programming issues.

I hope this helps and good luck with your IDL programming!
 

1. What is IDL programming?

IDL (Interactive Data Language) programming is a high-level language used for data analysis and visualization. It is designed specifically for scientific and technical applications, and is commonly used in fields such as astronomy, atmospheric science, and geosciences.

2. How does IDL perform data smoothing?

IDL has built-in functions and routines for data smoothing, such as the SMOOTH function and the SGOLAY function. These functions use various algorithms, such as moving averages and Savitzky-Golay filters, to smooth out noisy data and make it easier to interpret.

3. What is the difference between IDL's data smoothing methods?

The SMOOTH function uses a moving average method, where a window of data points is averaged together to create a smoothed value. The SGOLAY function, on the other hand, uses a least-squares polynomial fit to smooth the data. The choice of method depends on the type of data and the desired level of smoothing.

4. Can IDL perform data smoothing on multidimensional data?

Yes, IDL has functions that can perform data smoothing on multidimensional arrays, such as the MEDIAN_FILTER and GAUSSIAN_FILTER functions. These functions allow for smoothing along multiple axes, making them useful for analyzing complex datasets.

5. Are there any limitations to IDL's data smoothing capabilities?

Like any programming language, IDL has its limitations. Some common limitations include difficulties in handling large datasets, limited support for parallel processing, and potential for errors when dealing with missing or irregular data. It is important to carefully consider these limitations when using IDL for data smoothing and analysis.

Similar threads

  • DIY Projects
Replies
33
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • Special and General Relativity
Replies
11
Views
180
  • Programming and Computer Science
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
2K
Replies
16
Views
2K
  • Introductory Physics Homework Help
Replies
10
Views
2K
  • Programming and Computer Science
Replies
20
Views
1K
  • Introductory Physics Homework Help
Replies
1
Views
9K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Back
Top