Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sdc
GRIS Gregor Infrared Spectrograph
grisred
Commits
838d67be
Commit
838d67be
authored
Apr 28, 2022
by
Carl Schaffer
Browse files
adding dynamic file search to limits_fov
parent
82b7ae96
Changes
1
Hide whitespace changes
Inline
Side-by-side
gris_v8/limits_fov.pro
View file @
838d67be
function
limits_fov
,
filein
files
=
file_search
(
filein
+
'*'
,
count
=
nfiles
)
pathin
=
'./'
if
nfiles
eq
0
then
begin
files
=
file_search
(
'level0/'
+
filein
+
'*'
,
count
=
nfiles
)
if
nfiles
eq
0
then
begin
message
,
'No TIP maps found.'
date_string
=
String
(
filein
)
date_string
=
date_string
.
Extract
(
"[0-9]{2}[a-z]{3}[0-9]{2}"
)
print
,
date_string
year
=
strmid
(
date_string
,
5
,
2
)
day
=
strmid
(
date_string
,
0
,
2
)
month
=
strmid
(
date_string
,
2
,
3
)
case
month
of
'jan'
:
month
=
'01'
'feb'
:
month
=
'02'
'mar'
:
month
=
'03'
'apr'
:
month
=
'04'
'may'
:
month
=
'05'
'jun'
:
month
=
'06'
'jul'
:
month
=
'07'
'aug'
:
month
=
'08'
'sep'
:
month
=
'09'
'oct'
:
month
=
'10'
'nov'
:
month
=
'11'
'dec'
:
month
=
'12'
endcase
candidate
=
"../"
+
'20'
+
year
+
month
+
day
+
'/'
start_path
=
'./'
search_successful
=
0
foreach
possible_folder
,
[
start_path
,
start_path
+
'level0'
,
candidate
,
candidate
+
'level0'
]
do
begin
print
,
'Checking for '
+
string
(
filein
)
+
' in '
+
string
(
possible_folder
)
files
=
file_search
(
possible_folder
+
'/'
+
filein
+
'*'
,
count
=
nfiles
)
if
nfiles
ne
0
then
begin
pathin
=
possible_folder
+
'/'
search_successful
=
1
break
endif
pathin
=
'level0/'
endforeach
if
search_successful
ne
1
then
begin
message
,
'No TIP maps found.'
exit
endif
print
,
'Using data from '
,
pathin
iraw
=
where
(
strpos
(
files
,
'c'
,
/
reverse_search
)
ne
strlen
(
files
)
-
1
and
$
strpos
(
files
,
'm'
,
/
reverse_search
)
ne
strlen
(
files
)
-
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment