Using the Where Function in IDL to Search for a Specific Date in an Array

  • Thread starter Thread starter conquertheworld5
  • Start date Start date
  • Tags Tags
    Function
Click For Summary
SUMMARY

The discussion focuses on using the WHERE function in IDL (Interactive Data Language) to search for a specific date in an array. The user attempted to retrieve elements corresponding to the date "11-07-2007" using the syntax a=where(b.a eq "11-07-2007"), but received -1, indicating no matches were found. The correct approach involves ensuring the date format matches and verifying the array's contents. Proper usage of the WHERE function is essential for effective data retrieval in IDL.

PREREQUISITES
  • Understanding of IDL (Interactive Data Language) syntax
  • Familiarity with array structures in programming
  • Knowledge of string comparison techniques
  • Basic debugging skills to troubleshoot code issues
NEXT STEPS
  • Review IDL documentation on the WHERE function
  • Learn about array data types and structures in IDL
  • Explore string manipulation functions in IDL
  • Practice debugging techniques for array searches in IDL
USEFUL FOR

This discussion is beneficial for beginner programmers, data analysts, and anyone working with IDL who needs to perform array searches based on specific string criteria.

conquertheworld5
Messages
22
Reaction score
0
Hey,beginner programmer with a simple question...
is there any way I can use the where function to search for a string in elements of an array?
I have a structure with two arrays, the first for the date (a string in the form of dd-mm-yyyy i.e. 11-07-2007) and the second has data. I want all the elements that correspond to a certain day.
what I tried to do:

a=where(b.a eq "11-07-2007")
then I expected to get all the spots in the array that had that date... all i got was -1 :-(
 
Technology news on Phys.org
Can you mention which language you are using?

Mr V
 
I think he's using IDL, based on the thread title.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
Replies
20
Views
2K
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
11K
Replies
2
Views
3K
  • · Replies 7 ·
Replies
7
Views
6K