CRIS/SIS IDL Utilities Library

Last Modified Monday, 24-Nov-1997 15:04:09 PST.

Here are descriptions of some of the utilities available for working with CRIS or SIS data retrieval. These routines will be available to you in IDL if you have your "+/home/idunn1/rgr/prototype/idl" as part of your IDL_PATH environment variable before starting your IDL session.


Converting seconds since 1996 into an {AceTime} structure: IDL> secondsSince1996 = 54605048L IDL> time = cvtfromsec1996(secondsSince1996) IDL> print, time { 1997 9 24 0 4 7} IDL> help, time, /struct ** Structure ACETIME, 6 tags, length=24: YEAR LONG 1997 MONTH LONG 9 DAY LONG 24 HOUR LONG 0 MIN LONG 4 SEC LONG 7 Note: Handed an array of secondsSince1996, will return an array of {AceTime}s.
Converting seconds since 1996 into an {AceTime_yd} structure: IDL> secondsSince1996 = 54605048L IDL> time = cvtfromsec1996_yd(secondsSince1996) IDL> help, time, /struct ** Structure ACETIME_YD, 2 tags, length=8: YEAR LONG 1997 DAY FLOAT 267.003 Note: Handed an array of secondsSince1996, will return an array of {AceTime_yd}s
Converting {AceTime} structs to seconds since 1996: IDL> time = {AceTime} IDL> time.year = 1997 IDL> time.month = 9 IDL> time.day = 23 IDL> time.hour = 3 IDL> time.min = 27 IDL> time.sec = 54 IDL> secondsSince1996 = cvttosec1996(time) IDL> print, secondsSince1996 54530875 Note: Handed an array of {AceTime}s, will return an array of secondsSince1996.
Converting year, month, day, hour, min, sec to seconds since 1996 IDL> year = 1997 IDL> month = 9 IDL> day = 23 IDL> hour = 3 IDL> min = 27 IDL> sec = 54 IDL> secondsSince1996 = cvttosec1996_0(year, month, day, hour, min, sec) IDL> print, secondsSince1996 54530875 Note: Handed arrays of years, months, days, hours, mins, secs, returns arrays of secondsSince1996.
Converting {AceTime_yd} structs to seconds since 1996: IDL> time = {AceTime_yd} IDL> time.year = 1997 IDL> time.day = 267 IDL> secondsSince1996 = cvttosec1996_yd(time) IDL> print, secondsSince1996 54604801 Note: Handed an array of {AceTime_yd}, will return an array of secondsSince1996.
Converting year, yearday to {AceTime_yd} structs. IDL> year = 1997 IDL> yearDay = 267 IDL> secondsSince1996 = cvttosec1996_yd_0(year, yearDay) IDL> print, secondsSince1996 54604801 Note: Handed arrays of years, ydays, returns arrays of secondsSince1996.
Determining if a file exists. IDL> path = '/home/darkalf/bruce/thisFileExists' IDL> if (file_exists(path)) then print, path + ' exists.' /home/darkalf/bruce/thisFileExists exists. IDL> path = '/home/darkalf/bruce/thisFileDoesNotExist' IDL> if (file_exists(path)) then print, path + ' exists.' IDL>
Determining the path to an archived data file: IDL> baseDir = getenv('L1_CRIS_DATA_BASE_DIRECTORY') IDL> day1996 = 633 IDL> time = get_date_from_day_1996(day1996) IDL> suffix = 'hp' IDL> path = generate_data_file_path(baseDir, time, suffix) IDL> print, path /home/idunn1/rgr/prototype/data/cris_prelim/1997.09/1997.09.24/cris_prelim.1997.09.24.hp Note: This is a low level routine which requires a knowlege of the underlying archive format. Possible use as a debugging tool.
Converting day starting 1/1/96 (= 1) to an {AceTime} struct. IDL> day1996 = 633 IDL> time = get_date_from_day_1996(day1996) IDL> help, time, /struct ** Structure ACETIME, 6 tags, length=24: YEAR LONG 1997 MONTH LONG 9 DAY LONG 24 HOUR LONG 0 MIN LONG 0 SEC LONG 0
Determining the day of 1996 from seconds since 1996: IDL> secondsSince1996 = 54604801 IDL> day1996 = get_day_1996_from_seconds_since_1996(secondsSince1996) IDL> print, day1996 633 Note: Any secondsSince1996 occuring in a particular day can be used to determine the day1996.
Determining the number of data structs in an archive file: IDL> baseDir = getenv('L1_CRIS_DATA_BASE_DIRECTORY') IDL> day1996 = 633 IDL> time = get_date_from_day_1996(day1996) IDL> suffix = 'hp' IDL> path = generate_data_file_path(baseDir, time, suffix) IDL> print, path /home/idunn1/rgr/prototype/data/cris_prelim/1997.09/1997.09.24/cris_prelim.1997.09.24.hp IDL> crissymbols_define IDL> structToUse = {L1CrisHighPriorityRate} IDL> n = get_files_struct_count(path, structToUse) IDL> print, n 5400 Note: This is a low level routine which requires a knowlege of the underlying archive format. Possible use as a debugging tool. See also generate_data_file_path.
Getting the time tags on the structs in an archive file: IDL> baseDir = getenv('L1_CRIS_DATA_BASE_DIRECTORY') IDL> day1996 = 633 IDL> time = get_date_from_day_1996(day1996) IDL> suffix = 'hp' IDL> path = generate_data_file_path(baseDir, time, suffix) IDL> print, path /home/idunn1/rgr/prototype/data/cris_prelim/1997.09/1997.09.24/cris_prelim.1997.09.24.hp IDL> crissymbols_define IDL> structToUse = {L1CrisHighPriorityRate} IDL> tags = get_files_time_tags(path, structToUse) IDL> help, tags TAGS LONG = Array[4864] IDL> print, tags(0:20) 54605032 54605048 54605064 54605080 54605096 54605112 54605128 54605144 54605160 54605176 54605192 54605208 54605224 54605240 54605256 54605272 54605288 54605304 54605320 54605336 54605352 Note: This is a low level routine which requires a knowlege of the underlying archive format. Possible use as a debugging tool. See also generate_data_file_path.
bruce