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 "BUNIT", "INVNFCTI", "INVNFCTQ", "INVNFCTU", "INVNFCTV",
00050 "BUNIT_000", "BUNIT_001", "BUNIT_002", "BUNIT_003", "BUNIT_004",
00051 "BUNIT_005", "BUNIT_006", "BUNIT_007", "BUNIT_008", "BUNIT_009",
00052 "BUNIT_010", "BUNIT_011", "BUNIT_012", "BUNIT_013", "BUNIT_014",
00053 "BUNIT_015", "BUNIT_016", "BUNIT_017", "BUNIT_018", "BUNIT_019",
00054 "BUNIT_020", "BUNIT_021", "BUNIT_022", "BUNIT_023", "BUNIT_024",
00055 "BUNIT_025", "BUNIT_026", "BUNIT_027",
00056 "HFLID", "HCFTID", "QLOOK", "TINTNUM", "SINTNUM",
00057 "DISTCOEF", "ROTCOEF", "POLCALM", "SOURCE",
00058 "CODEVER0", "CODEVER1", "CODEVER2", "CODEVER3", "CODEVER4", "CODEVER5", "CODEVER6","BLD_VERS","CALVER64"
00059 };
00060
00061 const char *patchKeys[] =
00062 {
00063 "PATCHNUM","ARMCODEV","ARMDOCU","HRPCODEV","HRPDOCU",
00064 "CRSIZE1","CRSIZE2","ACTIVE","NCLASS","ON_PATCH","MASK","ARM_QUAL","ARM_NCLN","H_MERGE","H_FAINT",
00065 "ARM_MODL","ARM_EDGE","ARM_BETA","TKP_KWID","TKP_KLAT","TKP_TAU","TKP_TAU2",
00066 "TKP_ACTV","TKP_FNUM","TKP_FTIM","TKP_MAPR","TKP_RUNN","TKP_RUNT",
00067 "LATDTMIN","LONDTMIN","LATDTMAX","LONDTMAX","OMEGA_DT",
00068 "NPIX","SIZE","AREA","NACR","SIZE_ACR","AREA_ACR",
00069 "MTOT","MNET","MPOS_TOT","MNEG_TOT","MMEAN","MSTDEV","MSKEW","MKURT",
00070 "LAT_MIN","LON_MIN","LAT_MAX","LON_MAX","LAT_FWT","LON_FWT","LAT_FWTPOS","LON_FWTPOS","LAT_FWTNEG","LON_FWTNEG",
00071 "T_FRST","T_FRST1","T_LAST1","T_LAST","N_PATCH","N_PATCH1","N_PATCHM","NOAA_AR","NOAA_NUM","NOAA_ARS","OFFDISK", "QUIET"
00072 };
00073
00074 const char *geoKeys[] =
00075 {
00076 "CRPIX1", "CRPIX2", "CRVAL1", "CRVAL2",
00077 "CDELT1", "CDELT2", "CROTA2",
00078 "CRDER1", "CRDER2", "CSYSER1", "CSYSER2",
00079 "IMCRPIX1", "IMCRPIX2"
00080 };
00081
00082 const char *ambigKeys[] =
00083 {
00084 "AMBCODEV", "AMBDOCU",
00085 "AMBGMTRY", "AMBWEAK", "AMBNEROD", "AMBNGROW",
00086 "AMBNPAD", "AMBNAP", "AMBNTX", "AMBNTY",
00087 "AMBBTHR0", "AMBBTHR1", "AMBSEED", "AMBNEQ",
00088 "AMBLMBDA", "AMBTFCT0", "AMBTFCTR", "AMBPATCH"
00089 };
00090
00091
00092
00093 int copy_me_keys (DRMS_Record_t *inRec, DRMS_Record_t *outRec)
00094
00095 {
00096 int failCount = 0;
00097 int iKey, nKeys = ARRLENGTH(meKeys);
00098
00099 if (inRec == NULL || outRec == NULL) {
00100 return -1;
00101 }
00102
00103 for (iKey = 0; iKey < nKeys; iKey++)
00104 {
00105 failCount += drms_copykey(outRec, inRec, meKeys[iKey]);
00106 }
00107
00108 return failCount;
00109 }
00110
00111
00112
00113 int copy_patch_keys (DRMS_Record_t *inRec, DRMS_Record_t *outRec)
00114
00115 {
00116 int failCount = 0;
00117 int iKey, nKeys = ARRLENGTH(patchKeys);
00118
00119 if (inRec == NULL || outRec == NULL) {
00120 return -1;
00121 }
00122
00123 for (iKey = 0; iKey < nKeys; iKey++)
00124 {
00125 failCount += drms_copykey(outRec, inRec, patchKeys[iKey]);
00126 }
00127
00128 return failCount;
00129 }
00130
00131
00132
00133 int copy_geo_keys (DRMS_Record_t *inRec, DRMS_Record_t *outRec)
00134
00135 {
00136 int failCount = 0;
00137 int iKey, nKeys = ARRLENGTH(geoKeys);
00138
00139 if (inRec == NULL || outRec == NULL) {
00140 return -1;
00141 }
00142
00143 for (iKey = 0; iKey < nKeys; iKey++)
00144 {
00145 failCount += drms_copykey(outRec, inRec, geoKeys[iKey]);
00146 }
00147
00148 return failCount;
00149 }
00150
00151
00152
00153 int copy_ambig_keys (DRMS_Record_t *inRec, DRMS_Record_t *outRec)
00154
00155 {
00156 int failCount = 0;
00157 int iKey, nKeys = ARRLENGTH(ambigKeys);
00158
00159 if (inRec == NULL || outRec == NULL) {
00160 return -1;
00161 }
00162
00163 for (iKey = 0; iKey < nKeys; iKey++)
00164 {
00165 failCount += drms_copykey(outRec, inRec, ambigKeys[iKey]);
00166 }
00167
00168 return failCount;
00169 }