00001 #include "jsoc_main.h"
00002 #include "drms_types.h"
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #define ARRLENGTH(ARR) (sizeof(ARR) / sizeof(ARR[0]))
00030
00031 const char *meKeys[] =
00032 {
00033 "QUALITY", "QUAL_S", "QUALLEV1", "INSTRUME", "CAMERA",
00034 "T_OBS", "CADENCE", "DATE_S", "DATE__OBS", "DATE", "DATE_M",
00035 "DSUN_OBS", "CRLN_OBS", "CRLT_OBS", "CAR_ROT",
00036 "OBS_VR", "OBS_VW", "OBS_VN", "RSUN_OBS",
00037 "INVCODEV", "INVDOCU", "INVITERA", "INVLMBDA", "INVLMBDF",
00038 "INVTUNEN", "INVSVDTL", "INVCHIST", "INVPOLTH",
00039 "INVPJUMP", "INVLMBDM", "INVLMBD0", "INVLMBDB",
00040 "INVDLTLA", "INVLMBDS", "INVLMBMS",
00041 "INVLYOTW", "INVWNARW", "INVWSPAC",
00042 "INVINTTH", "INVNOISE", "INVCONTI", "INVWGHTI",
00043 "INVWGHTQ", "INVWGHTU", "INVWGHTV", "INVSTLGT", "INVFREEP",
00044 "INVFLPRF", "INVPHMAP", "INVVLAVE", "INVBLAVE", "INVBBAVE",
00045 "INVNPRCS", "INVNCNVG",
00046 "INVKEYS1", "INVKEYS2", "INVKEYS3",
00047 "INVKEYI1", "INVKEYI2", "INVKEYI3",
00048 "INVKEYD1", "INVKEYD2", "INVKEYD3",
00049 "INVNFCTI", "INVNFCTQ", "INVNFCTU", "INVNFCTV",
00050 "HFLID", "HCFTID", "QLOOK", "TINTNUM", "SINTNUM",
00051 "DISTCOEF", "ROTCOEF", "POLCALM", "SOURCE",
00052 "CODEVER0", "CODEVER1", "CODEVER2", "CODEVER3", "CODEVER4", "CODEVER5", "CODEVER6","BLD_VERS","CALVER64"
00053 };
00054
00055 const char *patchKeys[] =
00056 {
00057 "PATCHNUM","ARMCODEV","ARMDOCU","HRPCODEV","HRPDOCU",
00058 "CRSIZE1","CRSIZE2","ACTIVE","NCLASS","ON_PATCH","MASK","ARM_QUAL","ARM_NCLN","H_MERGE","H_FAINT",
00059 "ARM_MODL","ARM_EDGE","ARM_BETA","TKP_KWID","TKP_KLAT","TKP_TAU","TKP_TAU2",
00060 "TKP_ACTV","TKP_FNUM","TKP_FTIM","TKP_MAPR","TKP_RUNN","TKP_RUNT",
00061 "LATDTMIN","LONDTMIN","LATDTMAX","LONDTMAX","OMEGA_DT",
00062 "NPIX","SIZE","AREA","NACR","SIZE_ACR","AREA_ACR",
00063 "MTOT","MNET","MPOS_TOT","MNEG_TOT","MMEAN","MSTDEV","MSKEW","MKURT",
00064 "LAT_MIN","LON_MIN","LAT_MAX","LON_MAX","LAT_FWT","LON_FWT","LAT_FWTPOS","LON_FWTPOS","LAT_FWTNEG","LON_FWTNEG",
00065 "T_FRST","T_FRST1","T_LAST1","T_LAST","N_PATCH","N_PATCH1","N_PATCHM","NOAA_AR","NOAA_NUM","NOAA_ARS","OFFDISK", "QUIET"
00066 };
00067
00068 const char *geoKeys[] =
00069 {
00070 "CRPIX1", "CRPIX2", "CRVAL1", "CRVAL2",
00071 "CDELT1", "CDELT2", "CROTA2",
00072 "CRDER1", "CRDER2", "CSYSER1", "CSYSER2",
00073 "IMCRPIX1", "IMCRPIX2"
00074 };
00075
00076 const char *ambigKeys[] =
00077 {
00078 "AMBCODEV", "AMBDOCU",
00079 "AMBGMTRY", "AMBWEAK", "AMBNEROD", "AMBNGROW",
00080 "AMBNPAD", "AMBNAP", "AMBNTX", "AMBNTY",
00081 "AMBBTHR0", "AMBBTHR1", "AMBSEED", "AMBNEQ",
00082 "AMBLMBDA", "AMBTFCT0", "AMBTFCTR", "AMBPATCH"
00083 };
00084
00085
00086
00087 int copy_me_keys (DRMS_Record_t *inRec, DRMS_Record_t *outRec)
00088
00089 {
00090 int failCount = 0;
00091 int iKey, nKeys = ARRLENGTH(meKeys);
00092
00093 if (inRec == NULL || outRec == NULL) {
00094 return -1;
00095 }
00096
00097 for (iKey = 0; iKey < nKeys; iKey++)
00098 {
00099 failCount += drms_copykey(outRec, inRec, meKeys[iKey]);
00100 }
00101
00102 return failCount;
00103 }
00104
00105
00106
00107 int copy_patch_keys (DRMS_Record_t *inRec, DRMS_Record_t *outRec)
00108
00109 {
00110 int failCount = 0;
00111 int iKey, nKeys = ARRLENGTH(patchKeys);
00112
00113 if (inRec == NULL || outRec == NULL) {
00114 return -1;
00115 }
00116
00117 for (iKey = 0; iKey < nKeys; iKey++)
00118 {
00119 failCount += drms_copykey(outRec, inRec, patchKeys[iKey]);
00120 }
00121
00122 return failCount;
00123 }
00124
00125
00126
00127 int copy_geo_keys (DRMS_Record_t *inRec, DRMS_Record_t *outRec)
00128
00129 {
00130 int failCount = 0;
00131 int iKey, nKeys = ARRLENGTH(geoKeys);
00132
00133 if (inRec == NULL || outRec == NULL) {
00134 return -1;
00135 }
00136
00137 for (iKey = 0; iKey < nKeys; iKey++)
00138 {
00139 failCount += drms_copykey(outRec, inRec, geoKeys[iKey]);
00140 }
00141
00142 return failCount;
00143 }
00144
00145
00146
00147 int copy_ambig_keys (DRMS_Record_t *inRec, DRMS_Record_t *outRec)
00148
00149 {
00150 int failCount = 0;
00151 int iKey, nKeys = ARRLENGTH(ambigKeys);
00152
00153 if (inRec == NULL || outRec == NULL) {
00154 return -1;
00155 }
00156
00157 for (iKey = 0; iKey < nKeys; iKey++)
00158 {
00159 failCount += drms_copykey(outRec, inRec, ambigKeys[iKey]);
00160 }
00161
00162 return failCount;
00163 }