diff --git a/csv/ParameterDefs.csv b/csv/ParameterDefs.csv index c3533ff..040b65a 100644 --- a/csv/ParameterDefs.csv +++ b/csv/ParameterDefs.csv @@ -3147,15 +3147,6 @@ TO-DO,Gliders,sci_suna_nitrate_um,sci_suna_nitrate_um,PD3704,quantity,,float32,, TO-DO,Gliders,sci_suna_nitrate_mg,sci_suna_nitrate_mg,PD3705,quantity,,float32,,mg/L,,Nitrate Concentration,4,,,,,,,Nitrate concentration in mg/L,,, CTD,,dpc_ctd_seawater_conductivity,sea_water_electrical_conductivity,PD3706,function,,float32,,S m-1,-9999999,Seawater Conductivity,6,,PFID189,"{""value"":""PD2934"", ""scaler"":0.10}",CONDWAT,sea_water_electrical_conductivity,CONDWAT_L1,"Seawater conductivity refers to the ability of seawater to conduct electricity. The presence of ions in the seawater, such as salt, increases the electrical conducting ability of seawater. As such, conductivity can be used as a proxy for determining the quantity of salt in a sample of seawater.",Seawater Electrical Conductivity,Science Data,L1 TO-DO,FLNTU_X,flntu_x_mmp_cds_scat_seawater,flntu_x_mmp_cds_scat_seawater,PD3715,function,,float32,,m-1,-9999999,Total Scattering Coefficient of Pure Seawater,4,,PFID97,"{""degC"":""PD6"", ""psu"":""dpi_PRACSAL_L2"", ""theta"":""CC_scattering_angle"", ""wlngth"":""CC_measurement_wavelength"", ""delta"":""CC_depolarization_ratio""}",,,,Total scattering coefficient of pure seawater [m-1],,, -TO-DO,FDCHP,fdchp_a_tmpatur,fdchp_a_tmpatur,PD3716,function,"[""-obs"",""fdchp_a_time_L1""]",float32,,degrees_Celsius,-9999999,Sonic Air Temperature,4,,PFID190,"{""timestamp"":""PD7"",""sonicT"":""PD3474""}",,,TMPATUR_L1,Sonic Air Temperature refers to air temperature associated with eddies that flow over the ocean surface and is used to determine vertical fluxes of heat associated with the eddies.,Sonic Air Temperature,Science Data,L1 -TO-DO,FDCHP,fdchp_a_windtur_north,fdchp_a_windtur_north,PD3717,function,"[""-obs"",""fdchp_a_time_L1""]",float32,,m s-1,-9999999,Wind Velocity - Northerly,4,,PFID191,"{""timestamp"":""PD7"",""sonicU"":""PD3471"",""sonicV"":""PD3472"",""sonicW"":""PD3473"",""heading"":""PD3480"",""rateX"":""PD3321"",""rateY"":""PD3322"",""rateZ"":""PD3323"",""accX"":""PD3475"",""accY"":""PD3476"",""accZ"":""PD3477"",""lat"":""CC_latitude""}",,,WINDTUR-VLN_L1,"The L1 windspeed data product WINDTUR-VLN_L1 from the FDCHP instrument, which collects 20 minutes of data every hour. The L1 data consists of these values less 30 seconds from both the beginning and end of each 12000 point dataset.",,,L1 -TO-DO,FDCHP,fdchp_a_windtur_up,fdchp_a_windtur_up,PD3718,function,"[""-obs"",""fdchp_a_time_L1""]",float32,,m s-1,-9999999,Wind Velocity - Vertical,4,,PFID192,"{""timestamp"":""PD7"",""sonicU"":""PD3471"",""sonicV"":""PD3472"",""sonicW"":""PD3473"",""heading"":""PD3480"",""rateX"":""PD3321"",""rateY"":""PD3322"",""rateZ"":""PD3323"",""accX"":""PD3475"",""accY"":""PD3476"",""accZ"":""PD3477"",""lat"":""CC_latitude""}",,,WINDTUR-VLU_L1,"The L1 windspeed data product WINDTUR-VLU_L1 from the FDCHP instrument, which collects 20 minutes of data every hour. The L1 data consists of these values less 30 seconds from both the beginning and end of each 12000 point dataset.",,,L1 -TO-DO,FDCHP,fdchp_a_windtur_west,fdchp_a_windtur_west,PD3719,function,"[""-obs"",""fdchp_a_time_L1""]",float32,,m s-1,-9999999,Wind Velocity - Westerly,4,,PFID193,"{""timestamp"":""PD7"",""sonicU"":""PD3471"",""sonicV"":""PD3472"",""sonicW"":""PD3473"",""heading"":""PD3480"",""rateX"":""PD3321"",""rateY"":""PD3322"",""rateZ"":""PD3323"",""accX"":""PD3475"",""accY"":""PD3476"",""accZ"":""PD3477"",""lat"":""CC_latitude""}",,,WINDTUR-VLW_L1,"The L1 windspeed data product WINDTUR-VLW_L1 from the FDCHP instrument, which collects 20 minutes of data every hour. The L1 data consists of these values less 30 seconds from both the beginning and end of each 12000 point dataset.",,,L1 -TO-DO,FDCHP,fdchp_a_fluxhot,fdchp_a_fluxhot,PD3720,function,"[""-obs"",""fdchp_a_time_L2""]",float32,,m s-1 * K,-9999999,Direct Covariance Flux of Heat,4,,PFID194,"{""timestamp"":""PD7"",""sonicU"":""PD3471"",""sonicV"":""PD3472"",""sonicW"":""PD3473"",""sonicT"":""PD3474"",""heading"":""PD3480"",""rateX"":""PD3321"",""rateY"":""PD3322"",""rateZ"":""PD3323"",""accX"":""PD3475"",""accY"":""PD3476"",""accZ"":""PD3477"",""lat"":""CC_latitude""}",,,FLUXHOT_L2,"FLUXHOT_L2, the sonic buoyancy flux, from the FDCHP instrument, which collects 20 minutes of data every hour. There is one FLUXHOT value calculated for each 20 minute dataset of 12000 data records.",,Science Data,L2 -TO-DO,FDCHP,fdchp_a_fluxmom_alongwind,fdchp_a_fluxmom_alongwind,PD3721,function,"[""-obs"",""fdchp_a_time_L2""]",float32,,m2 s-2,-9999999,Along-Wind Component of Momentum Flux,4,,PFID195,"{""timestamp"":""PD7"",""sonicU"":""PD3471"",""sonicV"":""PD3472"",""sonicW"":""PD3473"",""heading"":""PD3480"",""rateX"":""PD3321"",""rateY"":""PD3322"",""rateZ"":""PD3323"",""accX"":""PD3475"",""accY"":""PD3476"",""accZ"":""PD3477"",""lat"":""CC_latitude""}",,,FLUXMOM-U_L2,"FLUXMOM-U_L2, the along-wind component of the momentum flux, from the FDCHP instrument, which collects 20 minutes of data every hour. There is one FLUXMOM-U_L2 value calculated for each 20 minute dataset of 12000 data records.",,,L2 -TO-DO,FDCHP,fdchp_a_fluxmom_crosswind,fdchp_a_fluxmom_crosswind,PD3722,function,"[""-obs"",""fdchp_a_time_L2""]",float32,,m2 s-2,-9999999,Cross-Wind Component of Momentum Flux,4,,PFID196,"{""timestamp"":""PD7"",""sonicU"":""PD3471"",""sonicV"":""PD3472"",""sonicW"":""PD3473"",""heading"":""PD3480"",""rateX"":""PD3321"",""rateY"":""PD3322"",""rateZ"":""PD3323"",""accX"":""PD3475"",""accY"":""PD3476"",""accZ"":""PD3477"",""lat"":""CC_latitude""}",,,FLUXMOM-V_L2,"FLUXMOM-V_L2, the cross-wind component of the momentum flux, from the FDCHP instrument, which collects 20 minutes of data every hour. There is one FLUXMOM-V_L2 value calculated for each 20 minute dataset of 12000 data records.",,,L2 -TO-DO,FDCHP,fdchp_a_time_L1,fdchp_a_time_L1,PD3723,function,"[""-obs"",""fdchp_a_time_L1""]",float32,,s,-9999999,L1 Timestamps,4,,PFID197,"{""timestamp"":""PD7""}",,,TIME_L1-AUX,"The time metadata product TIME_L1-AUX associated with the L1 wind and temperature data products from the FDCHP instrument, which collects 20 minutes of data every hour. For each of the L1 data products, 30 seconds of data is stripped out from the beginning and end of each 20 minute, 12000 record dataset. The TIME_L1-AUX values are the remaining timestamps for each dataset.",,, -TO-DO,FDCHP,fdchp_a_time_L2,fdchp_a_time_L2,PD3724,function,"[""-obs"",""fdchp_a_time_L2""]",float32,,s,-9999999,L2 Timestamps,4,,PFID198,"{""timestamp"":""PD7""}",,,TIME_L2-AUX,"The time metadata product TIME_L2-AUX associated with the L2 flux data products from the FDCHP instrument. FDCHP collects 20 minutes of data every hour; for each of the L2 flux data products, one data value is calculated for each 20 minute dataset. The TIME_L2-AUX values are the median timestamps for each dataset.",,, TO-DO,PARAD,par_auv_biospherical_mobile,par_auv_biospherical_mobile,PD3726,function,,float32,,umol photons m-2 s-1 count-1,-1.00E+08,PAR Scaling Factor,4,,PFID90,"{""output"":""PD3462"",""dark_offset"":""CC_dark_offset"",""scale_wet"":""CC_scale_wet""}",OPTPARW,downwelling_photosynthetic_photon_flux_in_sea_water,OPTPARW_L1,The PAR scaling factor is a calibration parameter used in converting PAR digital voltage counts to scientific units.,Photosynthetically Active Radiation (400-700 nm) Scaling Factor,Science Data,L1 TO-DO,ZPLSC,zplsc_c_transmission_timestamp,zplsc_c_transmission_timestamp,PD3730,quantity,,float64,,1,-9999999,Timestamp,,,,,,,,Timestamp that indicates the date and time the data was transmitted by the unit.,,, TO-DO,ZPLSC,zplsc_c_phase,zplsc_c_phase,PD3731,quantity,,int16,,1,-32768,Phase,0,,,,,,,Phase (up to 12) used to acquire this profile data. A phase is a data collection sequence with a unique set of operating parameters.,,, diff --git a/csv/ParameterDictionary.csv b/csv/ParameterDictionary.csv index f237e0e..116f4ba 100644 --- a/csv/ParameterDictionary.csv +++ b/csv/ParameterDictionary.csv @@ -435,7 +435,7 @@ DOSTA_LN_AUV,DICT660,,dosta_ln_auv_instrument_recovered,"PD7,PD10,PD11,PD12,PD16 "CTDAV_N_AUV,CTDAV_NBOSI_AUV",DICT775,,ctdav_auv_data,"PD7,PD10,PD11,PD12,PD16,PD863,PD3430,PD3412,PD3413,PD3431,PD1276,PD3459,PD4,PD3,PD562,PD3460,PD3461,PD2,PD8097",PD7,,Science,Data Products,Replaces deprecated DICT661 and DICT662 PARAD_N_AUV,DICT663,,parad_n_auv_instrument,"PD7,PD10,PD11,PD12,PD16,PD863,PD3430,PD3412,PD3413,PD3431,PD1276,PD3462,PD3463,PD3464,PD3726",PD7,,Science,Data Products, PARAD_N_AUV,DICT664,,parad_n_auv_instrument_recovered,"PD7,PD10,PD11,PD12,PD16,PD863,PD3430,PD3412,PD3413,PD3431,PD1276,PD3462,PD3463,PD3464,PD3726",PD7,,Science,Data Products, -FDCHP_A,DICT665,,fdchp_a_instrument_recovered,"PD7,PD10,PD11,PD12,PD16,PD863,PD2612,PD3465,PD3466,PD3467,PD3468,PD3469,PD3470,PD3471,PD3472,PD3473,PD3474,PD3838,PD3839,PD3840,PD3475,PD3476,PD3477,PD3478,PD3479,PD3480,PD3481,PD3482,PD3716,PD3717,PD3718,PD3719,PD3720,PD3721,PD3722,PD3723,PD3724",PD7,,Science,Data Products, +FDCHP_A,DICT665,,fdchp_a_instrument_recovered,"PD7,PD10,PD11,PD12,PD16,PD863,PD2612,PD3465,PD3466,PD3467,PD3468,PD3469,PD3470,PD3471,PD3472,PD3473,PD3474,PD3838,PD3839,PD3840,PD3475,PD3476,PD3477,PD3478,PD3479,PD3480,PD3481,PD3482",PD7,,Science,Data Products, AUV_ENG,DICT666,,auv_eng_auv_imagenex_852,"PD7,PD10,PD11,PD12,PD16,PD863,PD3430,PD3412,PD3413,PD3431,PD1276,PD3491,PD3614,PD3493,PD1234,PD3494,PD3495,PD3496,PD3497,PD3498,PD3499,PD3500,PD3501,PD3502,PD3503,PD3504,PD3505",PD7,,Engineering,Echosounder Data Products, AUV_ENG,DICT667,,auv_eng_auv_imagenex_852_recovered,"PD7,PD10,PD11,PD12,PD16,PD863,PD3430,PD3412,PD3413,PD3431,PD1276,PD3491,PD3614,PD3493,PD1234,PD3494,PD3495,PD3496,PD3497,PD3498,PD3499,PD3500,PD3501,PD3502,PD3503,PD3504,PD3505",PD7,,Engineering,Echosounder Data Products, AUV_ENG,DICT668,,auv_eng_auv_digital_usbl,"PD7,PD10,PD11,PD12,PD16,PD863,PD3430,PD3412,PD3413,PD3506,PD3507,PD3508,PD3509,PD3510,PD3511,PD3512,PD3513,PD3514,PD3515,PD3516,PD3517,PD3518,PD3519,PD3520,PD3521,PD3522,PD3523,PD3431",PD7,,Engineering,Digital Data, @@ -570,4 +570,4 @@ VADCP_B,DICT789,VADCP-B,vadcp_b_config,"PD7,PD10,PD11,PD12,PD16,PD863,PD475,PD31 BOTPT,DICT790,,instrument_predicted_tide,"PD7,PD10,PD11,PD12,PD16,PD8191",PD7,,Science,Predicted Tide Data Product, PHSEN-GH,DICT791,,phsen_gh_instrument,"PD7,PD10,PD11,PD12,PD16,PD8198,PD8199,PD8200,PD4,PD8201,PD8202,PD2,PD3,PD1552,PD3460,PD8203,PD8204",PD7,,Science,Data Products, PLIMS,DICT792,,plims_a_hdr_engineering,"PD7,PD10,PD11,PD12,PD16,PD8233,PD8138,PD8142,PD8154,PD8234,PD8235,PD8236,PD8237,PD8238,PD8239,PD8240,PD8145,PD8146,PD8241,PD8242,PD8243,PD8244,PD8149,PD8150,PD8151,PD8152,PD8245,PD8246,PD8155,PD8157,PD8158,PD8247,PD8248,PD8249,PD8250,PD8251,PD8252,PD8253,PD8254,PD82455,PD8256,PD8159,PD8160,PD8161,PD8162,PD8257,PD8258,PD8259,PD8260",PD7,,Engineering,Metadata, -PLIMS,DICT793,,plims_a_adc_instrument,"PD7,PD10,PD11,PD12,PD16,PD8233,PD8205,PD8206,PD8207,PD8208,PD8209,PD8210,PD8211,PD8212,PD8213,PD8214,PD8215,PD8216,PD8217,PD8218,PD8219,PD8220",PD7,,Science,Data Products, \ No newline at end of file +PLIMS,DICT793,,plims_a_adc_instrument,"PD7,PD10,PD11,PD12,PD16,PD8233,PD8205,PD8206,PD8207,PD8208,PD8209,PD8210,PD8211,PD8212,PD8213,PD8214,PD8215,PD8216,PD8217,PD8218,PD8219,PD8220",PD7,,Science,Data Products, diff --git a/csv/ParameterFunctions.csv b/csv/ParameterFunctions.csv index 4635c56..56d74bd 100644 --- a/csv/ParameterFunctions.csv +++ b/csv/ParameterFunctions.csv @@ -224,19 +224,10 @@ BOTPT_A,PFID182,prs_botsflu_5minrate_BOTPT_A,prs_botsflu_5minrate,BOTPT,A,Python BOTPT_A,PFID183,prs_botsflu_10minrate_BOTPT_A,prs_botsflu_10minrate,BOTPT,A,PythonFunction,prs_botsflu_10minrate,ion_functions.data.prs_functions,"['timestamp', 'botpres']",,"Calculates the BOTSFLU data product 10MINRATE_L2, the mean seafloor uplift rate calculated using 10 minute backwards-looking 10 minute running mean depth data.",,, BOTPT_A,PFID184,prs_botsflu_time24h_BOTPT_A,prs_botsflu_time24h,BOTPT,A,PythonFunction,prs_botsflu_time24h,ion_functions.data.prs_functions,['time15s'],,Calculates the auxiliary BOTSFLU data product TIME24H-AUX. These are timestamps anchored at midnight which correspond to the time base for the BOTSFLU data products which are binned on a day's worth of data.,,, BOTPT_A,PFID185,prs_botsflu_daydepth_BOTPT_A,prs_botsflu_daydepth_from_15s_meandepth,BOTPT,A,PythonFunction,prs_botsflu_daydepth_from_15s_meandepth,ion_functions.data.prs_functions,"['time15s', 'meandepth']",,"Calculates the BOTSFLU data product DAYDEPTH_L2, de-tided bottom depth as a function of time (1 day bins).",,, -BOTPT_A,PFID186,prs_botsflu_4wkrate_BOTPT_A,prs_botsflu_4wkrate_from_daydepth,BOTPT,A,PythonFunction,prs_botsflu_4wkrate_from_daydepth,ion_functions.data.prs_functions,"['daydepth']",,"Calculates the BOTSFLU data product 4WKRATE_L2, the mean rate of seafloor change as calculated by 4-week backwards-looking linear regressions.",,, -BOTPT_A,PFID187,prs_botsflu_8wkrate_BOTPT_A,prs_botsflu_8wkrate_from_daydepth,BOTPT,A,PythonFunction,prs_botsflu_8wkrate_from_daydepth,ion_functions.data.prs_functions,"['daydepth']",,"Calculates the BOTSFLU data product 8WKRATE_L2, the mean rate of seafloor change as calculated by 8-week backwards-looking linear regressions.",,, +BOTPT_A,PFID186,prs_botsflu_4wkrate_BOTPT_A,prs_botsflu_4wkrate_from_daydepth,BOTPT,A,PythonFunction,prs_botsflu_4wkrate_from_daydepth,ion_functions.data.prs_functions,['daydepth'],,"Calculates the BOTSFLU data product 4WKRATE_L2, the mean rate of seafloor change as calculated by 4-week backwards-looking linear regressions.",,, +BOTPT_A,PFID187,prs_botsflu_8wkrate_BOTPT_A,prs_botsflu_8wkrate_from_daydepth,BOTPT,A,PythonFunction,prs_botsflu_8wkrate_from_daydepth,ion_functions.data.prs_functions,['daydepth'],,"Calculates the BOTSFLU data product 8WKRATE_L2, the mean rate of seafloor change as calculated by 8-week backwards-looking linear regressions.",,, BOTPT_A,PFID188,prs_botsflu_predtide_BOTPT_A,prs_botsflu_predtide,BOTPT,A,PythonFunction,prs_botsflu_predtide,ion_functions.data.prs_functions,['time'],,"Assigns tide values for the 3 BOTPT instrument sites about 500 km west of Astoria. When the input argument is the data product TIME15S, the output of this function will be the BOTSFLU data product BOTSFLU-PREDTIDE_L2.",,, BETA,PFID189,scale_it_All_All,scale_it,All,All,NumexprFunction,value*scaler,,"['value', 'scaler']",,Scale the value.,,, -FDCHP_A,PFID190,fdc_tmpatur_FDCHP_A,fdc_tmpatur,FDCHP,A,PythonFunction,fdc_tmpatur,ion_functions.data.fdc_functions,"['timestamp', 'sonicT']",,"Calculates the L1 temperature data product TMPATUR_L1 from the FDCHP instrument, which collects 20 minutes of data every hour. The L1 data consists of these values less 30 seconds from both the beginning and end of each 12000 point dataset.",,, -FDCHP_A,PFID191,fdc_windtur_north_FDCHP_A,fdc_windtur_north,FDCHP,A,PythonFunction,fdc_windtur_north,ion_functions.data.fdc_functions,"['timestamp', 'sonicU', 'sonicV', 'sonicW', 'heading', 'rateX', 'rateY', 'rateZ', 'accX', 'accY', 'accZ', 'lat']",,"Calculates the L1 windspeed data product WINDTUR-VLN_L1 from the FDCHP instrument, which collects 20 minutes of data every hour. The L1 data consists of these values less 30 seconds from both the beginning and end of each 12000 point dataset.",,, -FDCHP_A,PFID192,fdc_windtur_up_FDCHP_A,fdc_windtur_up,FDCHP,A,PythonFunction,fdc_windtur_up,ion_functions.data.fdc_functions,"['timestamp', 'sonicU', 'sonicV', 'sonicW', 'heading', 'rateX', 'rateY', 'rateZ', 'accX', 'accY', 'accZ', 'lat']",,"Calculates the L1 windspeed data product WINDTUR-VLU_L1 from the FDCHP instrument, which collects 20 minutes of data every hour. The L1 data consists of these values less 30 seconds from both the beginning and end of each 12000 point dataset.",,, -FDCHP_A,PFID193,fdc_windtur_west_FDCHP_A,fdc_windtur_west,FDCHP,A,PythonFunction,fdc_windtur_west,ion_functions.data.fdc_functions,"['timestamp', 'sonicU', 'sonicV', 'sonicW', 'heading', 'rateX', 'rateY', 'rateZ', 'accX', 'accY', 'accZ', 'lat']",,"Calculates the L1 windspeed data product WINDTUR-VLW_L1 from the FDCHP instrument, which collects 20 minutes of data every hour. The L1 data consists of these values less 30 seconds from both the beginning and end of each 12000 point dataset.",,, -FDCHP_A,PFID194,fdc_fluxhot_FDCHP_A,fdc_fluxhot,FDCHP,A,PythonFunction,fdc_fluxhot,ion_functions.data.fdc_functions,"['timestamp', 'sonicU', 'sonicV', 'sonicW', 'sonicT', 'heading', 'rateX', 'rateY', 'rateZ', 'accX', 'accY', 'accZ', 'lat']",,"Calculates FLUXHOT_L2, the sonic buoyancy flux, from the FDCHP instrument, which collects 20 minutes of data every hour. There is one FLUXHOT value calculated for each 20 minute dataset of 12000 data records.",,, -FDCHP_A,PFID195,fdc_fluxmom_alongwind_FDCHP_A,fdc_fluxmom_alongwind,FDCHP,A,PythonFunction,fdc_fluxmom_alongwind,ion_functions.data.fdc_functions,"['timestamp', 'sonicU', 'sonicV', 'sonicW', 'heading', 'rateX', 'rateY', 'rateZ', 'accX', 'accY', 'accZ', 'lat']",,"Calculates FLUXMOM-U_L2, the along-wind component of the momentum flux, from the FDCHP instrument, which collects 20 minutes of data every hour. There is one FLUXMOM-U_L2 value calculated for each 20 minute dataset of 12000 data records.",,, -FDCHP_A,PFID196,fdc_fluxmom_crosswind_FDCHP_A,fdc_fluxmom_crosswind,FDCHP,A,PythonFunction,fdc_fluxmom_crosswind,ion_functions.data.fdc_functions,"['timestamp', 'sonicU', 'sonicV', 'sonicW', 'heading', 'rateX', 'rateY', 'rateZ', 'accX', 'accY', 'accZ', 'lat']",,"Calculates FLUXMOM-V_L2, the cross-wind component of the momentum flux, from the FDCHP instrument, which collects 20 minutes of data every hour. There is one FLUXMOM-V_L2 value calculated for each 20 minute dataset of 12000 data records.",,, -FDCHP_A,PFID197,fdc_time_L1_FDCHP_A,fdc_time_L1,FDCHP,A,PythonFunction,fdc_time_L1,ion_functions.data.fdc_functions,['timestamp'],,"Calculates the time metadata product TIME_L1-AUX associated with the L1 wind and temperature data products from the FDCHP instrument, which collects 20 minutes of data every hour. For each of the L1 data products, 30 seconds of data is stripped out from the beginning and end of each 20 minute, 12000 record dataset. The TIME_L1-AUX values are the remaining timestamps for each dataset.",,, -FDCHP_A,PFID198,fdc_time_L2_FDCHP_A,fdc_time_L2,FDCHP,A,PythonFunction,fdc_time_L2,ion_functions.data.fdc_functions,['timestamp'],,"Calculates the time metadata product TIME_L2-AUX associated with the L2 flux data products from the FDCHP instrument. FDCHP collects 20 minutes of data every hour; for each of the L2 flux data products, one data value is calculated for each 20 minute dataset. The TIME_L2-AUX values are the median timestamps for each dataset.",,, DOSTA_D,PFID199,dosta_Topt_volt_to_degC_DOSTA_D,dosta_Topt_volt_to_degC,DOSTA,D,PythonFunction,dosta_Topt_volt_to_degC,ion_functions.data.do2_functions,['T_optode_volt'],,"Computes T_optode [degC], the DOSTA foil temperature as measured by its internal thermistor, from the analog output of a DOSTA Aanderaa Optode connected to a SBE CTD's 0-5 volt analog data channel.",,, DOSTA_D,PFID200,dosta_phase_volt_to_degree_DOSTA_D,dosta_phase_volt_to_degree,DOSTA,D,PythonFunction,dosta_phase_volt_to_degree,ion_functions.data.do2_functions,['phase_volt'],,"Computes the DOCONCS-DEG_L0 data product from DOCONCS-VLT_L0, the analog output of a DOSTA Aanderaa Optode connected to a SBE CTD's 0-5 volt analog data channel.",,, ADCP,PFID201,adcp_bin_depths_dapa_ADCP_PD0,adcp_bin_depths_dapa,ADCP,PD0,PythonFunction,adcp_bin_depths_dapa,ion_functions.data.adcp_functions,"['dist_first_bin', 'bin_size', 'num_bins', 'pressure', 'adcp_orientation', 'latitude']",,Calculates the center bin depths for PD0 and PD12 ADCP data. As defined in the Data Product Specification for Velocity Profile and Echo Intensity - DCN 1341-00750.,,, @@ -267,4 +258,4 @@ VADCP_B,PFID225,vadcp_b_beam_vertical_true_VADCP_B,vadcp_b_beam_vertical_true,VA PLIMS_A,PFID226,plims_a_hdr_science_look_time,plims_a_hdr_science_look_time,PLIMS,All,NumexprFunction,run_time-inhibit_time,,"['run_time','inhibit_time']",,Cumulative time spent capturing images during sampling period,,, PLIMS_A,PFID227,plims_a_hdr_science_flow_rate,plims_a_hdr_science_flow_rate,PLIMS,All,PythonFunction,plims_flow_rate,ion_functions.data.plims_functions,"['run_fast','run_fast_factor','sample_speed','sample_volume']",,Flow rate calculated from sample volume per syringe sampling speed,,, PLIMS_A,PFID228,plims_a_hdr_science_volume_analyzed,plims_a_hdr_science_volume_analyzed,PLIMS,All,NumexprFunction,look_time*flow_rate/60,,"['look_time','flow_rate']",,Volume of sample analyzed during the RunTime,,, -PLIMS_A,PFID229,plims_a_hdr_science_rois_per_ml,plims_a_hdr_science_rois_per_ml,PLIMS,All,NumexprFunction,roi_count/volume_analyzed,,"['roi_count','volume_analyzed']",,The number of ROIs recorded per mL of sample volume analyzed,,, \ No newline at end of file +PLIMS_A,PFID229,plims_a_hdr_science_rois_per_ml,plims_a_hdr_science_rois_per_ml,PLIMS,All,NumexprFunction,roi_count/volume_analyzed,,"['roi_count','volume_analyzed']",,The number of ROIs recorded per mL of sample volume analyzed,,, diff --git a/load_preload.py b/load_preload.py index ad38ba2..188d661 100755 --- a/load_preload.py +++ b/load_preload.py @@ -183,12 +183,10 @@ def process_parameters(session): create_or_update_parameter(session, parameter_id, csv_params[parameter_id], value_table_map, parameter=all_params.get(parameter_id)) - # Remove rows from the database for deleted Parameters. - for parameter_id in delete_params: - session.delete(all_params[parameter_id]) - session.commit() + return delete_params + def create_or_update_parameter_func(session, func_id, row, value_table_map, func=None): if func is None: @@ -223,11 +221,34 @@ def process_parameter_funcs(session): create_or_update_parameter_func(session, func_id, csv_functions[func_id], value_table_map, func=existing_functions.get(func_id)) - for func_id in delete_functions: - session.delete(existing_functions[func_id]) - session.commit() + return delete_functions + +def delete_parameters_and_parameter_funcs(session, parameter_ids, parameter_func_ids): + """ + Delete parameters and parameter functions from the database. + :param session: SQLAlchemy session + :param parameter_ids: List of parameter IDs to delete + :param parameter_func_ids: List of parameter function IDs to delete + """ + log.info('Delete {} parameters and {} parameter functions'.format(len(parameter_ids), len(parameter_func_ids))) + + # get parameters from list of ids + if parameter_ids: + params = session.query(Parameter).filter(Parameter.id.in_(parameter_ids)).all() + for param in params: + session.delete(param) + + # delete the associated parameter function entries + if parameter_func_ids: + param_funcs = session.query(ParameterFunction).filter(ParameterFunction.id.in_(parameter_func_ids)).all() + for func in param_funcs: + session.delete(func) + + if parameter_ids or parameter_func_ids: + session.commit() + def create_or_update_stream(session, stream_id, row, value_table_map, bin_sizes, stream=None): def get_it(value_map, this_row, name): @@ -444,8 +465,9 @@ def read_csv_data(): def update_db(session): process_nominal_depths(session) - process_parameter_funcs(session) - process_parameters(session) + param_funcs_to_delete = process_parameter_funcs(session) + params_to_delete = process_parameters(session) + delete_parameters_and_parameter_funcs(session, params_to_delete, param_funcs_to_delete) process_streams(session) process_stream_dependencies(session)