1 /* 2 3 -Procedure dafrda_c ( DAF, read data from address ) 4 5 -Abstract 6 7 Read the double precision data bounded by two addresses within 8 a DAF. 9 10 Deprecated: This routine has been superseded by dafgda_c and 11 dafgsr_c. This routine is supported for purposes of backward 12 compatibility only. 13 14 -Disclaimer 15 16 THIS SOFTWARE AND ANY RELATED MATERIALS WERE CREATED BY THE 17 CALIFORNIA INSTITUTE OF TECHNOLOGY (CALTECH) UNDER A U.S. 18 GOVERNMENT CONTRACT WITH THE NATIONAL AERONAUTICS AND SPACE 19 ADMINISTRATION (NASA). THE SOFTWARE IS TECHNOLOGY AND SOFTWARE 20 PUBLICLY AVAILABLE UNDER U.S. EXPORT LAWS AND IS PROVIDED "AS-IS" 21 TO THE RECIPIENT WITHOUT WARRANTY OF ANY KIND, INCLUDING ANY 22 WARRANTIES OF PERFORMANCE OR MERCHANTABILITY OR FITNESS FOR A 23 PARTICULAR USE OR PURPOSE (AS SET FORTH IN UNITED STATES UCC 24 SECTIONS 2312-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE 25 SOFTWARE AND RELATED MATERIALS, HOWEVER USED. 26 27 IN NO EVENT SHALL CALTECH, ITS JET PROPULSION LABORATORY, OR NASA 28 BE LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING, BUT NOT 29 LIMITED TO, INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, 30 INCLUDING ECONOMIC DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, 31 REGARDLESS OF WHETHER CALTECH, JPL, OR NASA BE ADVISED, HAVE 32 REASON TO KNOW, OR, IN FACT, SHALL KNOW OF THE POSSIBILITY. 33 34 RECIPIENT BEARS ALL RISK RELATING TO QUALITY AND PERFORMANCE OF 35 THE SOFTWARE AND ANY RELATED MATERIALS, AND AGREES TO INDEMNIFY 36 CALTECH AND NASA FOR ALL THIRD-PARTY CLAIMS RESULTING FROM THE 37 ACTIONS OF RECIPIENT IN THE USE OF THE SOFTWARE. 38 39 -Required_Reading 40 41 DAF 42 43 -Keywords 44 45 FILES 46 47 */ 48 #include "SpiceUsr.h" 49 #include "SpiceZfc.h" 50 51 dafrda_c(SpiceInt handle,SpiceInt begin,SpiceInt end,SpiceDouble * data)52 void dafrda_c ( SpiceInt handle, 53 SpiceInt begin, 54 SpiceInt end, 55 SpiceDouble * data ) 56 /* 57 -Brief_I/O 58 59 Variable I/O Description 60 -------- --- -------------------------------------------------- 61 handle I Handle of a DAF. 62 begin, 63 end I Initial, final address within file. 64 data O Data contained between begin and end. 65 66 -Detailed_Input 67 68 handle is the handle of a DAF. 69 70 begin, 71 end are the initial and final addresses of a contiguous 72 set of double precision numbers within a DAF. 73 Presumably, these make up all or part of a particular 74 array. 75 76 Note that CSPICE DAF addresses begin at 1 as in the 77 FORTRAN version of the SPICE Toolkit. 78 79 -Detailed_Output 80 81 data are the double precision data contained between 82 the specified addresses within the specified file. 83 84 -Parameters 85 86 None. 87 88 -Exceptions 89 90 1) If `begin' is zero or negative, the error SPICE(DAFNEGADDR) 91 is signaled. 92 93 2) If the begin > end, the error SPICE(DAFBEGGTEND) 94 is signaled. 95 96 3) If the file associated with `handle' is not of the native 97 binary file format this routine signals the error 98 SPICE(UNSUPPORTEDBFF). 99 100 4) If `handle' is invalid, routines in the call tree of dafrda_c 101 signal an appropriate error. 102 103 -Files 104 105 None. 106 107 -Particulars 108 109 The principal reason that DAFs are so easy to use is that 110 the data in each DAF are considered to be one long contiguous 111 set of double precision numbers. You can grab data from anywhere 112 within a DAF without knowing (or caring) about the physical 113 records in which they are stored. 114 115 This routine has been made obsolete by the routines dafgda_c and 116 dafgsr_c. This routine is supported for reasons of backward 117 compatibility only. New software development should utilize 118 dafgda_c or dafgsr_c. 119 120 -Examples 121 122 The following code fragment illustrates the use of dafrda_c 123 to read data from an imaginary array. The array begins with a 124 directory containing 11 epochs. Each pair of epochs bounds 125 an interval, and each interval is covered by a set of eight 126 osculating elements. 127 128 #include "SpiceUsr.h" 129 130 . 131 . 132 . 133 134 dafus_c ( sum, nd, ni, dc, ic ); 135 begin = ic[4]; 136 end = ic[5]; 137 138 dafrda_c ( handle, begin, begin+10, epochs ); 139 140 for ( i = 0; i < 10; i++ ) 141 { 142 if ( ( et > epochs[i] ) 143 && ( et < epochs[i+1] ) ) 144 { 145 offset = ic[4] + 11 + (i - 1) * 8; 146 dafrda_c ( handle, offset+1, offset+8, elements ); 147 return; 148 } 149 } 150 151 152 -Restrictions 153 154 1) This routine is deprecated. See the routines dafgda_c and 155 dafgsr_c. 156 157 -Literature_References 158 159 None. 160 161 -Author_and_Institution 162 163 N.J. Bachman (JPL) 164 W.L. Taber (JPL) 165 F.S. Turner (JPL) 166 R.E. Thurman (JPL) 167 I.M. Underwood (JPL) 168 169 -Version 170 171 -CSPICE Version 1.0.3, 19-MAY-2010 (BVS) 172 173 Index line now states that this routine is deprecated. 174 175 -CSPICE Version 1.0.2, 23-JAN-2008 (EDW) 176 177 Removed a spurious and unneeded "-Declarations" 178 tag. The tag's presence prevented the HTML API doc 179 script from parsing the function description. 180 181 -CSPICE Version 1.0.1, 27-OCT-2003 (NJB) (FST) 182 183 The header now states that this routine is deprecated. 184 The Exceptions header section has been extended. 185 Minor additional header updates were made. 186 187 -CSPICE Version 1.0.0, 14-DEC-1999 (NJB) (RET) (IMU) (WLT) 188 189 -Index_Entries 190 191 DEPRECATED read data from daf address 192 193 -& 194 */ 195 196 { /* Begin dafrda_c */ 197 198 /* 199 Participate in error tracing. 200 */ 201 chkin_c ( "dafrda_c" ); 202 203 dafrda_ ( ( integer * ) &handle, 204 ( integer * ) &begin, 205 ( integer * ) &end, 206 ( doublereal * ) data ); 207 208 chkout_c ( "dafrda_c" ); 209 210 } /* End of dafrda_c */ 211 212