Example: We want all the SIS high priority rates from 9-23-97 through 9-25-97. We see from out handy ACE calendar that these days correspond to day1996 = 632, 633, and 634. -------------------------------------------------------------------------------- THE code: #include #include #include "hdfi.h" #include "sis.h" #include "level1.h" int main(int argc, char *argv[]) { struct L1SisHighPriorityRate *pHpr; /* testing getGroupHiRates_s */ int firstDayToGet = 632, lastDayToGet = 634; uint32 secondsSince1996Start, secondsSince1996Stop; struct tm *pTimeStruct; int autoFreeMemoryFlag = 1; pTimeStruct = getDateFromDay1996(firstDayToGet); secondsSince1996Start = getSecondsSince1996FromDate(pTimeStruct); /* stop time will be the 0th second of the day after lastDayToGet */ /* the struct valid at that time *will not* be returned. */ pTimeStruct = getDateFromDay1996(lastDayToGet + 1); secondsSince1996Stop = getSecondsSince1996FromDate(pTimeStruct); printf("\ntesting getGroupHiRates_s\n"); printf("secondsSince1996Start = %ld\n", secondsSince1996Start); printf("secondsSince1996Stop = %ld\n", secondsSince1996Stop); pHpr = getGroupHiRates_s(secondsSince1996Start, secondsSince1996Stop, autoFreeMemoryFlag); while (pHpr->Second1996 != 0) { printf("pHpr->Second1996 = %ld\n", pHpr->Second1996); pHpr++; } return 0; } ------------------------------------------------------------------------ THE run: % setenv L1_SIS_DATA_BASE_DIRECTORY /home/idunn1/ACEdata/level1/data/sis4 % test testing getGroupHiRates_s secondsSince1996Start = 54518401 secondsSince1996Stop = 54777601 pHpr->Second1996 = 54518397 pHpr->Second1996 = 54518429 pHpr->Second1996 = 54518461 pHpr->Second1996 = 54518493 pHpr->Second1996 = 54518525 pHpr->Second1996 = 54518557 pHpr->Second1996 = 54518589 pHpr->Second1996 = 54518621 pHpr->Second1996 = 54518653 pHpr->Second1996 = 54518685 pHpr->Second1996 = 54518717 pHpr->Second1996 = 54518749 pHpr->Second1996 = 54518781 pHpr->Second1996 = 54518813 pHpr->Second1996 = 54518845 pHpr->Second1996 = 54518877 . . . pHpr->Second1996 = 54777117 pHpr->Second1996 = 54777149 pHpr->Second1996 = 54777181 pHpr->Second1996 = 54777213 pHpr->Second1996 = 54777245 pHpr->Second1996 = 54777277 pHpr->Second1996 = 54777309 pHpr->Second1996 = 54777341 pHpr->Second1996 = 54777373 pHpr->Second1996 = 54777405 pHpr->Second1996 = 54777437 pHpr->Second1996 = 54777469 pHpr->Second1996 = 54777501 pHpr->Second1996 = 54777533 pHpr->Second1996 = 54777565 [Note that the first struct returned has a time stamp slightly earlier than the requested start time. This is because the data retrieval routines always return the struct which is valid at the start time. The time interval for which Sis high priority rate data structs are valid is 32 seconds. The zeroth struct returned is valid from 54518397 seconds to 54518428 seconds, and the start time of the request was 54518401, which is inside this period of validity.

Likewise, the struct which is valid at the request stop time *is not* returned (Notice that the last struct returned has a validity interval from 54777565 seconds to 54777598 seconds, and that the stop time is just past this at 54777601 seconds). This is a general rule of all the data retrieval routines to prevent to retrieval of overlapping data. If you are incrementing start and stop times of data requests over some larger time period and you wish to make sure you get all the data, but with no overlap between calls, always set a subsequent start time equal to the previous call's stop time. For example: call start stop ----- ----- ----- 0 45678 45778 1 45778 45878 2 45878 45978 etc.] ------------------------------------------------------------------------ THE Makefile: # where is your base directory? (ACE_WARE must be defined in your environment.) BASE_DIR = ${ACE_WARE} INCLUDE_DIR = ${BASE_DIR}/include LIBRARY_DIR = ${BASE_DIR}/lib # which compiler are you using? # setenv CC gcc (CC can be defined in your environment.) # CC = gcc (or not.) # code optimization and warnings flags FLAGS = -O2 -Wall # include files needed here are found in these directories: # # include/hdf: declarations for HDF types used throughout ACEware # include/structures: declarations for CRIS/SIS data structs # include/level1: level1 routine declarations INCLUDE_HEADER_DIRS = -I${INCLUDE_DIR}/hdf \ -I${INCLUDE_DIR}/structures \ -I${INCLUDE_DIR}/level1 INCLUDE_LIB_DIRS = -L${LIBRARY_DIR} INCLUDE_LIBRARIES = -llevel1 all: ${CC} ${FLAGS} test.c -o test \ ${INCLUDE_HEADER_DIRS} \ ${INCLUDE_LIB_DIRS} \ ${INCLUDE_LIBRARIES} clean: rm -rf *.o test ------------------------------------------------------------------------ THE make: % make gcc -O2 -Wall test.c -o test \ -I/home/idunn1/ACEware/include/hdf -I/home/idunn1/ACEware/include/structures -I/home/idunn1/ACEware/include/level1 \ -L/home/idunn1/ACEware/lib \ -llevel1 %