/* * Copyright (C) 1998 by Southwest Research Institute (SwRI) * * All rights reserved under U.S. Copyright Law and International Conventions. * * The development of this Software was supported by contracts NAG5-3148, * NAG5-6855, NAS8-36840, NAG5-2323, and NAG5-7043 issued on behalf of * the United States Government by its National Aeronautics and Space * Administration. Southwest Research Institute grants to the Government, * and others acting on its behalf, a paid-up nonexclusive, irrevocable, * worldwide license to reproduce, prepare derivative works, and perform * publicly and display publicly, by or on behalf of the Government. * Other than those rights granted to the United States Government, no part * of this Software may be reproduced in any form or by any means, electronic * or mechanical, including photocopying, without permission in writing from * Southwest Research Institute. All inquiries should be addressed to: * * Director of Contracts * Southwest Research Institute * P. O. Drawer 28510 * San Antonio, Texas 78228-0510 * * * Use of this Software is governed by the terms of the end user license * agreement, if any, which accompanies or is included with the Software * (the "License Agreement"). An end user will be unable to install any * Software that is accompanied by or includes a License Agreement, unless * the end user first agrees to the terms of the License Agreement. Except * as set forth in the applicable License Agreement, any further copying, * reproduction or distribution of this Software is expressly prohibited. * Installation assistance, product support and maintenance, if any, of the * Software is available from SwRI and/or the Third Party Providers, as the * case may be. * * Disclaimer of Warranty * * SOFTWARE IS WARRANTED, IF AT ALL, IN ACCORDANCE WITH THESE TERMS OF THE * LICENSE AGREEMENT. UNLESS OTHERWISE EXPLICITLY STATED, THIS SOFTWARE IS * PROVIDED "AS IS", IS EXPERIMENTAL, AND IS FOR NON-COMMERCIAL USE ONLY, * AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT * SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. * * Limitation of Liability * * SwRI SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED AS A RESULT OF USING, * MODIFYING, CONTRIBUTING, COPYING, DISTRIBUTING, OR DOWNLOADING THIS * SOFTWARE. IN NO EVENT SHALL SwRI BE LIABLE FOR ANY INDIRECT, PUNITIVE, * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGE (INCLUDING LOSS OF BUSINESS, * REVENUE, PROFITS, USE, DATA OR OTHER ECONOMIC ADVANTAGE) HOWEVER IT ARISES, * WHETHER FOR BREACH OF IN TORT, EVEN IF SwRI HAS BEEN PREVIOUSLY ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. YOU HAVE SOLE RESPONSIBILITY FOR ADEQUATE * PROTECTION AND BACKUP OF DATA AND/OR EQUIPMENT USED IN CONNECTION WITH THE * SOFTWARE AND WILL NOT MAKE A CLAIM AGAINST SwRI FOR LOST DATA, RE-RUN TIME, * INACCURATE OUTPUT, WORK DELAYS OR LOST PROFITS RESULTING FROM THE USE OF * THIS SOFTWARE. YOU AGREE TO HOLD SwRI HARMLESS FROM, AND YOU COVENANT NOT * TO SUE SwRI FOR, ANY CLAIMS BASED ON USING THE SOFTWARE. * * Local Laws: Export Control * * You acknowledge and agree this Software is subject to the U.S. Export * Administration Laws and Regulations. Diversion of such Software contrary * to U.S. law is prohibited. You agree that none of the Software, nor any * direct product therefrom, is being or will be acquired for, shipped, * transferred, or reexported, directly or indirectly, to proscribed or * embargoed countries or their nationals, nor be used for nuclear activities, * chemical biological weapons, or missile projects unless authorized by U.S. * Government. Proscribed countries are set forth in the U.S. Export * Administration Regulations. Countries subject to U.S embargo are: Cuba, * Iran, Iraq, Libya, North Korea, Syria, and the Sudan. This list is subject * to change without further notice from SwRI, and you must comply with the * list as it exists in fact. You certify that you are not on the U.S. * Department of Commerce's Denied Persons List or affiliated lists or on the * U.S. Department of Treasury's Specially Designated Nationals List. You agree * to comply strictly with all U.S. export laws and assume sole responsibilities * for obtaining licenses to export or reexport as may be required. * * General * * These Terms represent the entire understanding relating to the use of the * Software and prevail over any prior or contemporaneous, conflicting or * additional, communications. SwRI can revise these Terms at any time * without notice by updating this posting. * * Trademarks * * The SwRI logo is a trademark of SwRI in the United States and other countries. * */ #ifndef __UTIL_STR_H__ #define __UTIL_STR_H__ #include "SDDAS_types.h" #include "time_span_str.h" #include "swp_times.h" #include "trec_str.h" #include "pitch_str.h" #include "spin_str.h" #include "potential_str.h" #include "background_str.h" #include "idfs_transform.h" #include /* for MAXPATHLEN */ #define IDFS_MAX_DIMEN 10 #define MODE_FLAG 2 #define PITCH_FLAG 3 #define SPIN_FLAG 4 #define POTENTIAL_FLAG 5 #define EULER_FLAG 6 #define CELESTIAL_FLAG 7 #define BACKGROUND_FLAG 8 struct idf_data /* the data structure filled by READ_DREC(). */ { SDDAS_ULONG data_key; /* key which uniquely identifies the project, */ /* mission, experiment, instrument and virtual */ /* instrument associated with the data returned */ SDDAS_SHORT header_format;/* header format-identify multi-dimensional data */ /* data type helps with word boundaries */ SDDAS_SHORT sensor; /* sensor associated with the data returned */ SDDAS_SHORT byear; /* year associated with the first data value */ /* in the data sweep (start of accumulation) */ SDDAS_SHORT bday; /* day of year associated with first data value */ /* in the data sweep (start of accumulation) */ SDDAS_LONG bmilli; /* time (msec) associated with first data value */ /* in the data sweep (start of accumulation) */ SDDAS_LONG bnano; /* time (nanoseconds) associated with first data */ /* value in the data sweep(start of accumulation)*/ SDDAS_LONG bsec; /* start time of the first data value in the */ /* sweep in seconds (bmilli + bnano) */ SDDAS_LONG bnsec; /* start time of first data value in the sweep */ /* in nanosecond (residual from bsec computation)*/ SDDAS_SHORT eyear; /* year associated with the last data value */ /* in the data sweep (end of accumulation) */ SDDAS_SHORT eday; /* day of year associated with last data value */ /* in the data sweep (end of accumulation) */ SDDAS_LONG emilli; /* time (msec) associated with last data value */ /* in the data sweep (end of accumulation) */ SDDAS_LONG enano; /* time (nanoseconds) associated with last data */ /* value in the data sweep (end of accumulation) */ SDDAS_LONG esec; /* end time of the last data value in the */ /* sweep in seconds (emilli + enano) */ SDDAS_LONG ensec; /* end time of the last data value in the sweep */ /* in nanosecond (residual from esec computation)*/ SDDAS_SHORT mode_byear; /* year associated with mode values (start of */ /* accumulation) */ SDDAS_SHORT mode_bday; /* day of year associated with mode values */ /* (start of accumulation) */ SDDAS_LONG mode_bmilli; /* time (msec) associated with mode values */ /* (start of accumulation) */ SDDAS_LONG mode_bnano; /* time (nanoseconds) associated with mode values*/ /* (start of accumulation) */ SDDAS_SHORT mode_eyear; /* year associated with mode values (end of */ /* accumulation) */ SDDAS_SHORT mode_eday; /* day of year associated with mode values */ /* (end of accumulation) */ SDDAS_LONG mode_emilli; /* time (msec) associated with mode values */ /* (end of accumulation) */ SDDAS_LONG mode_enano; /* time (nanoseconds) associated with mode values*/ /* (end of accumulation) */ SDDAS_LONG data_accum_ms; /* time for a single data acquisition (in msec) */ SDDAS_LONG data_accum_ns; /* time for a single data acquisition (in nsec) */ SDDAS_LONG data_lat_ms; /* amount of dead time between successive data */ /* acquisitions (in milliseconds) */ SDDAS_LONG data_lat_ns; /* amount of dead time between successive data */ /* acquisitions (in nanoseconds) */ SDDAS_LONG swp_reset_ms; /* amount of dead time at the end of an inst. */ /* sweep (in milliseconds) */ SDDAS_LONG swp_reset_ns; /* amount of dead time at the end of an inst. */ /* sweep (in nanoseconds) */ SDDAS_LONG sen_reset_ms; /* amount of dead time between successive sensor */ /* sets (in milliseconds) */ SDDAS_LONG sen_reset_ns; /* amount of dead time between successive sensor */ /* sets (in nanoseconds) */ SDDAS_FLOAT *start_az; /* ptr to 1st element in starting azimuthal array*/ SDDAS_FLOAT *stop_az; /* ptr to 1st element in ending azimuthal array */ SDDAS_FLOAT start_theta; /* starting theta angle for sensor in question */ SDDAS_FLOAT stop_theta; /* ending theta angle for sensor in question */ SDDAS_FLOAT *pitch_angles;/* ptr to 1st element in pitch angles array */ SDDAS_FLOAT *potential; /* ptr to 1st ele. in spacecraft potential array */ SDDAS_FLOAT *background; /* ptr to 1st ele. in background array */ SDDAS_SHORT num_swp_steps;/* no. of elements returned in sample sequence */ /* array */ SDDAS_USHORT num_sample; /* no. of elements returned in sensor data array */ SDDAS_ULONG cal_len; /* no. of elements returned in calibration array */ SDDAS_USHORT num_angle; /* no. of elements returned in angle array */ SDDAS_USHORT num_pitch; /* no. of elements returned in pitch angle array */ SDDAS_USHORT num_potential;/* no. of elements returned in potential array */ SDDAS_USHORT num_background;/* no. of elements returned in background array*/ SDDAS_LONG sun_sen; /* time of the last 0 degree crossing */ SDDAS_LONG spin_rate; /* the spin rate of the virtual instrument */ SDDAS_LONG *cal_data; /* ptr to first element in the calibration array */ SDDAS_LONG *sen_data; /* ptr to first element in the sensor array */ SDDAS_LONG *swp_data; /* ptr to first element in sample sequence array */ SDDAS_LONG *mode; /* ptr to first element in the mode flags array */ SDDAS_LONG d_qual; /* flag that indicates the quality of the data */ SDDAS_UINT cal_size; /* no. of bytes allocated for calibration array */ SDDAS_UINT data_size; /* no. of bytes allocated for sensor data array */ SDDAS_UINT swp_size; /* no. of bytes allocated for sample sequence */ /* array */ SDDAS_UINT mode_size; /* no. of bytes allocated for mode flags array */ SDDAS_UINT angle_size; /* no. of bytes allocated for angle array */ SDDAS_UINT pitch_size; /* no. of bytes allocated for angle array */ SDDAS_UINT potential_size;/* no. of bytes allocated for potential array */ SDDAS_UINT background_size; /* no. of bytes allocated for background array */ SDDAS_UCHAR mode_len; /* no. of elements returned in mode flags array */ SDDAS_CHAR hdr_change; /* flag that indicates a header change occurred */ SDDAS_CHAR exten[3]; /* filename extension of the data files */ SDDAS_CHAR filled_data; /* flag indicating data array was filled */ SDDAS_USHORT version; /* version number for the requested data */ SDDAS_ULONG *cset_num; /* no. of elements in each cal. set */ struct direction_cos *dir_cosines; /* ptr to dir. cosine information */ struct transformation_info *idfs_transformation; /* ptr to transformation */ /* info. */ void *base_cal; /* base address of memory allocated for calibra- */ /* tion data */ void *base_data; /* base address of memory allocated for sensor */ /* data */ void *base_swp; /* base address of memory allocated for sample */ /* sequence data */ void *base_angle; /* base address of memory allocated for angle */ /* values */ void *base_mode; /* base address of memory allocated for mode */ /* values */ void *base_pitch; /* base address of memory allocated for pitch */ /* angle values */ void *base_cset; /* base address of memory allocated for cal. set */ /* lengths (needed by convert_to_units) */ void *base_dir_cosines; /* base address of memory for dir. cosine struct */ void *base_potential; /* base address of memory allocated for space- */ /* craft potential values */ void *base_background; /* base address of memory allocated for back- */ /* ground values */ void *base_transform; /* base address of memory for transformation_info*/ /* struct */ }; struct alloc_experiment { void *base_hdr; /* base address of memory allocated for the info */ /* read from a header record */ void *base_data; /* base address of memory allocated for the info */ /* read from a data record */ void *base_cal; /* base address of memory allocated to hold the */ /* CAL_USE values and to hold the no. of elements*/ /* in each calibration set */ void *base_info_ptr; /* base address of memory allocated to hold the */ /* structure of pointers to the individual data */ /* elements found in the header and data records */ void *base_sen_ptr; /* base address of memory allocated to hold the */ /* sensor table information */ void *base_mode_ptr; /* base address of memory allocated to hold the */ /* mode table information */ void *base_pinfo_ptr; /* base address of memory allocated to hold */ /* information pertinent to the parameter being */ /* plotted (plot position, plot number, etc) for */ /* graphical display program */ void *base_tab_data; /* base address of memory allocated to hold the */ /* structures that holds information for each */ /* parameter being processed in tabular display */ void *base_time_off; /* base address of memory allocated to hold the */ /* time offset values for all sensors */ void *base_tbl_index; /* base address of memory allocated to hold index*/ /* into sensor table combo for each sensor */ void *base_fill_sen; /* base address of memory allocated to hold */ /* the array of structures for the fill routines */ void *base_mode_info; /* base address of memory allocated to hold */ /* the array of structures for mode information */ void *base_constant; /* base address of memory allocated to hold the */ /* constant ID and values for each sensor */ void *base_collapse; /* base address of memory allocated to hold */ /* the array of structures for the fill routines */ void *base_bin; /* base address of memory for bin_info structure */ void *base_timing; /* base address of memory for timing structure */ void *base_fill_arrays; /* base address of memory for fill_arrays struct */ void *base_mode_arrays; /* base address of memory for fill_mode struct */ void *base_pitch_info; /* base address of memory for pitch angle struct */ void *base_euler_info; /* base address of memory for euler angle struct */ void *base_celestial_info;/* base address of memory for celestial pos.struct*/ void *base_spin_src; /* base address of memory for start of spin */ /* struct when a data source is defined */ void *base_start_spin_off;/* base address of memory allocated to hold the */ /* start of spin offset values for all sensors */ void *base_start_spin_info;/* base address of memory allocated to hold */ /* start of spin information for each sensor */ void *base_potential_info;/* base address of memory for spacecraft */ /* potential struct */ void *base_background_info;/* base address of memory for background */ /* struct */ void *base_inst_tbl_info; /* base address of memory allocated to hold non- */ /* array table information for each table defined*/ }; struct time_info { SDDAS_SHORT base_year; SDDAS_SHORT base_day; SDDAS_LONG base_sec; SDDAS_LONG base_nano; SDDAS_LONG base_pix; SDDAS_LONG res_sec; SDDAS_LONG res_nano; SDDAS_FLOAT pix_width; }; struct sweep_timing { SDDAS_LONG *btime_ms; /* milliseconds start time of each sample */ SDDAS_LONG *btime_ns; /* nanosecond residual start time of each sample*/ SDDAS_LONG *etime_ms; /* milliseconds end time of each sample */ SDDAS_LONG *etime_ns; /* nanosecond residual end time of each sample */ SDDAS_CHAR get_times; /* flag indicating if times need to be computed */ SDDAS_CHAR pa_times; /* flag indicating pitch angle(s) need times */ SDDAS_CHAR pot_times; /* flag for spacecraft potential needs times */ SDDAS_CHAR euler_times; /* flag indicating euler angles need times */ SDDAS_CHAR celestial_times; /* flag indicating celestial pos. need times */ SDDAS_CHAR background_times; /* flag indicating background needs times */ SDDAS_CHAR use_end_yr_day;/* flag indicating if end year/day values are */ /* to be used */ SDDAS_CHAR same_times; /* flag indicating if the same time range is */ /* applicable to all steps of the vector */ void *base_time; /* ptr to time values */ }; struct time_range { SDDAS_SHORT btime_year; /* beginning year */ SDDAS_SHORT btime_day; /* beginning day */ SDDAS_LONG btime_sec; /* beginning time in seconds */ SDDAS_LONG btime_nsec; /* beginning time in nanosec. */ SDDAS_SHORT etime_year; /* ending year */ SDDAS_SHORT etime_day; /* ending day */ SDDAS_LONG etime_sec; /* ending time in seconds */ SDDAS_LONG etime_nsec; /* ending time in nanosec. */ }; struct experiment_info { struct alloc_experiment bmem; /* structure that holds base memory */ /* addresses for allocated memory */ struct ptr_rec *info_ptr; /* structure of pointers to the various*/ /* data elements from header and data */ struct inst_tbl_info *tbl_info_ptr; /* ptr to array of table def. values */ struct sensor_tables *sen_tbl_ptr; /* ptr to array of sensor table values */ struct mode_tables *mode_tbl_ptr; /* ptr to array of mode table values */ struct plot_loc *plot_info; /* ptr to information for each param */ /* being plotted in graphical program */ struct tab_info *tab_data; /* ptr to information for each param. */ /* being plotted in tabular display */ struct fill_sensor *fill_sen_ptr; /* ptr to information for the fill */ /* routines (tbl_app flags, min, max) */ struct fill_sensor *mode_info_ptr; /* ptr to information for the mode fill*/ /* routines (tbl_app flags, min, max) */ struct collapse_data *collapse_ptr; /* ptr to information for the collapse */ /* routines */ struct bin_info *bin_ptr; /* ptr to information for data bins */ struct timing *timing_ptr; /* ptr to information for pixel timing */ struct fill_data *fill_arrays; /* ptr to the buffer info for fill_data*/ struct fill_mode *mode_arrays; /* ptr to the buffer info for */ /* fill_mode_data */ struct time_info time_values; /* timing info for fill_data */ struct sweep_timing swp_times; /* time per sample (step) */ struct pitch_info *pitch_angles; /* ptr to information for pitch angles */ struct spin_src_info *spin_src; /* ptr to info. for spin data source */ struct start_spin_info *start_sptr; /* ptr to start of spin information */ struct potential_info *potential; /* ptr to spacecraft potential values */ struct euler_info *euler_angles; /* ptr to information for euler angles */ struct celestial_info *celestial_position; /* ptr to information for */ /* celestial position data */ struct background_info *background; /* ptr to background values */ struct time_range requested_time; /* holds the user-requested time range */ struct time_range closest_time; /* holds the time range closest to the */ /* user-requested time range */ int fdh; /* file descriptor for header file */ int fdd; /* file descriptor for data file */ SDDAS_ULONG inh; /* inode for header file */ SDDAS_ULONG ind; /* inode for data file */ SDDAS_ULONG data_key; /* key which uniquely identifies the */ /* project, mission, experiment, */ /* instrument and virtual instrument */ /* being processed */ SDDAS_LONG btime_ms; /* time (msec) of 1st data value in the*/ /* data sweep (start of accumulation) */ SDDAS_LONG btime_ns; /* time (nanoseconds) of 1st data value*/ /* in the data sweep */ SDDAS_LONG etime_ms; /* time (msec) of last data value in */ /* the data sweep (end of accumulation)*/ SDDAS_LONG etime_ns; /* time (nanoseconds) of last data */ /* value in the data sweep */ SDDAS_LONG accum_ss_ms; /* data record sensor set time accum */ SDDAS_LONG accum_ss_ns; /* data record sensor set time accum */ SDDAS_LONG next_offset; /* starting sensor set (tabular only) */ SDDAS_LONG initial_gap; /* the number of pixels to be bypassed */ /* from the beginning of the plot for */ /* the very first data value */ SDDAS_LONG *start_spin_off; /* start of spin offset time (msec) */ /* for each sensor */ SDDAS_LONG *time_off; /* offset time (msec) for each sensor */ SDDAS_LONG de_msec; /* end time(msec) for current idf file */ SDDAS_LONG fill_value; /* fill value defined in VIDF file */ SDDAS_LONG accum_ss_sz; /* accumulation of sensor set sizes */ /* in bits */ SDDAS_LONG accum_ms; /* time for a single data acquisition */ SDDAS_LONG accum_ns; /* time for a single data acquisition */ SDDAS_LONG lat_ms; /* amt of dead time between successive */ /* data acquisitions */ SDDAS_LONG lat_ns; /* amt of dead time between successive */ /* data acquisitions */ SDDAS_LONG swp_ms; /* amt of dead time at the end of an */ /* inst. sweep */ SDDAS_LONG swp_ns; /* amt of dead time at the end of an */ /* inst. sweep */ SDDAS_LONG sen_ms; /* amt of dead time between successive */ /* sensor sets */ SDDAS_LONG sen_ns; /* amt of dead time between successive */ /* sensor sets */ SDDAS_LONG time_col_ms; /* time between adjacent data samples */ /* in the same matrix column */ SDDAS_LONG time_col_ns; /* time between adjacent data samples */ /* in the same matrix column */ SDDAS_LONG time_row_ms; /* time between adjacent data samples */ /* in the same matrix row */ SDDAS_LONG time_row_ns; /* time between adjacent data samples */ /* in the same matrix row */ SDDAS_LONG time_sm_ms; /* total time between acquisition of */ /* two consecutive data samples */ SDDAS_LONG time_sm_ns; /* total time between acquisition of */ /* two consecutive data samples */ SDDAS_FLOAT rec_time; /* time per data RECORD (tabular only) */ SDDAS_FLOAT read_cnt; /* used to determine when to read data */ /* (tabular only) */ SDDAS_FLOAT *constants; /* constant values (one per sensor) */ SDDAS_SHORT de_year; /* end year for current idf file */ SDDAS_SHORT de_day; /* end day for current idf file */ SDDAS_SHORT de_usec; /* offset from de_msec for current idf*/ SDDAS_SHORT num_of_plots; /* the number of plots utilizing this */ /* exper/virtual/extension combination */ SDDAS_SHORT swp_len; /* no. of elements in full sample seq. */ SDDAS_SHORT *CAL_USE; /* cal. table usage definitions */ SDDAS_ULONG *CSET_NUM; /* no. of elements in each cal. set */ SDDAS_USHORT num_sample; /* no. of data elements returned */ SDDAS_SHORT num_sensor; /* total no. of sensor definitions */ SDDAS_SHORT num_sen_used; /* the number of sensors being utilized*/ SDDAS_SHORT num_combo; /* number of sensor tbl combinations */ SDDAS_SHORT *index_sen_tbl; /* indexes that indicate which sensor */ /* tables combo each sensor utilizes */ /* (-1 means sensor not plotted) */ SDDAS_SHORT num_fill_sensor; /* number of fill_sensor structures */ SDDAS_SHORT num_mode_info; /* number of fill_sensor structures for*/ /* modes */ SDDAS_SHORT max_packing; /* maximum packing of scalar data */ SDDAS_SHORT max_nss; /* maximum number of sensor sets */ SDDAS_USHORT version; /* version number for the combo (used */ /* to facilitate multiple opens) */ SDDAS_USHORT mode_version; /* version number for mode processing */ SDDAS_USHORT pa_version; /* version number for pitch angles */ SDDAS_USHORT pmi_version; /* version number for euler angles */ SDDAS_USHORT celestial_version; /* version number for celestial position*/ SDDAS_USHORT spin_version; /* version number for spin data source */ SDDAS_USHORT potential_version; /* version no. for potential data src */ SDDAS_USHORT background_version; /* version no. for background data src */ SDDAS_CHAR header_name[MAXPATHLEN]; /* the name of the header file opened */ SDDAS_CHAR data_name[MAXPATHLEN]; /* the name of the data file opened */ SDDAS_CHAR exten[3]; /* filename extension of the data files*/ SDDAS_CHAR fnext; /* flag that indicates if start time */ /* file alignment has been done */ SDDAS_CHAR first_open; /* flag that indicates if the files */ /* opened are the 1st files opened for */ /* this exper/virtual/exten combo. */ SDDAS_CHAR fill_flag; /* flag indicating if a fill value is */ /* defined by the VIDF */ SDDAS_CHAR num_tbls; /* the number of tables defined */ SDDAS_CHAR num_consts; /* the number of constants defined */ SDDAS_CHAR tdw_len; /* maximum data word length of all sen */ SDDAS_CHAR *sen_tdw_len; /* array of data word lengths (bits), */ /* one per sensor */ SDDAS_CHAR *sen_status; /* sensor status flags - one per sensor*/ SDDAS_CHAR cal_sets; /* no. of calibration sets */ SDDAS_CHAR *cal_wlen; /* word length of cal. data (bits) */ SDDAS_CHAR smp_id; /* instrument sweep identifier */ SDDAS_CHAR *d_type; /* data format - one per sensor */ SDDAS_CHAR sen_mode; /* data matrix format */ SDDAS_CHAR TRC; /* indicates if time advances along */ /* matrix rows or matrix columns */ SDDAS_CHAR TRP; /* indicates if rows are sequential or */ /* parallel (timing) */ SDDAS_CHAR TCP; /* indicates if columns are sequential */ /* or parallel (timing) */ SDDAS_CHAR *HEADER_MEM; /* ptr to the memory into which header */ /* record information is read */ SDDAS_CHAR *DATA_MEM; /* ptr to the memory into which data */ /* record information is read */ SDDAS_CHAR first_select; /* flag that indicates if this sensor */ /* is the first sensor selected */ /* (called SELECT_SENSOR()) */ SDDAS_CHAR los; /* flag that indicates LOS scenario */ SDDAS_CHAR eop; /* flag that indicates end-of-panel */ SDDAS_CHAR *sensors_needed; /* indicates which sensors are needed */ /* for plotting requested parameters */ SDDAS_CHAR drec_eof; /* flag that indicates if read_drec */ /* hit an eof scenario (partial file) */ SDDAS_CHAR hrec_eof; /* flag that indicates if a fill header*/ /* was read (header not yet received) */ SDDAS_CHAR da_method; /* data accumulation code */ SDDAS_CHAR *cal_target; /* array that holds the target of the */ /* calibration sets */ SDDAS_CHAR *cal_scope; /* array that holds the scope of the */ /* calibration sets */ SDDAS_CHAR *cal_d_type; /* data format - one per cal. set */ SDDAS_UCHAR cur_panel; /* indicates which panel the plot is */ /* currently utilizing */ SDDAS_CHAR cal_mod_swp; /* flag indicating there is a cal. set */ /* that modifies sweep data */ SDDAS_CHAR pot_mod_swp; /* flag indicating spacecraft potential*/ /* data modifies sweep data */ SDDAS_CHAR all_or_one; /* flag to check pixel loc for times */ SDDAS_CHAR crit_action; /* indicates the no. of crit. act. tbls*/ SDDAS_UCHAR num_modes; /* no. of modes defined */ SDDAS_CHAR mode_done; /* flag indicating mode ex struct done */ SDDAS_CHAR pa_def; /* pitch angle defined? 1 = yes 0 = no */ SDDAS_CHAR spin_src_def; /* spin source defined? 1 = yes 0 = no */ SDDAS_CHAR potential_def; /* spacecraft potential defined? 1=y 0=n*/ SDDAS_CHAR euler_def; /* euler angle defined? 1 = yes 0 = no */ SDDAS_CHAR celestial_def; /* celestial position defined? */ SDDAS_CHAR background_def; /* background defined? 1=y 0=n */ SDDAS_CHAR scf_tie; /* flag if SCF definition, 1 = yes */ SDDAS_CHAR phi_method; /* azimuthal angle computation method */ SDDAS_CHAR nano_defined; /* flag if nanosec. adjust. to dr_time */ SDDAS_CHAR data_lat_units; /* scale factor for data_latency */ SDDAS_CHAR swp_reset_units; /* scale factor for swp_reset */ SDDAS_CHAR sen_reset_units; /* scale factor for sen_reset */ SDDAS_SHORT last_sensor; /* last sensor processed by read_drec()*/ SDDAS_CHAR header_format; /* header format to be utilized */ SDDAS_SHORT tensor_rank; /* rank of tensor data - if applicable */ SDDAS_LONG tensor_sizes[IDFS_MAX_DIMEN]; /* length of each tensor dimension*/ SDDAS_ULONG tnext_dimen[IDFS_MAX_DIMEN]; /* holds no. of data values to */ /* bypass to get to next index for a */ /* given dimension ([0] = 1st dimension*/ /* or slowest varying dimension) */ SDDAS_ULONG tensor_elements; /* no. elements within a complete tensor*/ SDDAS_SHORT spin_sen_ctrl; /* total no. of sensor definitions */ SDDAS_SHORT spin_method; /* method to use to determine start of */ /* spin */ SDDAS_SHORT coord_system; /* coordinate system data is stored in */ SDDAS_BOOL return_celestial_pos; /* flag indicating if celestial pos. */ /* data is to be returned if defined */ SDDAS_BOOL return_euler_angles; /* flag indicating if euler angle data */ /* is to be returned if defined */ SDDAS_BOOL return_pitch_angles; /* flag indicating if pitch angle data */ /* is to be returned if defined */ SDDAS_BOOL override_potential_poly; /* flag indicating potential polynomial*/ /* coefficients from table are to be */ /* overridden */ SDDAS_FLOAT potential_slope; /* new slope polynomial coefficient */ SDDAS_FLOAT potential_intercept; /* new intercept polynomial coefficient*/ SDDAS_BOOL ancillary_opened; /* flag indicating associated ancillary*/ /* data files have been opened */ }; struct general_info { SDDAS_SHORT nds; /* no. of experiment_info structures */ /* allocated */ SDDAS_SHORT pos_ex; /* index indicating which experiment_ */ /* info structure is being utilized */ struct experiment_info *exbase; /* ptr to memory allocated for all */ /* experiment_info structures (word */ /* aligned) */ struct experiment_info *expt; /* ptr to the current experiment_info */ /* structure being utilized */ SDDAS_UINT sexper; /* no. of bytes allocated for all */ /* experiment_info structures */ void *mexper; /* base address of memory allocated for*/ /* all experiment_info structures */ SDDAS_CHAR called_locate; /* flag set if LOCATE_EX was called */ SDDAS_USHORT next_version; /* the next available version number */ void **idf_data_ptr; /* array of addresses for allocated */ /* idf_data structures */ SDDAS_LONG num_idf_data_ptr; /* no. of allocated idf_data structures*/ void **tensor_data_ptr; /* array of addresses for allocated */ /* tensor_data structures */ SDDAS_LONG num_tensor_data_ptr; /* no. of allocated tensor_data structs*/ void **moments_data_ptr; /* array of addresses for allocated */ /* moments_results structures, done by */ /* libmoments library */ SDDAS_LONG num_moments_data_ptr; /* no. of allocated moments_results */ /* structures */ }; struct ptr_rec { SDDAS_LONG d_size; /* size in bytes of the data record */ SDDAS_SHORT h_size; /* size in bytes of the header record */ SDDAS_SHORT *YEAR; /* year associated with header */ SDDAS_SHORT *DAYOFYEAR; /* julian day associated with header */ SDDAS_CHAR *TIME_UNITS; /* scale factor for appropriate time base*/ SDDAS_UCHAR *I_MODE; /* number of instrument mode flags */ SDDAS_LONG *DATA_ACCUM; /* time for a single acquisition */ SDDAS_LONG *DATA_LAT; /* dead time between two acquisitions */ SDDAS_LONG *SWP_RESET; /* dead time at end of instrument sweep */ SDDAS_LONG *SEN_RESET; /* dead time between sensor sets */ SDDAS_SHORT *N_SEN; /* number of sensors in a sensor set */ SDDAS_SHORT *SENSOR_INDEX; /* array that indicates which sensors */ /* are being returned and in what order */ SDDAS_UCHAR *DQUAL; /* offset into data quality definition */ /* array found in IDF file */ SDDAS_UCHAR *MODE_INDEX; /* array of instrument mode flags */ SDDAS_LONG *TIME; /* beginning time of first element in */ /* the data matrix in the data record */ SDDAS_LONG *SPIN; /* rotation rate of virtual instrument */ SDDAS_LONG *SUN_SEN; /* time of last 0 degree crossing */ SDDAS_LONG *HDR_OFF; /* offsets into the header file for each */ /* sensor set found in the data record */ SDDAS_LONG *NSS; /* number of sensor sets found in the */ /* current data matrix */ SDDAS_LONG *NANO_RES; /* ptr to nanosec. adjust. to dr_time */ SDDAS_UCHAR *DATA; /* ptr to the sensor set data */ SDDAS_UCHAR *CAL_SWP_TBL; /* ptr to the sweep calibration data */ SDDAS_UCHAR *CAL_SENSOR; /* ptr to the sensor calibration data */ SDDAS_UCHAR *ALL_CAL_SWP; /* ptr to the sweep calibration data used*/ /* by all sensors */ SDDAS_UCHAR *ALL_CAL_SEN; /* ptr to the sensor calibration data */ /* used by all sensors */ SDDAS_CHAR reset_hdr; /* tells if a new header has been read */ SDDAS_CHAR chg_sen_set; /* flag indicating if a sensor set was */ /* previously crossed */ SDDAS_LONG prev_hd; /* offset to the previous header record */ SDDAS_SHORT cur_sen_set; /* the current sensor set being processed*/ SDDAS_LONG time_row; /* the matrix row being processed */ SDDAS_SHORT time_col; /* the matrix column being processed */ SDDAS_ULONG num_swp_cal; /* no. of calibration elements for the */ /* sample sequence values */ SDDAS_ULONG num_sen_cal; /* no. of calibration elements for all */ /* sensor data */ SDDAS_ULONG num_all_swp_cal; /* no. of cal. elements for the sample */ /* sequence values used by all sensors */ SDDAS_ULONG num_all_sen_cal; /* no. of cal. elements for sensor */ /* data used by all sensors */ SDDAS_CHAR swp_bit; /* no. of bits to offset to get to the */ /* cal. data for sample sequence values */ SDDAS_CHAR sen_bit; /* no. of bits to offset to get to the */ /* cal. data for the sensor data */ SDDAS_CHAR all_swp_bit; /* no. of bits to offset to get to the */ /* cal. data for sample sequence values */ /* defined for use by all sensors */ SDDAS_CHAR all_sen_bit; /* no. of bits to offset to get to the */ /* cal. data for the sensor data */ /* defined for use by all sensors */ SDDAS_CHAR time_advanced; /* flag indicating time pointers were */ /* advanced */ SDDAS_CHAR increasing_angles; /* flag indicating if angles are */ /* increasing or decreasing within sweep */ SDDAS_FLOAT deg_per_msec; /* number of degrees per millisecond */ struct idfs_info *hdr_fmt1_ptr; /* ptr to original idfs header structure */ struct tensor_info *hdr_fmt2_ptr; /* ptr to tensor info. structure */ void *base_tensor_info; /* base address of memory allocated for */ /* tensor information */ void *base_idfs_info; /* base address of memory allocated for */ /* original header information not shared*/ /* with tensor header format */ }; struct sensor_tables { SDDAS_FLOAT *tbls; /* the tables */ SDDAS_FLOAT **tbl_ptr; /* an array of pointers to each of the */ /* tables defined */ SDDAS_LONG *tbl_size; /* an array of sizes for tables */ SDDAS_CHAR *tbl_expand; /* an array of flags that indicate if the*/ /* table is expanded or has poly coeff. */ SDDAS_CHAR *tbl_fmt; /* an array that indicates the format of */ /* the table */ SDDAS_CHAR num_tbls; /* the number of integer tables */ void *base_tbls; /* base address of memory allocated for */ /* the integer tables defined in VIDF */ void *base_misc_tbls; /* base address of memory allocated for */ /* misc. info. for integer tables */ SDDAS_CHAR max_tdw_len; /* the largest TDW_LEN value of all the */ /* sensors that use the same table combo.*/ struct crit_action_info *act_ptr; /* ptr to array of sensor table values */ void *base_crit_action; /* base address of memory allocated for */ /* the critical action structures (1 per */ /* table) */ }; struct mode_tables { SDDAS_FLOAT *tbls; /* the tables */ SDDAS_FLOAT **tbl_ptr; /* an array of pointers to each of the */ /* tables defined */ SDDAS_LONG *tbl_size; /* an array of sizes for tables */ SDDAS_CHAR *tbl_expand; /* an array of flags that indicate if the*/ /* table is expanded or has poly coeff. */ SDDAS_CHAR *tbl_var; /* an array that indicates the functional*/ /* dependence of the table */ SDDAS_CHAR *tbl_fmt; /* an array that indicates the format of */ /* the table */ SDDAS_CHAR *tbl_num; /* an array that holds the table number */ SDDAS_CHAR num_tbls; /* the number of mode tables */ void *base_tbls; /* base address of memory allocated for */ /* the mode tables defined in VIDF */ void *base_misc_tbls; /* base address of memory allocated for */ /* misc. info. for mode tables */ }; struct timing { SDDAS_LONG pix_num; SDDAS_LONG start_sec; SDDAS_LONG start_nano; SDDAS_LONG end_sec; SDDAS_LONG end_nano; SDDAS_SHORT start_yr; SDDAS_SHORT start_day; SDDAS_SHORT end_yr; SDDAS_SHORT end_day; }; struct def_oper { void (*_math_drv) (SDDAS_FLOAT *, SDDAS_CHAR *, SDDAS_LONG, SDDAS_FLOAT *, SDDAS_LONG, SDDAS_LONG, SDDAS_CHAR, SDDAS_CHAR, SDDAS_LONG, SDDAS_CHAR, SDDAS_CHAR, SDDAS_CHAR, SDDAS_LONG *, SDDAS_SHORT); }; struct def_combine_oper { void (*_math_drv) (SDDAS_FLOAT *, SDDAS_FLOAT *, SDDAS_LONG); }; struct crit_action_info { SDDAS_LONG *crit_action; /* ptr to 1st element in the critical */ /* status action array */ SDDAS_LONG crit_offset; /* offset into critical status table */ SDDAS_SHORT crit_flag; /* holds the current contents of the */ /* critical status byte */ SDDAS_CHAR crit_status; /* sensor critical status byte */ SDDAS_CHAR crit_tbl; /* the table that has a critical action */ void *base_action; /* base address of memory allocated for */ /* the critical status action array */ }; struct tensor_info { SDDAS_SHORT *WORD_PAD; /* pad to get to a word boundary - old */ /* legacy systems need this */ SDDAS_ULONG *DQUAL_SIZE; /* no. of data quality flags defined */ /* PER sensor */ SDDAS_ULONG TENSOR_ELEMENTS; /* total no. of tensor elements defined */ /* COMPUTED, not read from header */ }; struct idfs_info { SDDAS_USHORT *N_SAMPLE; /* number of samples for a sensor */ SDDAS_SHORT *SAMP_INDEX; /* offsets used to create (read) sample */ /* sequence values */ }; struct tensor_data /* data structure filled by READ_TENSOR_DREC(). */ { SDDAS_ULONG data_key; /* key which uniquely identifies the project, */ /* mission, experiment, instrument and virtual */ /* instrument associated with the data returned */ SDDAS_SHORT header_format;/* header format-identify multi-dimensional data */ /* data type helps with word boundaries */ SDDAS_SHORT sensor; /* sensor associated with the data returned */ SDDAS_SHORT byear; /* year associated with the first data value */ /* in the data sweep (start of accumulation) */ SDDAS_SHORT bday; /* day of year associated with first data value */ /* in the data sweep (start of accumulation) */ SDDAS_LONG bmilli; /* time (msec) associated with first data value */ /* in the data sweep (start of accumulation) */ SDDAS_LONG bnano; /* time (nanoseconds) associated with first data */ /* value in the data sweep(start of accumulation)*/ SDDAS_LONG bsec; /* start time of the first data value in the */ /* sweep in seconds (bmilli + bnano) */ SDDAS_LONG bnsec; /* start time of first data value in the sweep */ /* in nanosecond (residual from bsec computation)*/ SDDAS_SHORT eyear; /* year associated with the last data value */ /* in the data sweep (end of accumulation) */ SDDAS_SHORT eday; /* day of year associated with last data value */ /* in the data sweep (end of accumulation) */ SDDAS_LONG emilli; /* time (msec) associated with last data value */ /* in the data sweep (end of accumulation) */ SDDAS_LONG enano; /* time (nanoseconds) associated with last data */ /* value in the data sweep (end of accumulation) */ SDDAS_LONG esec; /* end time of the last data value in the */ /* sweep in seconds (emilli + enano) */ SDDAS_LONG ensec; /* end time of the last data value in the sweep */ /* in nanosecond (residual from esec computation)*/ SDDAS_SHORT mode_byear; /* year associated with mode values (start of */ /* accumulation) */ SDDAS_SHORT mode_bday; /* day of year associated with mode values */ /* (start of accumulation) */ SDDAS_LONG mode_bmilli; /* time (msec) associated with mode values */ /* (start of accumulation) */ SDDAS_LONG mode_bnano; /* time (nanoseconds) associated with mode values*/ /* (start of accumulation) */ SDDAS_SHORT mode_eyear; /* year associated with mode values (end of */ /* accumulation) */ SDDAS_SHORT mode_eday; /* day of year associated with mode values */ /* (end of accumulation) */ SDDAS_LONG mode_emilli; /* time (msec) associated with mode values */ /* (end of accumulation) */ SDDAS_LONG mode_enano; /* time (nanoseconds) associated with mode values*/ /* (end of accumulation) */ SDDAS_LONG data_accum_ms; /* time for a single data acquisition (in msec) */ SDDAS_LONG data_accum_ns; /* time for a single data acquisition (in nsec) */ SDDAS_LONG data_lat_ms; /* amount of dead time between successive data */ /* acquisitions (in milliseconds) */ SDDAS_LONG data_lat_ns; /* amount of dead time between successive data */ /* acquisitions (in nanoseconds) */ SDDAS_LONG swp_reset_ms; /* amount of dead time at the end of an inst. */ /* sweep (in milliseconds) */ SDDAS_LONG swp_reset_ns; /* amount of dead time at the end of an inst. */ /* sweep (in nanoseconds) */ SDDAS_LONG sen_reset_ms; /* amount of dead time between successive sensor */ /* sets (in milliseconds) */ SDDAS_LONG sen_reset_ns; /* amount of dead time between successive sensor */ /* sets (in nanoseconds) */ SDDAS_SHORT tensor_rank; /* no. of elements returned in sensor data array */ SDDAS_LONG tensor_sizes[IDFS_MAX_DIMEN]; /* dimension lengths (max.) */ SDDAS_ULONG tnext_dimen[IDFS_MAX_DIMEN]; /* holds no. of data values to */ /* bypass to get to next index for a given */ /* dimension ([0] = 1st dimension or slowest */ /* varying dimension) */ SDDAS_ULONG num_vals; /* total no. of data elements returned */ SDDAS_ULONG cal_len; /* no. of elements returned in calibration array */ SDDAS_LONG sun_sen; /* time of the last 0 degree crossing */ SDDAS_LONG spin_rate; /* the spin rate of the virtual instrument */ SDDAS_LONG *sen_data; /* ptr to first element in the sensor array */ SDDAS_LONG *mode; /* ptr to first element in the mode flags array */ SDDAS_LONG *d_qual; /* ptr to first element in the data quality array*/ SDDAS_LONG *cal_data; /* ptr to first element in the calibration array */ SDDAS_UINT data_size; /* no. of bytes allocated for sensor data array */ SDDAS_UINT tensor_bytes; /* no. of bytes allocated for tensor converted */ /* according to d_type */ SDDAS_UINT mode_size; /* no. of bytes allocated for mode flags array */ SDDAS_UINT dqual_size; /* no. of bytes allocated for data quality array */ SDDAS_UINT cal_size; /* no. of bytes allocated for calibration array */ SDDAS_ULONG num_dqual; /* no. of elements returned in data quality array*/ SDDAS_UCHAR mode_len; /* no. of elements returned in mode flags array */ SDDAS_CHAR hdr_change; /* flag that indicates a header change occurred */ SDDAS_CHAR exten[3]; /* filename extension of the data files */ SDDAS_CHAR filled_data; /* flag indicating data array was filled */ SDDAS_USHORT version; /* version number for the requested data */ SDDAS_FLOAT *tdata; /* ptr to first element in the tensor which has */ /* been converted according to d_type field */ SDDAS_FLOAT *tcaldata; /* ptr to first element in the cal. data which */ /* has been converted according to d_type field */ void *base_data; /* base address of memory allocated for sensor */ /* data */ void *base_tdata; /* base address of memory allocated for sensor */ /* data converted according to d_type field */ void *base_cal; /* base address of memory allocated for calibra- */ /* tion data */ void *base_tcaldata; /* base address of memory allocated for cal. */ /* data converted according to d_type field */ void *base_mode; /* base address of memory allocated for mode */ /* values */ void *base_dqual; /* base address of memory allocated for data */ /* quality values */ }; struct inst_tbl_info /* structure to hold non-array info. for tables */ { SDDAS_LONG tbl_sca_sz; SDDAS_LONG crit_act_sz; SDDAS_CHAR tbl_type; SDDAS_CHAR tbl_var; SDDAS_CHAR tbl_expand; SDDAS_CHAR sen_fn_of_raw; /* set ONCE whenever tbl_var changes INSTEAD of */ SDDAS_CHAR swp_fn_of_raw; /* everytime in ir_convert_xxxx_data() routines */ SDDAS_CHAR cal_fn_of_raw; SDDAS_CHAR mode_fn_of_raw; SDDAS_CHAR scpot_fn_of_raw; SDDAS_CHAR bkgd_fn_of_raw; }; #endif