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