Index: tower_buoy/bin/meta_data/LSRB_conversions.table =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/LSRB_conversions.table (revision 7) @@ -1,0 +1,82 @@ +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#VAR_ID #CONSTANT_COEFFICIENTS #CONVERSION_FORMULA +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ATEMP 200, 10, -30 $a_temp*($v[0]/$v[1])+$v[2] +RH 200, 10 $r_hum*($v[0]/$v[1]) +PIRA 1.0295e-3,2.391e-4,1.568e-7,20000 1/($v[0]+$v[1]*(log($pir_case_t*$v[3]))+$v[2]*(log($pir_case_t*$v[3]))**3) +PIRB 1.0295e-3,2.391e-4,1.568e-7,20000 1/($v[0]+$v[1]*(log($pir_dome_t*$v[3]))+$v[2]*(log($pir_dome_t*$v[3]))**3) +PIRC 2000,.25,-2.5 ($pir_therm+$v[2])/($v[0]*$v[1]) +#Serial Number 33977F3 +PIR 3.58e-6,5.6697e-8 $pir_th/$v[0] + $v[1]*(($pir_ct)**4) +#Serial Number 33999F3 +PSP 8.32e-6,666.66,.25,-2.5 ($psp+$v[3])/($v[0]*$v[1]*$v[2]) +BARO 68.9475 $baro*$v[0] +#RAIN 21,50,20 $rain*($v[1]/($v[0]*$v[2])) +WSPDA 60 &avg_wind('spda') +#WDIRA 360 &avg_wind('dira')#Changed to 180 to account for wind _FROM_ +WDIRA 360 &avg_wind('dira',180) +WSPDB 60 &avg_wind('spdb') +#WDIRB 360 &avg_wind('dirb')#Changed to 180 to account for wind _FROM_ +WDIRB 360 &avg_wind('dirb',180) + +COMP1 0 &avg_wind('cmp1'); +COMP2 0 &avg_wind('cmp2'); + +COMP 0 &handle_comp(); +#COMP_DIR 0 $comp_dir +#COMP_PITCH 0 $comp_pitch +#COMP_ROLL 0 $comp_roll + +RAIN 0 &avg_rain('cumrain'); + +DISK1F .01 $disk1p*$v[0]*$disk1t +DISK1T 0 $disk1t +DISK2F .01 $disk2p*$v[0]*$disk2t +DISK2T 0 $disk2t +MEM1F .01 $mem1p*$v[0]*$mem1t +MEM1T 0 $mem1t +MEM2F .01 $mem2p*$v[0]*$mem2t +MEM2T 0 $mem2t + +GPSLAT .00001 $gps_lat*$v[0] +GPSLON -.0001 $gps_lon*$v[0] + + +#Variables that don't have any conversion but may have had some parsing... +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#GPS 0 $gps_string + +#RESET_TIME 0 $reset_time +#RESET_DIFF 0 $reset_diff +#BOOT 0 $boot_time +FILES 0 $num_files + +SAMPLE_LOOP 0 $read_time +CLOCK 0 $sample_loop + +LINK_VOLTS 0 $volts +LINK_AMPS 0 $amps +LINK_AMP_HRS 0 $amp_hrs +LINK_TEMP 0 $box_temp + +COND1 0 $cond1 +WTEMP1 0 $temp1 +PRESS1 0 $press1 +SAL1 0 $sal1 +DENS1 0 $dens1 + +COND2 0 $cond2 +WTEMP2 0 $temp2 +PRESS2 0 $press2 +SAL2 0 $sal2 +DENS2 0 $dens2 + + + +#ID 0 $tower_id +#SOFTWARE 0 $software_version +SAMPLE_INTERVAL 0 $sample_interval +NEWFILE_INTERVAL 0 $newfile_interval +#serial 0 $serial_string +#RLCAD 0 $rlc_string +#BBAD 0 $bnb_string Index: tower_buoy/bin/meta_data/LSRB_conversions.table.20060328 =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/LSRB_conversions.table.20060328 (revision 7) @@ -1,0 +1,77 @@ +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#VAR_ID #CONSTANT_COEFFICIENTS #CONVERSION_FORMULA +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ATEMP 100, 10, -30 $a_temp*($v[0]/$v[1])+$v[2] +RH 100, 10 $r_hum*($v[0]/$v[1]) +PIRA 1.0295e-3,2.391e-4,1.568e-7,10000 1/($v[0]+$v[1]*(log($pir_case_t*$v[3]))+$v[2]*(log($pir_case_t*$v[3]))**3) +PIRB 1.0295e-3,2.391e-4,1.568e-7,10000 1/($v[0]+$v[1]*(log($pir_dome_t*$v[3]))+$v[2]*(log($pir_dome_t*$v[3]))**3) +PIRC 2000 $pir_therm/$v[0] +#Serial Number 33976F3 +PIR 3.59e-6,5.6697e-8 $pir_th/$v[0] + $v[1]*(($pir_ct)**4) +#Serial Number 33998F3 +PSP 8.82e-6,666.66 $psp/($v[0]*$v[1]) +BARO 68.9475 $baro*$v[0] +RAIN 21,50,20 $rain*($v[1]/($v[0]*$v[2])) +WSPDA 60 &avg_wind('spda') +#WDIRA 360 &avg_wind('dira')#Changed to 180 to account for wind _FROM_ +WDIRA 360 &avg_wind('dira',180) +WSPDB 60 &avg_wind('spdb') +#WDIRB 360 &avg_wind('dirb')#Changed to 180 to account for wind _FROM_ +WDIRB 360 &avg_wind('dirb',180) + +COMP1 0 &avg_wind('cmp1'); +COMP2 0 &avg_wind('cmp2'); + +COMP 0 ??? +COMP_DIR 0 $comp_dir +COMP_PITCH 0 $comp_pitch +COMP_ROLL 0 $comp_roll + +RAIN 0 &avg_rain('cumrain'); + +DISK1F .01 $disk1p*$v[0]*$disk1t +DISK1T 0 $disk1t +DISK2F .01 $disk2p*$v[0]*$disk2t +DISK2T 0 $disk2t +MEM1F .01 $mem1p*$v[0]*$mem1t +MEM1T 0 $mem1t +MEM2F .01 $mem2p*$v[0]*$mem2t +MEM2T 0 $mem2t + +#Variables that don't have any conversion but may have had some parsing... +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#GPS 0 $gps_string +#RESET_TIME 0 $reset_time +#RESET_DIFF 0 $reset_diff +#BOOT 0 $boot_time +FILES 0 $num_files + +SAMPLE_LOOP 0 $read_time +CLOCK 0 $sample_loop + +LINK_VOLTS 0 $volts +LINK_AMPS 0 $amps +LINK_AMP_HRS 0 $amp_hrs +LINK_TEMP 0 $box_temp + +COND1 0 $cond1 +WTEMP1 0 $temp1 +PRESS1 0 $press1 +SAL1 0 $sal1 +DENS1 0 $dens1 + +COND2 0 $cond2 +WTEMP2 0 $temp2 +PRESS2 0 $press2 +SAL2 0 $sal2 +DENS2 0 $dens2 + + + +#ID 0 $tower_id +#SOFTWARE 0 $software_version +SAMPLE_INTERVAL 0 $sample_interval +NEWFILE_INTERVAL 0 $newfile_interval +#serial 0 $serial_string +#RLCAD 0 $rlc_string +#BBAD 0 $bnb_string Index: tower_buoy/bin/meta_data/R4_conversions.table =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/R4_conversions.table (revision 7) @@ -1,0 +1,66 @@ +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#VAR_ID #CONSTANT_COEFFICIENTS #CONVERSION_FORMULA +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ATEMP 100, 10, -30 $a_temp*($v[0]/$v[1])+$v[2] +RH 100, 10 $r_hum*($v[0]/$v[1]) +PIRA 1.0295e-3,2.391e-4,1.568e-7,10000 1/($v[0]+$v[1]*(log($pir_case_t*$v[3]))+$v[2]*(log($pir_case_t*$v[3]))**3) +PIRB 1.0295e-3,2.391e-4,1.568e-7,10000 1/($v[0]+$v[1]*(log($pir_dome_t*$v[3]))+$v[2]*(log($pir_dome_t*$v[3]))**3) +PIRC 2000 $pir_therm/$v[0] +#Serial Number 33976F3 +PIR 3.59e-6,5.6697e-8 $pir_th/$v[0] + $v[1]*(($pir_ct)**4) +#Serial Number 33998F3 +PSP 8.82e-6,666.66 $psp/($v[0]*$v[1]) +BARO 68.9475 $baro*$v[0] +RAIN 21,50,20 $rain*($v[1]/($v[0]*$v[2])) +WSPDA 60 &avg_wind('spda') +WDIRA 360 &avg_wind('dira') +WSPDB 60 &avg_wind('spdb'); +WDIRB 360 &avg_wind('dirb'); + +DISK1F .01 $disk1p*$v[0]*$disk1t +DISK1T 0 $disk1t +DISK2F .01 $disk2p*$v[0]*$disk2t +DISK2T 0 $disk2t +MEM1F .01 $mem1p*$v[0]*$mem1t +MEM1T 0 $mem1t +MEM2F .01 $mem2p*$v[0]*$mem2t +MEM2T 0 $mem2t + + +#WSPDA 60 &average_wind('a','spd'); +#WDIRA 360 &average_wind('a','dir',-31); +#WSPDA 60 $wi_spd_a*$v[0] +#WDIRA 360 $wi_dir_a*$v[0] +#WSPDA 60 (@wind_spd_a)*$v[0]/30 +#WDIRA 360 (@wind_dir_a)*$v[0]/30 +#WUA .0174533 (@wind_spd_a)*sin(@wind_dir_a*$v[0]); +#WVA .0174533 (@wind_spd_a)*cos(@wind_dir_a*$v[0]); + +#WSPDB 60 $wi_spd_b*$v[0] +#WDIRB 360 $wi_dir_b*$v[0] +#WSPDB 60 &average_wind('b','spd'); +#WDIRB 360 &average_wind('b','dir',-31); + +#Variables that don't have any conversion but may have had some parsing... +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#GPS 0 $gps_string +#RESET_TIME 0 $reset_time +#RESET_DIFF 0 $reset_diff +#BOOT 0 $boot_time +SAMPLE_LOOP 0 $read_time +CLOCK 0 $sample_loop + + +LINK_VOLTS 0 $volts +LINK_AMPS 0 $amps +LINK_AMP_HRS 0 $amp_hrs +LINK_TEMP 0 $box_temp + + +#ID 0 $tower_id +#SOFTWARE 0 $software_version +SAMPLE_INTERVAL 0 $sample_interval +NEWFILE_INTERVAL 0 $newfile_interval +#serial 0 $serial_string +#RLCAD 0 $rlc_string +#BBAD 0 $bnb_string Index: tower_buoy/bin/meta_data/R4_conversions.table_2005_02_19 =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/R4_conversions.table_2005_02_19 (revision 7) @@ -1,0 +1,68 @@ +### Valid for data before 2005.02.19 ### + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#VAR_ID #CONSTANT_COEFFICIENTS #CONVERSION_FORMULA +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ATEMP 100, 10, -30 $a_temp*($v[0]/$v[1])+$v[2] +RH 100, 10 $r_hum*($v[0]/$v[1]) +PIRA 1.0295e-3,2.391e-4,1.568e-7,10000 1/($v[0]+$v[1]*(log($pir_case_t*$v[3]))+$v[2]*(log($pir_case_t*$v[3]))**3) +PIRB 1.0295e-3,2.391e-4,1.568e-7,10000 1/($v[0]+$v[1]*(log($pir_dome_t*$v[3]))+$v[2]*(log($pir_dome_t*$v[3]))**3) +PIRC 2000 $pir_therm/$v[0] +#Serial Number 33976F3 +PIR 3.59e-6,5.6697e-8 $pir_th/$v[0] + $v[1]*(($pir_ct)**4) +#Serial Number 33998F3 +PSP 8.82e-6,666.66 $psp/($v[0]*$v[1]) +BARO 68.9475 $baro*$v[0] +RAIN 21,50,20 $rain*($v[1]/($v[0]*$v[2])) +WSPDA 60 &avg_wind('spda') +WDIRA 360 &avg_wind('dira',-26) +WSPDB 60 &avg_wind('spdb'); +WDIRB 360 &avg_wind('dirb',-26); + +DISK1F .01 $disk1p*$v[0]*$disk1t +DISK1T 0 $disk1t +DISK2F .01 $disk2p*$v[0]*$disk2t +DISK2T 0 $disk2t +MEM1F .01 $mem1p*$v[0]*$mem1t +MEM1T 0 $mem1t +MEM2F .01 $mem2p*$v[0]*$mem2t +MEM2T 0 $mem2t + + +#WSPDA 60 &average_wind('a','spd'); +#WDIRA 360 &average_wind('a','dir',-31); +#WSPDA 60 $wi_spd_a*$v[0] +#WDIRA 360 $wi_dir_a*$v[0] +#WSPDA 60 (@wind_spd_a)*$v[0]/30 +#WDIRA 360 (@wind_dir_a)*$v[0]/30 +#WUA .0174533 (@wind_spd_a)*sin(@wind_dir_a*$v[0]); +#WVA .0174533 (@wind_spd_a)*cos(@wind_dir_a*$v[0]); + +#WSPDB 60 $wi_spd_b*$v[0] +#WDIRB 360 $wi_dir_b*$v[0] +#WSPDB 60 &average_wind('b','spd'); +#WDIRB 360 &average_wind('b','dir',-31); + +#Variables that don't have any conversion but may have had some parsing... +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#GPS 0 $gps_string +#RESET_TIME 0 $reset_time +#RESET_DIFF 0 $reset_diff +#BOOT 0 $boot_time +SAMPLE_LOOP 0 $read_time +CLOCK 0 $sample_loop + + +LINK_VOLTS 0 $volts +LINK_AMPS 0 $amps +LINK_AMP_HRS 0 $amp_hrs +LINK_TEMP 0 $box_temp + + +#ID 0 $tower_id +#SOFTWARE 0 $software_version +SAMPLE_INTERVAL 0 $sample_interval +NEWFILE_INTERVAL 0 $newfile_interval +#serial 0 $serial_string +#RLCAD 0 $rlc_string +#BBAD 0 $bnb_string Index: tower_buoy/bin/meta_data/R4_sensor.table =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/R4_sensor.table (revision 7) @@ -1,0 +1,21 @@ +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#VAR_ID #sensor height #sensor sn? +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +PIR 18 m +PSP 18 m +ATEMP 19 m +BARO 19 m +RAIN 19 m + +WSPDA 35 m +WDIRA 35 m +WEASTA 35 m +WNORTHA 35 m +WGSTA 35 m + +WSPDB 35 m +WDIRB 35 m +WEASTB 35 m +WNORTHB 35 m +WGSTB 35 m Index: tower_buoy/bin/meta_data/T1_conversions.table =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/T1_conversions.table (revision 7) @@ -1,0 +1,52 @@ +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#VAR_ID #CONSTANT_COEFFICIENTS #CONVERSION_FORMULA +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ATEMP 100, 10, -30 $a_temp*($v[0]/$v[1])+$v[2] +RH 100, 10 $r_hum*($v[0]/$v[1]) +PIRA 1.0295e-3,2.391e-4,1.568e-7,10000 1/($v[0]+$v[1]*(log($pir_case_t*$v[3]))+$v[2]*(log($pir_case_t*$v[3]))**3) +PIRB 1.0295e-3,2.391e-4,1.568e-7,10000 1/($v[0]+$v[1]*(log($pir_dome_t*$v[3]))+$v[2]*(log($pir_dome_t*$v[3]))**3) +PIRC 2000 $pir_therm/$v[0] +#Serial Number 33496F3 +PIR 4.63e-6,5.6697e-8 $pir_th/$v[0] + $v[1]*(($pir_ct)**4) +#Serial Number 33480F3 +PSP 9.58e-6,666.66 $psp/($v[0]*$v[1]) +BARO 68.9475 $baro*$v[0] +RAIN 21,50,20 $rain*($v[1]/($v[0]*$v[2])) +WSPDA 60 &average_wind('a','spd'); +WDIRA 360 &average_wind('a','dir',0); +WSPDB 60 &average_wind('n','spd'); #There is no B wind package! +WDIRB 360 &average_wind('n','dir',0); + +DISK1F .01 $disk1p*$v[0]*$disk1t +DISK1T 0 $disk1t +DISK2F .01 $disk2p*$v[0]*$disk2t +DISK2T 0 $disk2t +MEM1F .01 $mem1p*$v[0]*$mem1t +MEM1T 0 $mem1t +MEM2F .01 $mem2p*$v[0]*$mem2t +MEM2T 0 $mem2t + +#Variables that don't have any conversion but may have had some parsing... +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#GPS 0 $gps_string +#RESET_TIME 0 $reset_time +#RESET_DIFF 0 $reset_diff +#BOOT 0 $boot_time +#SAMPLE_LOOP 0 $sample_loop +SAMPLE_LOOP 0 $read_time +CLOCK 0 $sample_loop + + +LINK_VOLTS 0 $volts +LINK_AMPS 0 $amps +LINK_AMP_HRS 0 $amp_hrs +LINK_TEMP 0 $box_temp + + +#ID 0 $tower_id +#SOFTWARE 0 $software_version +SAMPLE_INTERVAL 0 $sample_interval +NEWFILE_INTERVAL 0 $newfile_interval +#serial 0 $serial_string +#RLCAD 0 $rlc_string +#BBAD 0 $bnb_string Index: tower_buoy/bin/meta_data/conversions.table =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/conversions.table (revision 7) @@ -1,0 +1,54 @@ +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#VAR_ID #CONSTANT_COEFFICIENTS #CONVERSION_FORMULA +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ATEMP 100, 10, -30 $a_temp*($v[0]/$v[1])+$v[2] +RH 100, 10 $r_hum*($v[0]/$v[1]) +PIRA 1.0295e-3,2.391e-4,1.568e-7,10000 1/($v[0]+$v[1]*(log($pir_case_t*$v[3]))+$v[2]*(log($pir_case_t*$v[3]))**3) +PIRB 1.0295e-3,2.391e-4,1.568e-7,10000 1/($v[0]+$v[1]*(log($pir_dome_t*$v[3]))+$v[2]*(log($pir_dome_t*$v[3]))**3) +PIRC 2000 $pir_therm/$v[0] +PIR 4.63e-6,5.6697e-8 $pir_th/$v[0] + $v[1]*(($pir_ct)**4) +PSP 9.58e-6,666.66 $psp/($v[0]*$v[1]) +BARO 68.9475 $baro*$v[0] +RAIN 21,50 $rain*($v[1]/$v[0]) +WSPDA 60 $wi_spd_a*$v[0] +WDIRA 360 $wi_dir_a*$v[0] +#WSPDA 60 (@wind_spd_a)*$v[0]/30 +#WDIRA 360 (@wind_dir_a)*$v[0]/30 +#WUA .0174533 (@wind_spd_a)*sin(@wind_dir_a*$v[0]); +#WVA .0174533 (@wind_spd_a)*cos(@wind_dir_a*$v[0]); + +WSPDB 60 $wi_spd_b*$v[0] +WDIRB 360 $wi_dir_b*$v[0] + +DISK1F .01 $disk1p*$v[0]*$disk1t +DISK1T 0 $disk1t +DISK2F .01 $disk2p*$v[0]*$disk2t +DISK2T 0 $disk2t +MEM1F .01 $mem1p*$v[0]*$mem1t +MEM1T 0 $mem1t +MEM2F .01 $mem2p*$v[0]*$mem2t +MEM2T 0 $mem2t + +#Variables that don't have any conversion but may have had some parsing... +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#GPS 0 $gps_string +#RESET_TIME 0 $reset_time +#RESET_DIFF 0 $reset_diff +#BOOT 0 $boot_time +#SAMPLE_LOOP 0 $sample_loop +CLOCK 0 $sample_loop + + +LINK_VOLTS 0 $volts +LINK_AMPS 0 $amps +LINK_AMP_HRS 0 $amp_hrs +LINK_TEMP 0 $box_temp + + +#ID 0 $tower_id +#SOFTWARE 0 $software_version +SAMPLE_INTERVAL 0 $sample_interval +NEWFILE_INTERVAL 0 $newfile_interval +#serial 0 $serial_string +#RLCAD 0 $rlc_string +#BBAD 0 $bnb_string Index: tower_buoy/bin/meta_data/globals.table =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/globals.table (revision 7) @@ -1,0 +1,39 @@ +#%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#GLOBAL_ATT_NAME #FORMAT #VALUE +#%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +title CHAR "UNC Tower Data from $tower_id" +institution CHAR "NCCOOS" +institution_url CHAR "http://nccoos.unc.edu" +institution_dods_url CHAR "http://nccoos.unc.edu" +metadata_url CHAR "N/A" +references CHAR "N/A" +contact CHAR "hseim\@email.unc.edu" +source CHAR "coastal observation" +history CHAR "N/A" +comment CHAR "N/A" + +#Conventions +Conventions CHAR "CF-1.0" +format CHAR "SEA-COOS RT" +seacoos_rt_version CHAR "2.0" + +#Platform info +platform_code CHAR "$tower_id" +format_category_code CHAR "fixed-point" +institution_code CHAR "nccoos" + +#Package info +data_type CHAR "surface meteorological" +instrument_code CHAR "N/A" +package_code CHAR "met" + +#Timeframe of Data +start_date CHAR "N/A" +end_date CHAR "N/A" +release_date CHAR "N/A" +creation_date CHAR "N/A" +modification_date CHAR "N/A" +process_level CHAR "processed data" + +_FillValue FLOAT -9999 + Index: tower_buoy/bin/meta_data/locations.table =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/locations.table (revision 7) @@ -1,0 +1,7 @@ +#%%%%%%%%%#%%%%%%%%%#%%%%%%%%% +#Tower ID #Latitude #Longitude +#%%%%%%%%%#%%%%%%%%%#%%%%%%%%% +T1 36.000 -79.000 +R4 30.800 -80.316 +LSRB 34.300 -76.400 + Index: tower_buoy/bin/meta_data/meta_data.pm =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/meta_data.pm (revision 7) @@ -1,0 +1,246 @@ +#meta_data.pm +#Time-stamp: <2005-03-15 10:47:56 lstearns> +# +#Abstract: This module will read in tables of tower related meta data +# and output hash arrays of the information based on param id. Hacked +# together from the subroutine in tower_parse.perl and perl_defs.pm, +# a piece of code from Brian Blanton (Thanks Brian!!). + +# perl defs and subroutines common to quoddy nc/fc runs +# v11/07/2001 B.O.B. +# v02/09/2002 B.O.B. to work out of dmf +# v06/04/2002 B.O.B. added initial da stuff +# v19/08/2002 B.O.B. fixes for changes to "edu" from "com" +# v13/09/2002 B.O.B. added truxton stuff +# v13/12/2002 B.O.B. version for casco4b inclusion/ ssh assim +# vxx/09/2003 B.O.B. modified for SEACOOS +# v15/02/2004 B.O.B. turned into perl package provider (seacoos_sab_defs) + + +package meta_data; # assumes seacoos_sab_defs.pm + +use strict; +use warnings; +use vars qw(); + + +BEGIN{ + use Exporter (); + + our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); + + $VERSION="1.0"; + + @ISA = qw(Exporter); + + @EXPORT = qw( + %parse_info %parse_output + %T1_conversion_coeff %T1_conversion_formula + %LSRB_conversion_coeff %LSRB_conversion_formula + %R4_conversion_coeff %R4_conversion_formula + %conversion_coeff %conversion_formula + %range %precision %derived %units + %format %long_name %standard_name + %description %sub_vars %dimensions + %global_format %global_value + %tower_lon %tower_lat + @vars @globals + ); + + @EXPORT_OK=(); +} + + +our(%parse_info,%parse_output, + %conversion_coeff,%conversion_formula, + %T1_conversion_coeff,%T1_conversion_formula, + %LSRB_conversion_coeff,%LSRB_conversion_formula, + %R4_conversion_coeff,%R4_conversion_formula, + %range,%precision,%derived,%units, + %format,%long_name,%standard_name, + %description,%sub_vars,%dimensions, + %global_format,%global_value, + %tower_lon,%tower_lat, + @vars,@globals + ); + +my($param_id,$parse_info,$parse_output, + $conversion_coeff,$conversion_formula, + $range,$precision,$derived,$units, + $format,$long_name,$standard_name, + $description,$sub_vars,@sub_vars, + $dimensions,$meta_data_dir, + $g_a_format,$g_a_value,$g_a_name, + $tower_id,$tower_lon,$tower_lat + ); + +#$meta_data_dir = '/afs/isis.unc.edu/depts/marine/workspace/hseim/'. +# 'sablam4/lstearns/perl/test_nemo/meta_data/'; +$meta_data_dir = '/opt/local/seacoos/bin/meta_data/'; + +###################################################################### +### Initialize Info ################################################## +#sub initialize_info { + +#$meta_data_dir = "/afs/isis.unc.edu/depts/marine/workspace/hseim/". +# "sablam3/seacoos/meta_data/"; + #This section is fairly consistant, in fact I'd like to pull it out + #and put it in a seperate script that gets loaded. This is to + #read in all of the tables of information that relate to parsing, + #conversion, and ancillary information about all of the variables. + + #################################################################### + # Read Parsing Information Table + open(PARSING_INFO,"${meta_data_dir}parse.table"); + + #Loop through the lines of the file + while () { + #Get rid of the carriage return. + chop; + + #Ignore comments, that is, any line starting with a '#' character + #This is done by setting a comment line to an empty line + $_=~s/^^\#.*//; + + #Consider only non-empty lines + if ($_) { + #Split lines of the table using 2 or more spaces (which + #allows for single spaces in the entries) + ($param_id,$parse_info,$parse_output) = split('\s{2,}'); + + #Store information in hash arrays with the param id as the key + $parse_info{$param_id}=$parse_info; + $parse_output{$param_id}=$parse_output; + } + } + close(PARSING_INFO); + + #################################################################### + # Read Conversions Table + open(T1_CONVERSION_INFO,"${meta_data_dir}T1_conversions.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($param_id,$conversion_coeff,$conversion_formula) = split('\s{2,}'); + $T1_conversion_coeff{$param_id}=$conversion_coeff; + $T1_conversion_formula{$param_id}=$conversion_formula; + } + } + close(T1_CONVERSION_INFO); + + #################################################################### + # Read Conversions Table + open(LSRB_CONVERSION_INFO,"${meta_data_dir}LSRB_conversions.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($param_id,$conversion_coeff,$conversion_formula) = split('\s{2,}'); + $LSRB_conversion_coeff{$param_id}=$conversion_coeff; + $LSRB_conversion_formula{$param_id}=$conversion_formula; + } + } + close(LSRB_CONVERSION_INFO); + + #################################################################### + # Read Conversions Table + open(R4_CONVERSION_INFO,"${meta_data_dir}R4_conversions.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($param_id,$conversion_coeff,$conversion_formula) = split('\s{2,}'); + $R4_conversion_coeff{$param_id}=$conversion_coeff; + $R4_conversion_formula{$param_id}=$conversion_formula; + } + } + close(R4_CONVERSION_INFO); + + #################################################################### + # Read Conversions Table + open(CONVERSION_INFO,"${meta_data_dir}conversions.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($param_id,$conversion_coeff,$conversion_formula) = split('\s{2,}'); + $conversion_coeff{$param_id}=$conversion_coeff; + $conversion_formula{$param_id}=$conversion_formula; + } + } + close(CONVERSION_INFO); + + #################################################################### + # Read Variables Table + open(VARIABLE_INFO,"${meta_data_dir}variable.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($param_id,$range,$precision,$derived,$units,$format,$dimensions, + $long_name,$standard_name,$description) = split('\s{2,}'); + $range{$param_id}=$range; + $precision{$param_id}=$precision; + $derived{$param_id}=$derived; + $units{$param_id}=$units; + $format{$param_id} = $format; + $dimensions{$param_id} = $dimensions; + $long_name{$param_id}=$long_name; + $standard_name{$param_id}=$standard_name; + $description{$param_id}=$description; + push(@vars,"$param_id"); + } + } + close(VARIABLE_INFO); + + #################################################################### + # Read Sub_Vars Table + open(SUB_VAR_INFO,"${meta_data_dir}subvars.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($param_id,$sub_vars) = split('\s{2,}'); + @sub_vars = split(',',$sub_vars); + @{$sub_vars{$param_id}}=@sub_vars; + } + } + close(SUB_VAR_INFO); + + #################################################################### + # Read Globals Table + open(GLOBAL_INFO,"${meta_data_dir}globals.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($g_a_name,$g_a_format,$g_a_value) = split('\s{2,}'); + $global_format{$g_a_name}=$g_a_format; + $global_value{$g_a_name}=$g_a_value; + push(@globals,"$g_a_name"); + + } + } + close(GLOBAL_INFO); + + #################################################################### + # Read Locations Table + open(LOCATION_INFO,"${meta_data_dir}locations.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($tower_id,$tower_lat,$tower_lon) = split('\s{2,}'); + $tower_lat{$tower_id}=$tower_lat; + $tower_lon{$tower_id}=$tower_lon; + } + } + close(LOCATION_INFO); + +#} + + + +1; + Index: tower_buoy/bin/meta_data/meta_data_test.pm =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/meta_data_test.pm (revision 7) @@ -1,0 +1,246 @@ +#meta_data.pm +#Time-stamp: <2005-08-06 18:17:28 lstearns> +# +#Abstract: This module will read in tables of tower related meta data +# and output hash arrays of the information based on param id. Hacked +# together from the subroutine in tower_parse.perl and perl_defs.pm, +# a piece of code from Brian Blanton (Thanks Brian!!). + +# perl defs and subroutines common to quoddy nc/fc runs +# v11/07/2001 B.O.B. +# v02/09/2002 B.O.B. to work out of dmf +# v06/04/2002 B.O.B. added initial da stuff +# v19/08/2002 B.O.B. fixes for changes to "edu" from "com" +# v13/09/2002 B.O.B. added truxton stuff +# v13/12/2002 B.O.B. version for casco4b inclusion/ ssh assim +# vxx/09/2003 B.O.B. modified for SEACOOS +# v15/02/2004 B.O.B. turned into perl package provider (seacoos_sab_defs) + + +package meta_data; # assumes seacoos_sab_defs.pm + +use strict; +use warnings; +use vars qw(); + + +BEGIN{ + use Exporter (); + + our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); + + $VERSION="1.0"; + + @ISA = qw(Exporter); + + @EXPORT = qw( + %parse_info %parse_output + %T1_conversion_coeff %T1_conversion_formula + %LSRB_conversion_coeff %LSRB_conversion_formula + %R4_conversion_coeff %R4_conversion_formula + %conversion_coeff %conversion_formula + %range %precision %derived %units + %format %long_name %standard_name + %description %sub_vars %dimensions + %global_format %global_value + %tower_lon %tower_lat + @vars @globals + ); + + @EXPORT_OK=(); +} + + +our(%parse_info,%parse_output, + %conversion_coeff,%conversion_formula, + %T1_conversion_coeff,%T1_conversion_formula, + %LSRB_conversion_coeff,%LSRB_conversion_formula, + %R4_conversion_coeff,%R4_conversion_formula, + %range,%precision,%derived,%units, + %format,%long_name,%standard_name, + %description,%sub_vars,%dimensions, + %global_format,%global_value, + %tower_lon,%tower_lat, + @vars,@globals + ); + +my($param_id,$parse_info,$parse_output, + $conversion_coeff,$conversion_formula, + $range,$precision,$derived,$units, + $format,$long_name,$standard_name, + $description,$sub_vars,@sub_vars, + $dimensions,$meta_data_dir, + $g_a_format,$g_a_value,$g_a_name, + $tower_id,$tower_lon,$tower_lat + ); + +#$meta_data_dir = '/afs/isis.unc.edu/depts/marine/workspace/hseim/'. +# 'sablam4/lstearns/perl/test_nemo/meta_data/'; +$meta_data_dir = '/opt/local/seacoos/bin/meta_data/'; + +###################################################################### +### Initialize Info ################################################## +#sub initialize_info { + +#$meta_data_dir = "/afs/isis.unc.edu/depts/marine/workspace/hseim/". +# "sablam3/seacoos/meta_data/"; + #This section is fairly consistant, in fact I'd like to pull it out + #and put it in a seperate script that gets loaded. This is to + #read in all of the tables of information that relate to parsing, + #conversion, and ancillary information about all of the variables. + + #################################################################### + # Read Parsing Information Table + open(PARSING_INFO,"${meta_data_dir}parse_test.table"); + + #Loop through the lines of the file + while () { + #Get rid of the carriage return. + chop; + + #Ignore comments, that is, any line starting with a '#' character + #This is done by setting a comment line to an empty line + $_=~s/^^\#.*//; + + #Consider only non-empty lines + if ($_) { + #Split lines of the table using 2 or more spaces (which + #allows for single spaces in the entries) + ($param_id,$parse_info,$parse_output) = split('\s{2,}'); + + #Store information in hash arrays with the param id as the key + $parse_info{$param_id}=$parse_info; + $parse_output{$param_id}=$parse_output; + } + } + close(PARSING_INFO); + + #################################################################### + # Read Conversions Table + open(T1_CONVERSION_INFO,"${meta_data_dir}T1_conversions.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($param_id,$conversion_coeff,$conversion_formula) = split('\s{2,}'); + $T1_conversion_coeff{$param_id}=$conversion_coeff; + $T1_conversion_formula{$param_id}=$conversion_formula; + } + } + close(T1_CONVERSION_INFO); + + #################################################################### + # Read Conversions Table + open(LSRB_CONVERSION_INFO,"${meta_data_dir}LSRB_conversions.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($param_id,$conversion_coeff,$conversion_formula) = split('\s{2,}'); + $LSRB_conversion_coeff{$param_id}=$conversion_coeff; + $LSRB_conversion_formula{$param_id}=$conversion_formula; + } + } + close(LSRB_CONVERSION_INFO); + + #################################################################### + # Read Conversions Table + open(R4_CONVERSION_INFO,"${meta_data_dir}R4_conversions.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($param_id,$conversion_coeff,$conversion_formula) = split('\s{2,}'); + $R4_conversion_coeff{$param_id}=$conversion_coeff; + $R4_conversion_formula{$param_id}=$conversion_formula; + } + } + close(R4_CONVERSION_INFO); + + #################################################################### + # Read Conversions Table + open(CONVERSION_INFO,"${meta_data_dir}conversions.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($param_id,$conversion_coeff,$conversion_formula) = split('\s{2,}'); + $conversion_coeff{$param_id}=$conversion_coeff; + $conversion_formula{$param_id}=$conversion_formula; + } + } + close(CONVERSION_INFO); + + #################################################################### + # Read Variables Table + open(VARIABLE_INFO,"${meta_data_dir}variable.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($param_id,$range,$precision,$derived,$units,$format,$dimensions, + $long_name,$standard_name,$description) = split('\s{2,}'); + $range{$param_id}=$range; + $precision{$param_id}=$precision; + $derived{$param_id}=$derived; + $units{$param_id}=$units; + $format{$param_id} = $format; + $dimensions{$param_id} = $dimensions; + $long_name{$param_id}=$long_name; + $standard_name{$param_id}=$standard_name; + $description{$param_id}=$description; + push(@vars,"$param_id"); + } + } + close(VARIABLE_INFO); + + #################################################################### + # Read Sub_Vars Table + open(SUB_VAR_INFO,"${meta_data_dir}subvars.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($param_id,$sub_vars) = split('\s{2,}'); + @sub_vars = split(',',$sub_vars); + @{$sub_vars{$param_id}}=@sub_vars; + } + } + close(SUB_VAR_INFO); + + #################################################################### + # Read Globals Table + open(GLOBAL_INFO,"${meta_data_dir}globals.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($g_a_name,$g_a_format,$g_a_value) = split('\s{2,}'); + $global_format{$g_a_name}=$g_a_format; + $global_value{$g_a_name}=$g_a_value; + push(@globals,"$g_a_name"); + + } + } + close(GLOBAL_INFO); + + #################################################################### + # Read Locations Table + open(LOCATION_INFO,"${meta_data_dir}locations.table"); + while () { + chop; + $_=~s/^\#.*//; + if ($_) { + ($tower_id,$tower_lat,$tower_lon) = split('\s{2,}'); + $tower_lat{$tower_id}=$tower_lat; + $tower_lon{$tower_id}=$tower_lon; + } + } + close(LOCATION_INFO); + +#} + + + +1; + Index: tower_buoy/bin/meta_data/nccoos_map_locs.txt =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/nccoos_map_locs.txt (revision 7) @@ -1,0 +1,87 @@ +CHLV2 36.91 75.71 ndbc Chesapeake Light, VA +44014 36.58 74.84 ndbc VIRGINIA BEACH 64 NM East of Virginia Beach, VA +DUCN7 36.18 75.75 ndbc Duck Pier, NC +41025 35.15 75.29 ndbc Diamond Shoals (Red Buoy) +CLKN7 34.62 76.52 ndbc Cape Lookout, NC +41013 33.48 77.58 ndbc Frying Pan Shoals, NC Buoy +41001 34.68 72.66 ndbc 150 NM East of Cape HATTERAS +41002 32.27 75.42 ndbc S HATTERAS - 250 NM East of Charleston, SC +FBIS1 32.68 79.89 ndbc Folly Island, SC +41004 32.50 79.10 ndbc EDISTO - 41 NM Southeast of Charleston, SC +8631044 37.61 75.69 nos WACHAPREAGUE, VA +8636580 37.62 76.29 nos WINDMILL POINT, VA +8635150 38.25 76.96 nos COLONIAL BEACH, VA +8635750 37.99 76.47 nos LEWISETTA, VA +8632200 37.17 75.99 nos KIPTOPEKE, VA +8637624 37.25 76.50 nos GLOUCESTER POINT, VA +8638610 36.95 76.33 nos SEWELLS POINT, VA +8638863 36.97 76.11 nos CHESAPEAKE BAY BRIDGE TUNNEL, VA +8639348 36.78 76.30 nos MONEY POINT, VA +8651370 36.18 75.75 nos DUCK, FRF PIER, NC +8652587 35.80 75.55 nos OREGON INLET MARINA, NC +8654400 35.22 75.64 nos CAPE HATTERAS FISHING PIER, NC +8656483 34.72 76.67 nos BEAUFORT, DUKE MARINE LAB, NC +8658120 34.23 77.95 nos WILMINGTON, NC +8659897 33.87 78.51 nos SUNSET BEACH, NC +8661070 33.66 78.92 nos SPRINGMAID PIER, SC +8662245 33.35 79.19 nos OYSTER LANDING, CRAB HAUL CREEK, SC +8665530 32.78 79.92 nos CHARLESTON, COOPER RIVER ENTRANCE, SC +8664941 32.86 79.71 nos SOUTH CAPERS ISLAND, SC +8668498 32.34 80.47 nos FRIPPS INLET, SC +8670870 32.03 80.90 nos FORT PULASKI, SAVANNAH RIVER, GA +ncclb 34.4 76.5 nccoos Cape Lookout Buoy +ncnrp 35.08 76.53 nccoos Neuse River Platform +0208455560 35.52 76.50 usgs PUNGO RIVER CHANNEL LT 18 +0208455155 35.36 76.65 usgs PAMLICO RIV. AT LT.3 +0208453300 35.43 76.84 usgs PAMLICO RIVER AT LT.5 +02084472 35.54 77.06 usgs PAMLICO RIVER AT WASHINGTON, NC +0209265810 34.95 76.81 usgs NEUSE RIVER AT CHANNEL LIGHT 9 +0209262905 35.00 76.94 usgs NEUSE RIVER AT CHANNEL LIGHT 11 +02092162 35.11 77.03 usgs NEUSE RIVER AT NEW BERN, NC +02108690 34.26 77.95 usgs NE CAPE FEAR RIVER NEAR WILMINGTON, NC +02110809 33.56 79.09 usgs WACCAMAW R @ WACHESAW LAND. NR MURRELLS INLET, SC +021108125 33.51 79.13 usgs WACCAMAW RIVER NEAR PAWLEYS ISLAND, SC +02110815 33.44 79.18 usgs WACCAMAW R @ HAGLEY LAND. NR PAWLEYS ISLAND, SC +02136370 33.36 79.30 usgs SAMPIT RIVER AT GEORGETOWN, SC +02171905 33.15 79.35 usgs S. SANTEE R @ STATE PIER NR MCCLELLANVILLE, SC +02171850 33.18 79.41 usgs SOUTH SANTEE RIVER NR MCCLELLANVILLE, S.C. +021720698 32.86 79.90 usgs WANDO RIVER ABOVE MT PLEASANT, SC +021720709 32.80 79.91 usgs COOPER RIVER AT U.S. HWY 17 AT CHARLESTON, SC +021720677 32.89 79.96 usgs COOPER RIVER @ FILBIN CREEK @ NORTH CHARLESTON, SC +02172053 32.98 79.92 usgs COOPER R AT MOBAY NR N CHARLESTON, SC +021720711 32.78 79.92 usgs COOPER RIVER AT CUSTOMS HOUSE AT CHARLESTON, SC +KEWN 35.07 77.05 metar New Bern, NC +KOCW 35.57 77.05 metar Washington, NC +KPGV 35.62 77.40 metar Pitt Greenville, NC +KTDF 36.38 78.98 metar Roxboro Person, NC +KHNZ 36.37 78.53 metar Henderson/Oxford, NC +KRDU 35.87 78.78 metar Raleigh/Durham, NC +KBUY 36.05 79.47 metar Burlington, NC +KHBI 35.65 79.90 metar Asheboro Municipal, NC +KMEB 34.78 78.37 metar Maxton, NC +KPOB 35.27 79.02 metar Pope AFB, NC +KTTA 35.58 79.10 metar Sanford, NC +KSOP 35.22 79.40 metar Southern Pines, NC +KFAY 34.98 78.88 metar Fayetteville,NC +KHRJ 35.38 78.73 metar Erwin/Harnett Co., NC +KEYF 34.60 78.58 metar Elizabethtown, NC +KCTZ 34.98 78.37 metar Clinton, NC +KJNX 35.53 78.38 metar Smithfield Johns, NC +KRWI 35.85 77.90 metar Rocky Mount, NC +KRZZ 36.43 77.72 metar Roanoke Rapids, NC +KASJ 36.28 77.17 metar Ahoskie/Tri County, NC +KDPL 35.00 77.97 metar Kenansville/Dupl, NC +KGWW 35.47 77.97 metar Goldsboro/Wayne, NC +KOAJ 34.82 77.62 metar Jacksonville, NC +KISO 35.32 77.62 metar Kinston/Stalling, NC +KILM 34.27 77.90 metar Wilmington, NC +KCPC 34.27 78.72 metar Whiteville, NC +KSUT 33.93 78.08 metar Southport, NC +KEDE 36.02 76.57 metar Edenton, NC +KMQI 35.92 75.70 metar Manteo/Dare Co., NC +KHSE 35.23 75.62 metar Hatteras/Mitchel, NC +KEMV 36.68 77.48 metar Emporia, VA +KFLO 34.18 79.73 metar Florence, SC +KUGG 34.45 79.88 metar Darlington Co.,SC +KMYR 33.67 78.92 metar Myrtle Beach, SC +KCRE 33.82 78.72 metar North Myrtle Beach, SC Index: tower_buoy/bin/meta_data/nccoos_page_info.pm =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/nccoos_page_info.pm (revision 7) @@ -1,0 +1,666 @@ +#meta_data.pm +#Time-stamp: <2006-06-26 11:44:28 lstearns> +# +#Abstract: This module will read in tables of tower related meta data +# and output hash arrays of the information based on param id. Hacked +# together from the subroutine in tower_parse.perl and perl_defs.pm, +# a piece of code from Brian Blanton (Thanks Brian!!). + +# perl defs and subroutines common to quoddy nc/fc runs +# v11/07/2001 B.O.B. +# v02/09/2002 B.O.B. to work out of dmf +# v06/04/2002 B.O.B. added initial da stuff +# v19/08/2002 B.O.B. fixes for changes to "edu" from "com" +# v13/09/2002 B.O.B. added truxton stuff +# v13/12/2002 B.O.B. version for casco4b inclusion/ ssh assim +# vxx/09/2003 B.O.B. modified for SEACOOS +# v15/02/2004 B.O.B. turned into perl package provider (seacoos_sab_defs) + + +package nccoos_page_info; # assumes seacoos_sab_defs.pm + +use strict; +use warnings; +use vars qw(); +#use lib '/opt/local/seacoos/bin/'; +#use Web_dev; + +BEGIN{ + use Exporter (); + + our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); + + $VERSION="1.0"; + + @ISA = qw(Exporter); + + @EXPORT = qw( + %page %article + ); + + @EXPORT_OK=(); +} + + +our(%page,%article + ); + +#my( +# ); + + + + + +###################################################################### +# Enter Page Data +###################################################################### + + +###################################################################### +## Main Page ## ~/index.html ## +###################################################################### + +$page{'main'} = Web->new_page(); +$page{'main'} -> afs_path ( "" ); +$page{'main'} -> path2main ( "" ); +$page{'main'} -> file_name ( "index.html" ); +$page{'main'} -> short_title ( "Main" ); +$page{'main'} -> long_title ( "North Carolina Coastal ". + "Ocean Observing System" ); +#$page{'main'} -> menu_items ( 'main','obs','mods','data' ); +#$page{'main'} -> menu_type ( "vertical" ); +$page{'main'} -> content_files ( "main.txt" ); + + +###################################################################### +## Platforms Main Page ## ~/obs/index.html ## +###################################################################### + +$page{'plats'} = Web->new_page(); +$page{'plats'} -> afs_path ( "plats/" ); +$page{'plats'} -> path2main ( "../" ); +$page{'plats'} -> file_name ( "index.html" ); +$page{'plats'} -> short_title ( "Platforms" ); +$page{'plats'} -> long_title ( "Observation Platforms Operated ". + "by NC-COOS" ); +$page{'plats'} -> menu_items ( 'radar','tower_R4','buoy','jpop','neuse', + 'roof' ); +$page{'plats'} -> menu_type ( "vertical" ); +$page{'plats'} -> script_files ( "plats_page.js" ); +$page{'plats'} -> content_files ( "plats.txt" ); +$page{'plats'} -> articles ( 'radar','tower_R4','buoy','jpop','neuse', + 'roof' ); + +###################################################################### +## Observations Main Page ## ~/obs/index.html ## +###################################################################### + +$page{'obs'} = Web->new_page(); +$page{'obs'} -> afs_path ( "obs/" ); +$page{'obs'} -> path2main ( "../" ); +$page{'obs'} -> file_name ( "index.html" ); +$page{'obs'} -> short_title ( "Merged Maps" ); +$page{'obs'} -> long_title ( "Observations of Oceanic and ". + "Atmospheric Conditions" ); +$page{'obs'} -> menu_items ( 'vel','wind','sst','wl','salin','waves'); +$page{'obs'} -> menu_type ( "vertical" ); +$page{'obs'} -> script_files ( "obs_page.js" ); +#$page{'obs'} -> content_files ( "obs.txt" ); +$page{'obs'} -> articles ( 'currents','winds','sst','wl'); + + +###################################################################### +## Modeling Main Page ## ~/mods/index.html ## +###################################################################### + +$page{'mods'} = Web->new_page(); +$page{'mods'} -> afs_path ( "mods/" ); +$page{'mods'} -> path2main ( "../" ); +$page{'mods'} -> file_name ( "index.html" ); +$page{'mods'} -> short_title ( "Models" ); +$page{'mods'} -> long_title ( "Physical Models of Oceanic and ". + "Atmospheric Conditions" ); +$page{'mods'} -> menu_items ('adcirc','quoddy','eta'); +$page{'mods'} -> menu_type ( "horizontal" ); +$page{'mods'} -> content_files ( "mods.txt" ); + + +###################################################################### +## Data Access Main Page ## ~/data/index.html ## +###################################################################### + +$page{'data'} = Web->new_page(); +$page{'data'} -> afs_path ( "data/" ); +$page{'data'} -> path2main ( "../" ); +#$page{'data'} -> file_name ( "data_access.html" ); +#$page{'data'} -> file_name ( "file_access.html" ); +$page{'data'} -> file_name ( "" ); +$page{'data'} -> short_title ( "File Access" ); +$page{'data'} -> long_title ( "Access to Real-Time Data"); +#$page{'data'} -> menu_items ( 'latest');#,'d_obs','d_mods'); +#$page{'data'} -> menu_type ( "vertical" ); +#$page{'data'} -> content_files ( "data_access.txt" ); +#$page{'data'} -> content_files ( "file_access.txt" ); + +###################################################################### +## Data Access Main Page ## ~/cgi-bin/nph-dods/data/ ## +###################################################################### + +$page{'dods'} = Web->new_page(); +$page{'dods'} -> afs_path ( "cgi-bin/nph-dods/data/" ); +$page{'dods'} -> path2main ( "../" ); +$page{'dods'} -> file_name ( "" ); +$page{'dods'} -> short_title ( "DODS Access" ); +#$page{'dods'} -> long_title ( "Access to Real-Time Data"); +#$page{'dods'} -> menu_items ( 'latest');#,'d_obs','d_mods'); +#$page{'dods'} -> menu_type ( "vertical" ); +#$page{'dods'} -> content_files ( "contents/dods_page.txt" ); + + + +###################################################################### +## Menu Entries ###################################################### +###################################################################### + +$page{'radar'} = Web->new_page(); +$page{'radar'} -> afs_path ( "plats/radar/" ); +$page{'radar'} -> short_title ( "HF Radar" ); +$page{'radar'} -> long_title ( "Surface Current Radar" ); +$page{'radar'} -> file_name ( "index.html" ); +$page{'radar'} -> path2main ( "../../" ); +$page{'radar'} -> parent ( "plats" ); +$page{'radar'} -> menu_items ( 'radar_comp','radar_pub' ); +$page{'radar'} -> content_files ( "radar_1.txt", + #"radar_2.txt", + "technical.txt", + "radar_3.txt"); + #"radar_4.txt"); +#$page{'radar'} -> dynamic_table ( "contents/tables/codar_suv.txt" ); +#$page{'radar'} -> script_files ( 'loc_data.js' ); + +$page{'radar_hist'} = Web->new_page(); +$page{'radar_hist'} -> afs_path ( "plats/radar/" ); +$page{'radar_hist'} -> short_title ( "HF Radar" ); +$page{'radar_hist'} -> long_title ( "Surface Current Radar (Historical)" ); +$page{'radar_hist'} -> file_name ( "historical.html" ); +$page{'radar_hist'} -> path2main ( "../../" ); +$page{'radar_hist'} -> parent ( "plats/radar" ); +$page{'radar_hist'} -> content_files ( "radar_1.txt", + "radar_3.fix1", + "radar_anim_script.txt", + "radar_3.fix2", + "radar_anim.txt", + "radar_3.fix3"); + +$page{'radar_pub'} = Web->new_page(); +$page{'radar_pub'} -> afs_path ( "plats/radar/" ); +$page{'radar_pub'} -> short_title ( "Publications" ); +$page{'radar_pub'} -> long_title ( "Publications and Presentations" ); +$page{'radar_pub'} -> file_name ( "radar_pub.html" ); +$page{'radar_pub'} -> path2main ( "../../" ); +$page{'radar_pub'} -> parent ( "plats/radar" ); +$page{'radar_pub'} -> content_files ( "radar_1.txt","radar_pub.txt" ); + +$page{'radar_comp'} = Web->new_page(); +$page{'radar_comp'} -> afs_path ( "plats/radar/" ); +$page{'radar_comp'} -> short_title ( "Compare" ); +$page{'radar_comp'} -> long_title ( "Data Comparissons" ); +$page{'radar_comp'} -> file_name ( "radar_comp.html" ); +$page{'radar_comp'} -> path2main ( "../../" ); +$page{'radar_comp'} -> parent ( "plats/radar" ); +$page{'radar_comp'} -> content_files ( "radar_1.txt","radar_comp.txt" ); + +$page{'radar_analysis'} = Web->new_page(); +$page{'radar_analysis'} -> afs_path ( "plats/radar/" ); +$page{'radar_analysis'} -> short_title ( "Analysis" ); +$page{'radar_analysis'} -> long_title ( "Data Analysis" ); +$page{'radar_analysis'} -> file_name ( "radar_analysis.html" ); +$page{'radar_analysis'} -> path2main ( "../../" ); +$page{'radar_analysis'} -> parent ( "plats/radar" ); +$page{'radar_analysis'} -> content_files ( "radar_1.txt","radar_analysis.txt" ); + +$page{'tower_R4'} = Web->new_page(); +$page{'tower_R4'} -> afs_path ( "plats/tower_R4/" ); +$page{'tower_R4'} -> short_title ( "R4 Tower" ); +$page{'tower_R4'} -> long_title ( "Navy Tower R4" ); +$page{'tower_R4'} -> file_name ( "index.html" ); +$page{'tower_R4'} -> path2main ( "../../" ); +$page{'tower_R4'} -> menu_items ( 'tower_R4_sys','tower_R4_pkg' ); +$page{'tower_R4'} -> parent ( "plats" ); +$page{'tower_R4'} -> content_files ( "tower_R4.txt" ); +$page{'tower_R4'} -> dynamic_table ( "contents/tables/tower_r4.txt" ); + +$page{'tower_R4_sys'} = Web->new_page(); +$page{'tower_R4_sys'} -> afs_path ( "plats/tower_R4/" ); +$page{'tower_R4_sys'} -> short_title ( "System" ); +$page{'tower_R4_sys'} -> long_title ( "System Info" ); +$page{'tower_R4_sys'} -> file_name ( "sys_info.html" ); +$page{'tower_R4_sys'} -> path2main ( "../../" ); +$page{'tower_R4_sys'} -> parent ( "plats/tower_R4" ); +$page{'tower_R4_sys'} -> content_files ( "tower_R4.txt" ); +$page{'tower_R4_sys'} -> dynamic_table ( "contents/tables/tower_r4_sys.txt" ); + +#$page{'tower_R4_pkg'} = Web->new_page(); +#$page{'tower_R4_pkg'} -> afs_path ( "plats/tower_R4/" ); +#$page{'tower_R4_pkg'} -> short_title ( "Package" ); +#$page{'tower_R4_pkg'} -> long_title ( "Package Details" ); +#$page{'tower_R4_pkg'} -> file_name ( "pkg_info.html" ); +#$page{'tower_R4_pkg'} -> path2main ( "../../" ); +#$page{'tower_R4_pkg'} -> parent ( "plats/tower_R4" ); +#$page{'tower_R4_pkg'} -> content_files ( "tower_R4.txt","tower_R4_pkg.txt" ); + + +#This page will be replaced by the contents of buoy_data +#$page{'buoy'} = Web->new_page(); +#$page{'buoy'} -> afs_path ( "plats/buoy/" ); +#$page{'buoy'} -> short_title ( "Buoy" ); +#$page{'buoy'} -> long_title ( "Cape Lookout Buoy" ); +#$page{'buoy'} -> file_name ( "index.html" ); +#$page{'buoy'} -> path2main ( "../../" ); +#$page{'buoy'} -> parent ( "plats" ); +#$page{'buoy'} -> content_files ( "buoy.txt" ); + +$page{'buoy'} = Web->new_page(); +$page{'buoy'} -> afs_path ( "plats/buoy/" ); +$page{'buoy'} -> short_title ( "Buoy" ); +$page{'buoy'} -> long_title ( "Lookout Shoals Research Buoy" ); +$page{'buoy'} -> file_name ( "index.html" ); +$page{'buoy'} -> path2main ( "../../" ); +$page{'buoy'} -> parent ( "plats" ); +$page{'buoy'} -> menu_items ( 'buoy_sys','buoy_pkg' ); +$page{'buoy'} -> content_files ( "buoy_lsrb.txt"); + #"buoy_down.txt" ); + #"technical.txt" ); +$page{'buoy'} -> script_files ( "popup.js" ); +$page{'buoy'} -> dynamic_table ( "contents/tables/buoy_lsrb.txt"); + #"contents/tables/buoy_lsrb_surf.txt", + #"contents/tables/buoy_lsrb_midw.txt"); + +$page{'buoy_sys'} = Web->new_page(); +$page{'buoy_sys'} -> afs_path ( "plats/buoy/" ); +$page{'buoy_sys'} -> short_title ( "System" ); +$page{'buoy_sys'} -> long_title ( "Buoy System Data" ); +$page{'buoy_sys'} -> file_name ( "sys.html" ); +$page{'buoy_sys'} -> path2main ( "../../" ); +$page{'buoy_sys'} -> parent ( "plats/buoy" ); +$page{'buoy_sys'} -> content_files ( "buoy_lsrb.txt" ); +$page{'buoy_sys'} -> dynamic_table ( "contents/tables/buoy_lsrb_sys.txt" ); + +$page{'buoy_pkg'} = Web->new_page(); +$page{'buoy_pkg'} -> afs_path ( "plats/buoy/" ); +$page{'buoy_pkg'} -> short_title ( "Package" ); +$page{'buoy_pkg'} -> long_title ( "Buoy Package Info" ); +$page{'buoy_pkg'} -> file_name ( "pkg_test.html" ); +$page{'buoy_pkg'} -> path2main ( "../../" ); +$page{'buoy_pkg'} -> parent ( "plats/buoy" ); +$page{'buoy_pkg'} -> content_files ( "buoy_lsrb.txt", "buoy_pkg.txt" ); + + +$page{'jpop'} = Web->new_page(); +$page{'jpop'} -> afs_path ( "plats/jpop/" ); +$page{'jpop'} -> short_title ( "JPOP" ); +$page{'jpop'} -> long_title ( "Jennette's Pier Observing Partnership" ); +$page{'jpop'} -> file_name ( "index.html" ); +$page{'jpop'} -> path2main ( "../../" ); +$page{'jpop'} -> parent ( "plats" ); +$page{'jpop'} -> content_files ( "jpop.txt" ); + + +$page{'neuse'} = Web->new_page(); +$page{'neuse'} -> afs_path ( "plats/neuse/" ); +$page{'neuse'} -> short_title ( "Neuse" ); +$page{'neuse'} -> long_title ( "Neuse River Profiling Station" ); +$page{'neuse'} -> file_name ( "index.html" ); +$page{'neuse'} -> path2main ( "../../" ); +$page{'neuse'} -> parent ( "plats" ); +$page{'neuse'} -> content_files ( "neuse.txt" ); + + +$page{'roof'} = Web->new_page(); +$page{'roof'} -> afs_path ( "plats/roof/" ); +$page{'roof'} -> short_title ( "Roof" ); +$page{'roof'} -> long_title ( "Roof Development Package" ); +$page{'roof'} -> file_name ( "index.html" ); +$page{'roof'} -> path2main ( "../../" ); +$page{'roof'} -> parent ( "plats" ); +$page{'roof'} -> menu_items ( 'roof_sys','roof_pkg' ); +$page{'roof'} -> content_files ( "roof.txt" ); +$page{'roof'} -> dynamic_table ( "contents/tables/roof.txt" ); + +$page{'roof_sys'} = Web->new_page(); +$page{'roof_sys'} -> afs_path ( "plats/roof/" ); +$page{'roof_sys'} -> short_title ( "System" ); +$page{'roof_sys'} -> long_title ( "System Info" ); +$page{'roof_sys'} -> file_name ( "sys_info.html" ); +$page{'roof_sys'} -> path2main ( "../../" ); +$page{'roof_sys'} -> parent ( "plats/roof" ); +$page{'roof_sys'} -> content_files ( "roof.txt","roof_sys.txt" ); +$page{'roof_sys'} -> dynamic_table ( "contents/tables/roof_sys.txt" ); + +$page{'roof_pkg'} = Web->new_page(); +$page{'roof_pkg'} -> afs_path ( "plats/roof/" ); +$page{'roof_pkg'} -> short_title ( "Package" ); +$page{'roof_pkg'} -> long_title ( "Package Details" ); +$page{'roof_pkg'} -> file_name ( "pkg_info.html" ); +$page{'roof_pkg'} -> path2main ( "../../" ); +$page{'roof_pkg'} -> parent ( "plats/roof" ); +#$page{'roof_pkg'} -> articles ( 'roof_daq','roof_com','roof_trans' ); +$page{'roof_pkg'} -> content_files ( "roof.txt","roof_pkg.txt" ); + +$page{'sst'} = Web->new_page(); +$page{'sst'} -> afs_path ( "obs/" ); +#$page{'sst'} -> on_mouseover ('sst_v_w.png'); +$page{'sst'} -> file_name ( "sst.html" ); +$page{'sst'} -> short_title ( "SST" ); +$page{'sst'} -> long_title ( "Sea Surface Temperature" ); +$page{'sst'} -> parent ( "obs" ); +$page{'sst'} -> path2main ( "../" ); +$page{'sst'} -> script_files ( "popup.js" ); +$page{'sst'} -> image_maps ( "obs_sst.map" ); +$page{'sst'} -> content_files ( "sst.txt" ); + +$page{'wind'} = Web->new_page(); +$page{'wind'} -> afs_path ( "obs/" ); +#$page{'wind'} -> on_mouseover ( 'wind_v.png' ); +$page{'wind'} -> file_name ( "wind.html" ); +$page{'wind'} -> short_title ( "Wind" ); +$page{'wind'} -> long_title ( "Wind Velocities" ); +$page{'wind'} -> parent ( "obs" ); +$page{'wind'} -> path2main ( "../" ); +$page{'wind'} -> script_files ( "popup.js" ); +$page{'wind'} -> image_maps ( "obs_wind.map" ); +$page{'wind'} -> content_files ( "wind.txt" ); + +$page{'vel'} = Web->new_page(); +$page{'vel'} -> afs_path ( "obs/" ); +#$page{'vel'} -> on_mouseover ('vel.png'); +$page{'vel'} -> file_name ( "vel.html" ); +$page{'vel'} -> short_title ( "Currents" ); +$page{'vel'} -> long_title ( "Water Velocities" ); +$page{'vel'} -> parent ( "obs" ); +$page{'vel'} -> script_files ( "popup.js" ); +$page{'vel'} -> image_maps ( "obs_vel.map" ); +$page{'vel'} -> path2main ( "../" ); +$page{'vel'} -> content_files ( "vel.txt" ); + +#$page{'salin'} = Web->new_page(); +#$page{'salin'} -> afs_path ( "obs/" ); +#$page{'salin'} -> on_mouseover ('salin_v_w.png'); +#$page{'salin'} -> file_name ( "salin.html" ); +#$page{'salin'} -> short_title ( "Salinity" ); +#$page{'salin'} -> path2main ( "../" ); +#$page{'salin'} -> parent ( "obs" ); + + +$page{'wl'} = Web->new_page(); +$page{'wl'} -> afs_path ( "obs/" ); +#$page{'wl'} -> on_mouseover ('wl_v_w.png'); +$page{'wl'} -> file_name ( "wl.html" ); +$page{'wl'} -> short_title ( "Water Level" ); +$page{'wl'} -> long_title ( "Water Level" ); +$page{'wl'} -> path2main ( "../" ); +$page{'wl'} -> parent ( "obs" ); +$page{'wl'} -> content_files ( "wl.txt" ); + +$page{'radial'} = Web->new_page(); +#$page{'radial'} -> on_mouseover ('radial.png'); +$page{'radial'} -> afs_path ( "obs/" ); +$page{'radial'} -> file_name ( "radial.html" ); +$page{'radial'} -> short_title ( "Radials" ); +$page{'radial'} -> long_title ( "Radial Surface Velocities" ); +$page{'radial'} -> path2main ( "../" ); +$page{'radial'} -> parent ( "obs" ); +$page{'radial'} -> content_files ( "radial.txt" ); + + +$page{'exper'} = Web->new_page(); +$page{'exper'} -> afs_path ( "" ); +#$page{'exper'} -> file_name ( "" ); +$page{'exper'} -> short_title ( "Note: Experimental!" ); +$page{'exper'} -> path2main ( "../" ); + +$page{'adcirc'} = Web->new_page(); +$page{'adcirc'} -> afs_path ( "mods/adcirc/" ); +$page{'adcirc'} -> file_name ( "index.html" ); +$page{'adcirc'} -> short_title ( "ADCIRC" ); +$page{'adcirc'} -> long_title ( "ADCIRC Tidal and Wind Model" ); +$page{'adcirc'} -> path2main ( "../../" ); +$page{'adcirc'} -> content_files ( "adcirc.txt" ); +#$page{'adcirc'} -> menu_items ( 'adcirc_wl','adcirc_suv' ); +$page{'adcirc'} -> parent ( "mods" ); + +$page{'adcirc_wl'} = Web->new_page(); +$page{'adcirc_wl'} -> afs_path ( "mods/adcirc/" ); +$page{'adcirc_wl'} -> file_name ( "adcirc_wl.html" ); +$page{'adcirc_wl'} -> short_title ( "Water Level" ); +$page{'adcirc_wl'} -> long_title ( "ADCIRC Water Level" ); +$page{'adcirc_wl'} -> path2main ( "../../" ); +$page{'adcirc_wl'} -> content_files ( "adcirc_wl.txt" ); +$page{'adcirc_wl'} -> parent ( "mods/adcirc" ); + +$page{'adcirc_suv'} = Web->new_page(); +$page{'adcirc_suv'} -> afs_path ( "mods/adcirc/" ); +$page{'adcirc_suv'} -> file_name ( "adcirc_suv.html" ); +$page{'adcirc_suv'} -> short_title ( "Currents" ); +$page{'adcirc_suv'} -> long_title ( "ADCIRC Surface Currents" ); +$page{'adcirc_suv'} -> path2main ( "../../" ); +$page{'adcirc_suv'} -> content_files ( "adcirc_suv.txt" ); +$page{'adcirc_suv'} -> parent ( "mods/adcirc" ); + + +$page{'quoddy'} = Web->new_page(); +$page{'quoddy'} -> afs_path ( "mods/quoddy/" ); +$page{'quoddy'} -> file_name ( "index.html" ); +$page{'quoddy'} -> short_title ( "QUODDY" ); +$page{'quoddy'} -> long_title ( "QUODDY Tidal and Wind Model" ); +$page{'quoddy'} -> path2main ( "../../" ); +$page{'quoddy'} -> content_files ( "quoddy.txt" ); +$page{'quoddy'} -> menu_items ( 'quoddy_sst','quoddy_suv' ); +$page{'quoddy'} -> parent ( "mods" ); + +$page{'quoddy_sst'} = Web->new_page(); +$page{'quoddy_sst'} -> afs_path ( "mods/quoddy/" ); +$page{'quoddy_sst'} -> file_name ( "quoddy_sst.html" ); +$page{'quoddy_sst'} -> short_title ( "SST" ); +$page{'quoddy_sst'} -> long_title ( "QUODDY Sea Surface Temperature" ); +$page{'quoddy_sst'} -> path2main ( "../../" ); +$page{'quoddy_sst'} -> content_files ( "quoddy_sst.txt" ); +$page{'quoddy_sst'} -> parent ( "mods/quoddy" ); + +$page{'quoddy_wl'} = Web->new_page(); +$page{'quoddy_wl'} -> afs_path ( "mods/quoddy/" ); +$page{'quoddy_wl'} -> file_name ( "quoddy_wl.html" ); +$page{'quoddy_wl'} -> short_title ( "Water Level" ); +$page{'quoddy_wl'} -> long_title ( "QUODDY Water Level" ); +$page{'quoddy_wl'} -> path2main ( "../../" ); +$page{'quoddy_wl'} -> content_files ( "quoddy_wl.txt" ); +$page{'quoddy_wl'} -> parent ( "mods/quoddy" ); + +$page{'quoddy_suv'} = Web->new_page(); +$page{'quoddy_suv'} -> afs_path ( "mods/quoddy/" ); +$page{'quoddy_suv'} -> file_name ( "quoddy_suv.html" ); +$page{'quoddy_suv'} -> short_title ( "Currents" ); +$page{'quoddy_suv'} -> long_title ( "QUODDY Surface Currents" ); +$page{'quoddy_suv'} -> path2main ( "../../" ); +$page{'quoddy_suv'} -> content_files ( "quoddy_suv.txt" ); +$page{'quoddy_suv'} -> parent ( "mods/quoddy" ); + +$page{'eta'} = Web->new_page(); +$page{'eta'} -> afs_path ( "mods/eta/" ); +$page{'eta'} -> file_name ( "index.html" ); +$page{'eta'} -> short_title ( "ETA" ); +$page{'eta'} -> long_title ( "ETA Atmospheric Model" ); +$page{'eta'} -> path2main ( "../../" ); +$page{'eta'} -> content_files ( "eta.txt" ); +$page{'eta'} -> menu_items ( 'eta_wind','eta_sst' ); +$page{'eta'} -> parent ( "mods" ); + +$page{'eta_wind'} = Web->new_page(); +$page{'eta_wind'} -> afs_path ( "mods/eta/" ); +$page{'eta_wind'} -> file_name ( "eta_wind.html" ); +$page{'eta_wind'} -> short_title ( "Wind" ); +$page{'eta_wind'} -> long_title ( "ETA Wind Velocity" ); +$page{'eta_wind'} -> path2main ( "../../" ); +$page{'eta_wind'} -> content_files ( "eta_wind.txt" ); +$page{'eta_wind'} -> parent ( "mods/eta" ); + +$page{'eta_sst'} = Web->new_page(); +$page{'eta_sst'} -> afs_path ( "mods/eta/" ); +$page{'eta_sst'} -> file_name ( "eta_sst.html" ); +$page{'eta_sst'} -> short_title ( "SST" ); +$page{'eta_sst'} -> long_title ( "ETA Sea Surface Temperature" ); +$page{'eta_sst'} -> path2main ( "../../" ); +$page{'eta_sst'} -> content_files ( "eta_sst.txt" ); +$page{'eta_sst'} -> parent ( "mods/eta" ); + +$page{'blank'} = Web->new_page(); +$page{'blank'} -> afs_path ( "" ); +$page{'blank'} -> short_title ( '' ); +$page{'blank'} -> long_title ( "" ); +$page{'blank'} -> path2main ( "" ); + + + +#$page{'hycom'} = Web->new_page(); +#$page{'hycom'} -> afs_path ( "mods/" ); +#$page{'hycom'} -> file_name ( "hycom.html" ); +#$page{'hycom'} -> short_title ( "HYCOM" ); +#$page{'hycom'} -> path2main ( "../" ); + + +#$page{'latest'} = Web->new_page(); +#$page{'latest'} -> afs_path ( "data/" ); +#$page{'latest'} -> file_name ( "latest_v2.0" ); +#$page{'latest'} -> short_title ( "Latest Real-Time Data" ); +#$page{'latest'} -> path2main ( "../" ); + + +$article{'obs'} = Web->new_article(); +$article{'obs'} -> short_title ( "Observations" ); +$article{'obs'} -> long_title ( "Merged Maps" ); +$article{'obs'} -> target_url ( "obs/" ); +#$article{'obs'} -> thumbnail ( "obs_thumb.png" ); +$article{'obs'} -> thumbnail ( "img/blank_map_thumb.png" ); +$article{'obs'} -> content_files ( "obs.txt" ); + +$article{'currents'} = Web->new_article(); +$article{'currents'} -> short_title ( "Currents" ); +$article{'currents'} -> long_title ( "Sea Surface Currents" ); +#$article{'currents'} -> target_url ( "img/rt/vel.png" ); +$article{'currents'} -> target_url ( "obs/vel.html" ); +#$article{'currents'} -> thumbnail ( "obs_thumb.png" ); +$article{'currents'} -> thumbnail ( "img/obs/suv_latest_thumb.png" ); +$article{'currents'} -> content_files ( "currents.txt" ); + +$article{'winds'} = Web->new_article(); +$article{'winds'} -> short_title ( "Winds" ); +$article{'winds'} -> long_title ( "Wind Veolcities" ); +$article{'winds'} -> target_url ( "obs/wind.html" ); +$article{'winds'} -> thumbnail ( "img/obs/wind_latest_thumb.png" ); +$article{'winds'} -> content_files ( "winds.txt" ); + +$article{'sst'} = Web->new_article(); +$article{'sst'} -> short_title ( "SST" ); +$article{'sst'} -> long_title ( "Sea Surface Temperature" ); +$article{'sst'} -> target_url ( "obs/sst.html" ); +$article{'sst'} -> thumbnail ( "img/obs/sst_latest_thumb.png" ); +$article{'sst'} -> content_files ( "sst.txt" ); + +$article{'wl'} = Web->new_article(); +$article{'wl'} -> short_title ( "Water Level" ); +$article{'wl'} -> long_title ( "Water Level" ); +$article{'wl'} -> target_url ( "obs/wl.html" ); +#$article{'wl'} -> thumbnail ( "wl_thumb.png" ); +$article{'wl'} -> thumbnail ( "img/obs/wl_latest_thumb.png" ); +$article{'wl'} -> content_files ( "wl.txt" ); + +#$article{'salin'} = Web->new_article(); +#$article{'salin'} -> short_title ( "Salinity" ); +#$article{'salin'} -> long_title ( "Surface Salinity" ); +#$article{'salin'} -> target_url ( "obs/salin.html" ); +#$article{'salin'} -> thumbnail ( "salin_thumb.png" ); +#$article{'salin'} -> thumbnail ( "example.png" ); +#$article{'salin'} -> content_files ( "salin.txt" ); + +$article{'radial'} = Web->new_article(); +$article{'radial'} -> short_title ( "Radials" ); +$article{'radial'} -> long_title ( "Surface Current Radial Components " ); +$article{'radial'} -> target_url ( "obs/radial.html" ); +#$article{'radial'} -> thumbnail ( "radial_thumb.png" ); +$article{'radial'} -> thumbnail ( "img/blank_map_thumb.png" ); +$article{'radial'} -> content_files ( "radials.txt" ); + +$article{'radar'} = Web->new_article(); +$article{'radar'} -> short_title ( "Radar" ); +$article{'radar'} -> long_title ( "Surface Current Radar Observations" ); +$article{'radar'} -> target_url ( "plats/radar/" ); +#$article{'radar'} -> thumbnail ( "radar_thumb.png" ); +$article{'radar'} -> thumbnail ( "img/thumbnails/codar_receive.jpg" ); +$article{'radar'} -> content_files ( "radar.txt" ); + +$article{'tower_R4'} = Web->new_article(); +$article{'tower_R4'} -> short_title ( "Tower R4" ); +$article{'tower_R4'} -> long_title ( "Tower R4 Package" ); +$article{'tower_R4'} -> target_url ( "plats/tower_R4/" ); +#$article{'tower_R4'} -> thumbnail ( "tower_R4_thumb.png" ); +$article{'tower_R4'} -> thumbnail ( "img/thumbnails/r8_tower.jpg" ); +$article{'tower_R4'} -> content_files ( "tower_R4.txt" ); + +$article{'buoy'} = Web->new_article(); +$article{'buoy'} -> short_title ( "Buoy" ); +$article{'buoy'} -> long_title ( "Cape Lookout Buoy" ); +$article{'buoy'} -> target_url ( "plats/buoy/" ); +#$article{'buoy'} -> thumbnail ( "buoy_thumb.png" ); +$article{'buoy'} -> thumbnail ( "img/thumbnails/buoy_unload2.png" ); +$article{'buoy'} -> content_files ( "buoy.txt" ); + +$article{'jpop'} = Web->new_article(); +$article{'jpop'} -> short_title ( "Jpop" ); +$article{'jpop'} -> long_title ( "Jennette's Pier Observing Partnership" ); +$article{'jpop'} -> target_url ( "plats/jpop/" ); +#$article{'jpop'} -> thumbnail ( "jpop_thumb.png" ); +$article{'jpop'} -> thumbnail ( "img/thumbnails/jpier_thumb.png" ); +$article{'jpop'} -> content_files ( "jpop.txt" ); + +$article{'neuse'} = Web->new_article(); +$article{'neuse'} -> short_title ( "Neuse" ); +$article{'neuse'} -> long_title ( "Neuse River Profiler" ); +$article{'neuse'} -> target_url ( "plats/neuse/" ); +#$article{'neuse'} -> thumbnail ( "neuse_thumb.png" ); +$article{'neuse'} -> thumbnail ( "img/thumbnails/neuse_platform2.png" ); +$article{'neuse'} -> content_files ( "neuse.txt" ); + +$article{'roof'} = Web->new_article(); +$article{'roof'} -> short_title ( "Development" ); +$article{'roof'} -> long_title ( "Development Package for Towers and Buoys" ); +$article{'roof'} -> target_url ( "plats/roof/" ); +#$article{'roof'} -> thumbnail ( "roof_thumb.png" ); +$article{'roof'} -> thumbnail ( "img/thumbnails/roof_pkg.jpg" ); +$article{'roof'} -> content_files ( "roof.txt" ); + +$article{'roof_daq'} = Web->new_article(); +$article{'roof_daq'} -> short_title ( "DAQ" ); +$article{'roof_daq'} -> long_title ( "Data Acquisition Package" ); +#$article{'roof_daq'} -> target_url ( "plats/roof/" ); +#$article{'roof'} -> thumbnail ( "roof_thumb.png" ); +#$article{'roof_daq'} -> thumbnail ( "roof_pkg.jpg" ); +$article{'roof_daq'} -> content_files ( "roof_daq.txt" ); + +$article{'roof_com'} = Web->new_article(); +$article{'roof_com'} -> short_title ( "ComLib" ); +$article{'roof_com'} -> long_title ( "Communications Library" ); +#$article{'roof_com'} -> target_url ( "plats/roof/" ); +#$article{'roof'} -> thumbnail ( "roof_thumb.png" ); +#$article{'roof_com'} -> thumbnail ( "roof_pkg.jpg" ); +$article{'roof_com'} -> content_files ( "roof_com.txt" ); + +$article{'roof_trans'} = Web->new_article(); +$article{'roof_trans'} -> short_title ( "Transfer" ); +$article{'roof_trans'} -> long_title ( "Data Transfer Package" ); +#$article{'roof_trans'} -> target_url ( "plats/roof/" ); +#$article{'roof'} -> thumbnail ( "roof_thumb.png" ); +#$article{'roof_trans'} -> thumbnail ( "roof_pkg.jpg" ); +$article{'roof_trans'} -> content_files ( "roof_trans.txt" ); + + Index: tower_buoy/bin/meta_data/nccoos_page_info_2005_01_30.pm =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/nccoos_page_info_2005_01_30.pm (revision 7) @@ -1,0 +1,616 @@ +#meta_data.pm +#Time-stamp: <2005-01-30 22:01:29 lstearns> +# +#Abstract: This module will read in tables of tower related meta data +# and output hash arrays of the information based on param id. Hacked +# together from the subroutine in tower_parse.perl and perl_defs.pm, +# a piece of code from Brian Blanton (Thanks Brian!!). + +# perl defs and subroutines common to quoddy nc/fc runs +# v11/07/2001 B.O.B. +# v02/09/2002 B.O.B. to work out of dmf +# v06/04/2002 B.O.B. added initial da stuff +# v19/08/2002 B.O.B. fixes for changes to "edu" from "com" +# v13/09/2002 B.O.B. added truxton stuff +# v13/12/2002 B.O.B. version for casco4b inclusion/ ssh assim +# vxx/09/2003 B.O.B. modified for SEACOOS +# v15/02/2004 B.O.B. turned into perl package provider (seacoos_sab_defs) + + +package nccoos_page_info; # assumes seacoos_sab_defs.pm + +use strict; +use warnings; +use vars qw(); +#use lib '/opt/local/seacoos/bin/'; +#use Web_dev; + +BEGIN{ + use Exporter (); + + our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); + + $VERSION="1.0"; + + @ISA = qw(Exporter); + + @EXPORT = qw( + %page %article + ); + + @EXPORT_OK=(); +} + + +our(%page,%article + ); + +#my( +# ); + + + + + +###################################################################### +# Enter Page Data +###################################################################### + + +###################################################################### +## Main Page ## ~/index.html ## +###################################################################### + +$page{'main'} = Web->new_page(); +$page{'main'} -> afs_path ( "" ); +$page{'main'} -> path2main ( "" ); +$page{'main'} -> file_name ( "index.html" ); +$page{'main'} -> short_title ( "Main" ); +$page{'main'} -> long_title ( "North Carolina Coastal ". + "Ocean Observing System" ); +#$page{'main'} -> menu_items ( 'main','obs','mods','data' ); +#$page{'main'} -> menu_type ( "vertical" ); +$page{'main'} -> content_files ( "main.txt" ); + + +###################################################################### +## Platforms Main Page ## ~/obs/index.html ## +###################################################################### + +$page{'plats'} = Web->new_page(); +$page{'plats'} -> afs_path ( "plats/" ); +$page{'plats'} -> path2main ( "../" ); +$page{'plats'} -> file_name ( "index.html" ); +$page{'plats'} -> short_title ( "Platforms" ); +$page{'plats'} -> long_title ( "Observation Platforms Operated ". + "by NC-COOS" ); +$page{'plats'} -> menu_items ( 'radar','tower_R4','buoy','neuse', + 'roof' ); +$page{'plats'} -> menu_type ( "vertical" ); +$page{'plats'} -> script_files ( "plats_page.js" ); +$page{'plats'} -> content_files ( "plats.txt" ); +$page{'plats'} -> articles ( 'radar','tower_R4','buoy','neuse', + 'roof' ); + +###################################################################### +## Observations Main Page ## ~/obs/index.html ## +###################################################################### + +$page{'obs'} = Web->new_page(); +$page{'obs'} -> afs_path ( "obs/" ); +$page{'obs'} -> path2main ( "../" ); +$page{'obs'} -> file_name ( "index.html" ); +$page{'obs'} -> short_title ( "Merged Maps" ); +$page{'obs'} -> long_title ( "Observations of Oceanic and ". + "Atmospheric Conditions" ); +$page{'obs'} -> menu_items ( 'vel','wind','sst','wl','salin','waves'); +$page{'obs'} -> menu_type ( "vertical" ); +$page{'obs'} -> script_files ( "obs_page.js" ); +#$page{'obs'} -> content_files ( "obs.txt" ); +$page{'obs'} -> articles ( 'currents','winds','sst','wl'); + + +###################################################################### +## Modeling Main Page ## ~/mods/index.html ## +###################################################################### + +$page{'mods'} = Web->new_page(); +$page{'mods'} -> afs_path ( "mods/" ); +$page{'mods'} -> path2main ( "../" ); +$page{'mods'} -> file_name ( "index.html" ); +$page{'mods'} -> short_title ( "Models" ); +$page{'mods'} -> long_title ( "Physical Models of Oceanic and ". + "Atmospheric Conditions" ); +$page{'mods'} -> menu_items ('adcirc','quoddy','eta'); +$page{'mods'} -> menu_type ( "horizontal" ); +$page{'mods'} -> content_files ( "mods.txt" ); + + +###################################################################### +## Data Access Main Page ## ~/data/index.html ## +###################################################################### + +$page{'data'} = Web->new_page(); +$page{'data'} -> afs_path ( "data/" ); +$page{'data'} -> path2main ( "../" ); +#$page{'data'} -> file_name ( "data_access.html" ); +$page{'data'} -> file_name ( "" ); +$page{'data'} -> short_title ( "File Access" ); +$page{'data'} -> long_title ( "Access to Real-Time Data"); +#$page{'data'} -> menu_items ( 'latest');#,'d_obs','d_mods'); +#$page{'data'} -> menu_type ( "vertical" ); +#$page{'data'} -> content_files ( "data_access.txt" ); + +###################################################################### +## Data Access Main Page ## ~/cgi-bin/nph-dods/data/ ## +###################################################################### + +$page{'dods'} = Web->new_page(); +$page{'dods'} -> afs_path ( "cgi-bin/nph-dods/data/" ); +$page{'dods'} -> path2main ( "../" ); +$page{'dods'} -> file_name ( "" ); +$page{'dods'} -> short_title ( "DODS Access" ); +#$page{'dods'} -> long_title ( "Access to Real-Time Data"); +#$page{'dods'} -> menu_items ( 'latest');#,'d_obs','d_mods'); +#$page{'dods'} -> menu_type ( "vertical" ); +#$page{'dods'} -> content_files ( "contents/dods_page.txt" ); + + + +###################################################################### +## Menu Entries ###################################################### +###################################################################### + +$page{'radar'} = Web->new_page(); +$page{'radar'} -> afs_path ( "plats/radar/" ); +$page{'radar'} -> short_title ( "HF Radar" ); +$page{'radar'} -> long_title ( "Surface Current Radar" ); +$page{'radar'} -> file_name ( "index.html" ); +$page{'radar'} -> path2main ( "../../" ); +$page{'radar'} -> parent ( "plats" ); +$page{'radar'} -> menu_items ( 'radar_comp','radar_pub' ); +$page{'radar'} -> content_files ( "radar_1.txt", + "radar_2.txt", + "radar_3.txt", + "radar_4.txt"); +#$page{'radar'} -> dynamic_table ( "contents/tables/codar_suv.txt" ); +$page{'radar'} -> script_files ( 'loc_data.js' ); + +$page{'radar_pub'} = Web->new_page(); +$page{'radar_pub'} -> afs_path ( "plats/radar/" ); +$page{'radar_pub'} -> short_title ( "Publications" ); +$page{'radar_pub'} -> long_title ( "Publications and Presentations" ); +$page{'radar_pub'} -> file_name ( "radar_pub.html" ); +$page{'radar_pub'} -> path2main ( "../../" ); +$page{'radar_pub'} -> parent ( "plats/radar" ); +$page{'radar_pub'} -> content_files ( "radar_1.txt","radar_pub.txt" ); + +$page{'radar_comp'} = Web->new_page(); +$page{'radar_comp'} -> afs_path ( "plats/radar/" ); +$page{'radar_comp'} -> short_title ( "Compare" ); +$page{'radar_comp'} -> long_title ( "Data Comparissons" ); +$page{'radar_comp'} -> file_name ( "radar_comp.html" ); +$page{'radar_comp'} -> path2main ( "../../" ); +$page{'radar_comp'} -> parent ( "plats/radar" ); +$page{'radar_comp'} -> content_files ( "radar_1.txt","radar_comp.txt" ); + +$page{'tower_R4'} = Web->new_page(); +$page{'tower_R4'} -> afs_path ( "plats/tower_R4/" ); +$page{'tower_R4'} -> short_title ( "R4 Tower" ); +$page{'tower_R4'} -> long_title ( "Navy Tower R4" ); +$page{'tower_R4'} -> file_name ( "index.html" ); +$page{'tower_R4'} -> path2main ( "../../" ); +$page{'tower_R4'} -> menu_items ( 'tower_R4_sys','tower_R4_pkg' ); +$page{'tower_R4'} -> parent ( "plats" ); +$page{'tower_R4'} -> content_files ( "tower_R4.txt" ); +$page{'tower_R4'} -> dynamic_table ( "contents/tables/tower_r4.txt" ); + +$page{'tower_R4_sys'} = Web->new_page(); +$page{'tower_R4_sys'} -> afs_path ( "plats/tower_R4/" ); +$page{'tower_R4_sys'} -> short_title ( "System" ); +$page{'tower_R4_sys'} -> long_title ( "System Info" ); +$page{'tower_R4_sys'} -> file_name ( "sys_info.html" ); +$page{'tower_R4_sys'} -> path2main ( "../../" ); +$page{'tower_R4_sys'} -> parent ( "plats/tower_R4" ); +$page{'tower_R4_sys'} -> content_files ( "tower_R4.txt" ); +$page{'tower_R4_sys'} -> dynamic_table ( "contents/tables/tower_r4_sys.txt" ); + +#$page{'tower_R4_pkg'} = Web->new_page(); +#$page{'tower_R4_pkg'} -> afs_path ( "plats/tower_R4/" ); +#$page{'tower_R4_pkg'} -> short_title ( "Package" ); +#$page{'tower_R4_pkg'} -> long_title ( "Package Details" ); +#$page{'tower_R4_pkg'} -> file_name ( "pkg_info.html" ); +#$page{'tower_R4_pkg'} -> path2main ( "../../" ); +#$page{'tower_R4_pkg'} -> parent ( "plats/tower_R4" ); +#$page{'tower_R4_pkg'} -> content_files ( "tower_R4.txt","tower_R4_pkg.txt" ); + + +#This page will be replaced by the contents of buoy_data +$page{'buoy'} = Web->new_page(); +$page{'buoy'} -> afs_path ( "plats/buoy/" ); +$page{'buoy'} -> short_title ( "Buoy" ); +$page{'buoy'} -> long_title ( "Cape Lookout Buoy" ); +$page{'buoy'} -> file_name ( "index.html" ); +$page{'buoy'} -> path2main ( "../../" ); +$page{'buoy'} -> parent ( "plats" ); +$page{'buoy'} -> content_files ( "buoy.txt" ); + +$page{'buoy_data'} = Web->new_page(); +$page{'buoy_data'} -> afs_path ( "plats/buoy/" ); +$page{'buoy_data'} -> short_title ( "Buoy" ); +$page{'buoy_data'} -> long_title ( "Cape Lookout Buoy" ); +$page{'buoy_data'} -> file_name ( "data_test.html" ); +$page{'buoy_data'} -> path2main ( "../../" ); +$page{'buoy_data'} -> parent ( "plats/buoy" ); +$page{'buoy_data'} -> content_files ( "buoy_lsrb.txt" ); +$page{'buoy_data'} -> dynamic_table ( "contents/tables/buoy_lsrb.txt" ); + +$page{'buoy_sys'} = Web->new_page(); +$page{'buoy_sys'} -> afs_path ( "plats/buoy/" ); +$page{'buoy_sys'} -> short_title ( "Buoy" ); +$page{'buoy_sys'} -> long_title ( "Cape Lookout Buoy" ); +$page{'buoy_sys'} -> file_name ( "sys_test.html" ); +$page{'buoy_sys'} -> path2main ( "../../" ); +$page{'buoy_sys'} -> parent ( "plats/buoy" ); +$page{'buoy_sys'} -> content_files ( "buoy_lsrb.txt" ); +$page{'buoy_sys'} -> dynamic_table ( "contents/tables/buoy_lsrb_sys.txt" ); + +$page{'buoy_pkg'} = Web->new_page(); +$page{'buoy_pkg'} -> afs_path ( "plats/buoy/" ); +$page{'buoy_pkg'} -> short_title ( "Buoy" ); +$page{'buoy_pkg'} -> long_title ( "Cape Lookout Buoy" ); +$page{'buoy_pkg'} -> file_name ( "pkg_test.html" ); +$page{'buoy_pkg'} -> path2main ( "../../" ); +$page{'buoy_pkg'} -> parent ( "plats/buoy" ); +$page{'buoy_pkg'} -> content_files ( "buoy_lsrb.txt", "buoy_pkg.txt" ); + + +$page{'neuse'} = Web->new_page(); +$page{'neuse'} -> afs_path ( "plats/neuse/" ); +$page{'neuse'} -> short_title ( "Neuse" ); +$page{'neuse'} -> long_title ( "Neuse River Profiling Station" ); +$page{'neuse'} -> file_name ( "index.html" ); +$page{'neuse'} -> path2main ( "../../" ); +$page{'neuse'} -> parent ( "plats" ); +$page{'neuse'} -> content_files ( "neuse.txt" ); + + +$page{'roof'} = Web->new_page(); +$page{'roof'} -> afs_path ( "plats/roof/" ); +$page{'roof'} -> short_title ( "Roof" ); +$page{'roof'} -> long_title ( "Roof Development Package" ); +$page{'roof'} -> file_name ( "index.html" ); +$page{'roof'} -> path2main ( "../../" ); +$page{'roof'} -> parent ( "plats" ); +$page{'roof'} -> menu_items ( 'roof_sys','roof_pkg' ); +$page{'roof'} -> content_files ( "roof.txt" ); +$page{'roof'} -> dynamic_table ( "contents/tables/roof.txt" ); + +$page{'roof_sys'} = Web->new_page(); +$page{'roof_sys'} -> afs_path ( "plats/roof/" ); +$page{'roof_sys'} -> short_title ( "System" ); +$page{'roof_sys'} -> long_title ( "System Info" ); +$page{'roof_sys'} -> file_name ( "sys_info.html" ); +$page{'roof_sys'} -> path2main ( "../../" ); +$page{'roof_sys'} -> parent ( "plats/roof" ); +$page{'roof_sys'} -> content_files ( "roof.txt","roof_sys.txt" ); +$page{'roof_sys'} -> dynamic_table ( "contents/tables/roof_sys.txt" ); + +$page{'roof_pkg'} = Web->new_page(); +$page{'roof_pkg'} -> afs_path ( "plats/roof/" ); +$page{'roof_pkg'} -> short_title ( "Package" ); +$page{'roof_pkg'} -> long_title ( "Package Details" ); +$page{'roof_pkg'} -> file_name ( "pkg_info.html" ); +$page{'roof_pkg'} -> path2main ( "../../" ); +$page{'roof_pkg'} -> parent ( "plats/roof" ); +#$page{'roof_pkg'} -> articles ( 'roof_daq','roof_com','roof_trans' ); +$page{'roof_pkg'} -> content_files ( "roof.txt","roof_pkg.txt" ); + +$page{'sst'} = Web->new_page(); +$page{'sst'} -> afs_path ( "obs/" ); +#$page{'sst'} -> on_mouseover ('sst_v_w.png'); +$page{'sst'} -> file_name ( "sst.html" ); +$page{'sst'} -> short_title ( "SST" ); +$page{'sst'} -> long_title ( "Sea Surface Temperature" ); +$page{'sst'} -> parent ( "obs" ); +$page{'sst'} -> path2main ( "../" ); +$page{'sst'} -> script_files ( "popup.js" ); +$page{'sst'} -> image_maps ( "obs_sst.map" ); +$page{'sst'} -> content_files ( "sst.txt" ); + +$page{'wind'} = Web->new_page(); +$page{'wind'} -> afs_path ( "obs/" ); +#$page{'wind'} -> on_mouseover ( 'wind_v.png' ); +$page{'wind'} -> file_name ( "wind.html" ); +$page{'wind'} -> short_title ( "Wind" ); +$page{'wind'} -> long_title ( "Wind Velocities" ); +$page{'wind'} -> parent ( "obs" ); +$page{'wind'} -> path2main ( "../" ); +$page{'wind'} -> script_files ( "popup.js" ); +$page{'wind'} -> image_maps ( "obs_wind.map" ); +$page{'wind'} -> content_files ( "wind.txt" ); + +$page{'vel'} = Web->new_page(); +$page{'vel'} -> afs_path ( "obs/" ); +#$page{'vel'} -> on_mouseover ('vel.png'); +$page{'vel'} -> file_name ( "vel.html" ); +$page{'vel'} -> short_title ( "Currents" ); +$page{'vel'} -> long_title ( "Water Velocities" ); +$page{'vel'} -> parent ( "obs" ); +$page{'vel'} -> script_files ( "popup.js" ); +$page{'vel'} -> image_maps ( "obs_vel.map" ); +$page{'vel'} -> path2main ( "../" ); +$page{'vel'} -> content_files ( "vel.txt" ); + +#$page{'salin'} = Web->new_page(); +#$page{'salin'} -> afs_path ( "obs/" ); +#$page{'salin'} -> on_mouseover ('salin_v_w.png'); +#$page{'salin'} -> file_name ( "salin.html" ); +#$page{'salin'} -> short_title ( "Salinity" ); +#$page{'salin'} -> path2main ( "../" ); +#$page{'salin'} -> parent ( "obs" ); + + +$page{'wl'} = Web->new_page(); +$page{'wl'} -> afs_path ( "obs/" ); +#$page{'wl'} -> on_mouseover ('wl_v_w.png'); +$page{'wl'} -> file_name ( "wl.html" ); +$page{'wl'} -> short_title ( "Water Level" ); +$page{'wl'} -> long_title ( "Water Level" ); +$page{'wl'} -> path2main ( "../" ); +$page{'wl'} -> parent ( "obs" ); +$page{'wl'} -> content_files ( "wl.txt" ); + +$page{'radial'} = Web->new_page(); +#$page{'radial'} -> on_mouseover ('radial.png'); +$page{'radial'} -> afs_path ( "obs/" ); +$page{'radial'} -> file_name ( "radial.html" ); +$page{'radial'} -> short_title ( "Radials" ); +$page{'radial'} -> long_title ( "Radial Surface Velocities" ); +$page{'radial'} -> path2main ( "../" ); +$page{'radial'} -> parent ( "obs" ); +$page{'radial'} -> content_files ( "radial.txt" ); + + +$page{'exper'} = Web->new_page(); +$page{'exper'} -> afs_path ( "" ); +#$page{'exper'} -> file_name ( "" ); +$page{'exper'} -> short_title ( "Note: Experimental!" ); +$page{'exper'} -> path2main ( "../" ); + +$page{'adcirc'} = Web->new_page(); +$page{'adcirc'} -> afs_path ( "mods/adcirc/" ); +$page{'adcirc'} -> file_name ( "index.html" ); +$page{'adcirc'} -> short_title ( "ADCIRC" ); +$page{'adcirc'} -> long_title ( "ADCIRC Tidal and Wind Model" ); +$page{'adcirc'} -> path2main ( "../../" ); +$page{'adcirc'} -> content_files ( "adcirc.txt" ); +#$page{'adcirc'} -> menu_items ( 'adcirc_wl','adcirc_suv' ); +$page{'adcirc'} -> parent ( "mods" ); + +$page{'adcirc_wl'} = Web->new_page(); +$page{'adcirc_wl'} -> afs_path ( "mods/adcirc/" ); +$page{'adcirc_wl'} -> file_name ( "adcirc_wl.html" ); +$page{'adcirc_wl'} -> short_title ( "Water Level" ); +$page{'adcirc_wl'} -> long_title ( "ADCIRC Water Level" ); +$page{'adcirc_wl'} -> path2main ( "../../" ); +$page{'adcirc_wl'} -> content_files ( "adcirc_wl.txt" ); +$page{'adcirc_wl'} -> parent ( "mods/adcirc" ); + +$page{'adcirc_suv'} = Web->new_page(); +$page{'adcirc_suv'} -> afs_path ( "mods/adcirc/" ); +$page{'adcirc_suv'} -> file_name ( "adcirc_suv.html" ); +$page{'adcirc_suv'} -> short_title ( "Currents" ); +$page{'adcirc_suv'} -> long_title ( "ADCIRC Surface Currents" ); +$page{'adcirc_suv'} -> path2main ( "../../" ); +$page{'adcirc_suv'} -> content_files ( "adcirc_suv.txt" ); +$page{'adcirc_suv'} -> parent ( "mods/adcirc" ); + + +$page{'quoddy'} = Web->new_page(); +$page{'quoddy'} -> afs_path ( "mods/quoddy/" ); +$page{'quoddy'} -> file_name ( "index.html" ); +$page{'quoddy'} -> short_title ( "QUODDY" ); +$page{'quoddy'} -> long_title ( "QUODDY Tidal and Wind Model" ); +$page{'quoddy'} -> path2main ( "../../" ); +$page{'quoddy'} -> content_files ( "quoddy.txt" ); +$page{'quoddy'} -> menu_items ( 'quoddy_sst','quoddy_suv' ); +$page{'quoddy'} -> parent ( "mods" ); + +$page{'quoddy_sst'} = Web->new_page(); +$page{'quoddy_sst'} -> afs_path ( "mods/quoddy/" ); +$page{'quoddy_sst'} -> file_name ( "quoddy_sst.html" ); +$page{'quoddy_sst'} -> short_title ( "SST" ); +$page{'quoddy_sst'} -> long_title ( "QUODDY Sea Surface Temperature" ); +$page{'quoddy_sst'} -> path2main ( "../../" ); +$page{'quoddy_sst'} -> content_files ( "quoddy_sst.txt" ); +$page{'quoddy_sst'} -> parent ( "mods/quoddy" ); + +$page{'quoddy_wl'} = Web->new_page(); +$page{'quoddy_wl'} -> afs_path ( "mods/quoddy/" ); +$page{'quoddy_wl'} -> file_name ( "quoddy_wl.html" ); +$page{'quoddy_wl'} -> short_title ( "Water Level" ); +$page{'quoddy_wl'} -> long_title ( "QUODDY Water Level" ); +$page{'quoddy_wl'} -> path2main ( "../../" ); +$page{'quoddy_wl'} -> content_files ( "quoddy_wl.txt" ); +$page{'quoddy_wl'} -> parent ( "mods/quoddy" ); + +$page{'quoddy_suv'} = Web->new_page(); +$page{'quoddy_suv'} -> afs_path ( "mods/quoddy/" ); +$page{'quoddy_suv'} -> file_name ( "quoddy_suv.html" ); +$page{'quoddy_suv'} -> short_title ( "Currents" ); +$page{'quoddy_suv'} -> long_title ( "QUODDY Surface Currents" ); +$page{'quoddy_suv'} -> path2main ( "../../" ); +$page{'quoddy_suv'} -> content_files ( "quoddy_suv.txt" ); +$page{'quoddy_suv'} -> parent ( "mods/quoddy" ); + +$page{'eta'} = Web->new_page(); +$page{'eta'} -> afs_path ( "mods/eta/" ); +$page{'eta'} -> file_name ( "index.html" ); +$page{'eta'} -> short_title ( "ETA" ); +$page{'eta'} -> long_title ( "ETA Atmospheric Model" ); +$page{'eta'} -> path2main ( "../../" ); +$page{'eta'} -> content_files ( "eta.txt" ); +$page{'eta'} -> menu_items ( 'eta_wind','eta_sst' ); +$page{'eta'} -> parent ( "mods" ); + +$page{'eta_wind'} = Web->new_page(); +$page{'eta_wind'} -> afs_path ( "mods/eta/" ); +$page{'eta_wind'} -> file_name ( "eta_wind.html" ); +$page{'eta_wind'} -> short_title ( "Wind" ); +$page{'eta_wind'} -> long_title ( "ETA Wind Velocity" ); +$page{'eta_wind'} -> path2main ( "../../" ); +$page{'eta_wind'} -> content_files ( "eta_wind.txt" ); +$page{'eta_wind'} -> parent ( "mods/eta" ); + +$page{'eta_sst'} = Web->new_page(); +$page{'eta_sst'} -> afs_path ( "mods/eta/" ); +$page{'eta_sst'} -> file_name ( "eta_sst.html" ); +$page{'eta_sst'} -> short_title ( "SST" ); +$page{'eta_sst'} -> long_title ( "ETA Sea Surface Temperature" ); +$page{'eta_sst'} -> path2main ( "../../" ); +$page{'eta_sst'} -> content_files ( "eta_sst.txt" ); +$page{'eta_sst'} -> parent ( "mods/eta" ); + +$page{'blank'} = Web->new_page(); +$page{'blank'} -> afs_path ( "" ); +$page{'blank'} -> short_title ( '' ); +$page{'blank'} -> long_title ( "" ); +$page{'blank'} -> path2main ( "" ); + + + +#$page{'hycom'} = Web->new_page(); +#$page{'hycom'} -> afs_path ( "mods/" ); +#$page{'hycom'} -> file_name ( "hycom.html" ); +#$page{'hycom'} -> short_title ( "HYCOM" ); +#$page{'hycom'} -> path2main ( "../" ); + + +#$page{'latest'} = Web->new_page(); +#$page{'latest'} -> afs_path ( "data/" ); +#$page{'latest'} -> file_name ( "latest_v2.0" ); +#$page{'latest'} -> short_title ( "Latest Real-Time Data" ); +#$page{'latest'} -> path2main ( "../" ); + + +$article{'obs'} = Web->new_article(); +$article{'obs'} -> short_title ( "Observations" ); +$article{'obs'} -> long_title ( "Merged Maps" ); +$article{'obs'} -> target_url ( "obs/" ); +#$article{'obs'} -> thumbnail ( "obs_thumb.png" ); +$article{'obs'} -> thumbnail ( "img/blank_map_thumb.png" ); +$article{'obs'} -> content_files ( "obs.txt" ); + +$article{'currents'} = Web->new_article(); +$article{'currents'} -> short_title ( "Currents" ); +$article{'currents'} -> long_title ( "Sea Surface Currents" ); +#$article{'currents'} -> target_url ( "img/rt/vel.png" ); +$article{'currents'} -> target_url ( "obs/vel.html" ); +#$article{'currents'} -> thumbnail ( "obs_thumb.png" ); +$article{'currents'} -> thumbnail ( "img/obs/suv_latest_thumb.png" ); +$article{'currents'} -> content_files ( "currents.txt" ); + +$article{'winds'} = Web->new_article(); +$article{'winds'} -> short_title ( "Winds" ); +$article{'winds'} -> long_title ( "Wind Veolcities" ); +$article{'winds'} -> target_url ( "obs/wind.html" ); +$article{'winds'} -> thumbnail ( "img/obs/wind_latest_thumb.png" ); +$article{'winds'} -> content_files ( "winds.txt" ); + +$article{'sst'} = Web->new_article(); +$article{'sst'} -> short_title ( "SST" ); +$article{'sst'} -> long_title ( "Sea Surface Temperature" ); +$article{'sst'} -> target_url ( "obs/sst.html" ); +$article{'sst'} -> thumbnail ( "img/obs/sst_latest_thumb.png" ); +$article{'sst'} -> content_files ( "sst.txt" ); + +$article{'wl'} = Web->new_article(); +$article{'wl'} -> short_title ( "Water Level" ); +$article{'wl'} -> long_title ( "Water Level" ); +$article{'wl'} -> target_url ( "obs/wl.html" ); +#$article{'wl'} -> thumbnail ( "wl_thumb.png" ); +$article{'wl'} -> thumbnail ( "img/obs/wl_latest_thumb.png" ); +$article{'wl'} -> content_files ( "wl.txt" ); + +#$article{'salin'} = Web->new_article(); +#$article{'salin'} -> short_title ( "Salinity" ); +#$article{'salin'} -> long_title ( "Surface Salinity" ); +#$article{'salin'} -> target_url ( "obs/salin.html" ); +#$article{'salin'} -> thumbnail ( "salin_thumb.png" ); +#$article{'salin'} -> thumbnail ( "example.png" ); +#$article{'salin'} -> content_files ( "salin.txt" ); + +$article{'radial'} = Web->new_article(); +$article{'radial'} -> short_title ( "Radials" ); +$article{'radial'} -> long_title ( "Surface Current Radial Components " ); +$article{'radial'} -> target_url ( "obs/radial.html" ); +#$article{'radial'} -> thumbnail ( "radial_thumb.png" ); +$article{'radial'} -> thumbnail ( "img/blank_map_thumb.png" ); +$article{'radial'} -> content_files ( "radials.txt" ); + +$article{'radar'} = Web->new_article(); +$article{'radar'} -> short_title ( "Radar" ); +$article{'radar'} -> long_title ( "Surface Current Radar Observations" ); +$article{'radar'} -> target_url ( "plats/radar/" ); +#$article{'radar'} -> thumbnail ( "radar_thumb.png" ); +$article{'radar'} -> thumbnail ( "img/thumbnails/codar_receive.jpg" ); +$article{'radar'} -> content_files ( "radar.txt" ); + +$article{'tower_R4'} = Web->new_article(); +$article{'tower_R4'} -> short_title ( "Tower R4" ); +$article{'tower_R4'} -> long_title ( "Tower R4 Package" ); +$article{'tower_R4'} -> target_url ( "plats/tower_R4/" ); +#$article{'tower_R4'} -> thumbnail ( "tower_R4_thumb.png" ); +$article{'tower_R4'} -> thumbnail ( "img/thumbnails/r8_tower.jpg" ); +$article{'tower_R4'} -> content_files ( "tower_R4.txt" ); + +$article{'buoy'} = Web->new_article(); +$article{'buoy'} -> short_title ( "Buoy" ); +$article{'buoy'} -> long_title ( "Cape Lookout Buoy" ); +$article{'buoy'} -> target_url ( "plats/buoy/" ); +#$article{'buoy'} -> thumbnail ( "buoy_thumb.png" ); +$article{'buoy'} -> thumbnail ( "img/thumbnails/buoy_unload2.png" ); +$article{'buoy'} -> content_files ( "buoy.txt" ); + +$article{'neuse'} = Web->new_article(); +$article{'neuse'} -> short_title ( "Neuse" ); +$article{'neuse'} -> long_title ( "Neuse River Profiler" ); +$article{'neuse'} -> target_url ( "plats/neuse/" ); +#$article{'neuse'} -> thumbnail ( "neuse_thumb.png" ); +$article{'neuse'} -> thumbnail ( "img/thumbnails/neuse_platform2.png" ); +$article{'neuse'} -> content_files ( "neuse.txt" ); + +$article{'roof'} = Web->new_article(); +$article{'roof'} -> short_title ( "Development" ); +$article{'roof'} -> long_title ( "Development Package for Towers and Buoys" ); +$article{'roof'} -> target_url ( "plats/roof/" ); +#$article{'roof'} -> thumbnail ( "roof_thumb.png" ); +$article{'roof'} -> thumbnail ( "img/thumbnails/roof_pkg.jpg" ); +$article{'roof'} -> content_files ( "roof.txt" ); + +$article{'roof_daq'} = Web->new_article(); +$article{'roof_daq'} -> short_title ( "DAQ" ); +$article{'roof_daq'} -> long_title ( "Data Acquisition Package" ); +#$article{'roof_daq'} -> target_url ( "plats/roof/" ); +#$article{'roof'} -> thumbnail ( "roof_thumb.png" ); +#$article{'roof_daq'} -> thumbnail ( "roof_pkg.jpg" ); +$article{'roof_daq'} -> content_files ( "roof_daq.txt" ); + +$article{'roof_com'} = Web->new_article(); +$article{'roof_com'} -> short_title ( "ComLib" ); +$article{'roof_com'} -> long_title ( "Communications Library" ); +#$article{'roof_com'} -> target_url ( "plats/roof/" ); +#$article{'roof'} -> thumbnail ( "roof_thumb.png" ); +#$article{'roof_com'} -> thumbnail ( "roof_pkg.jpg" ); +$article{'roof_com'} -> content_files ( "roof_com.txt" ); + +$article{'roof_trans'} = Web->new_article(); +$article{'roof_trans'} -> short_title ( "Transfer" ); +$article{'roof_trans'} -> long_title ( "Data Transfer Package" ); +#$article{'roof_trans'} -> target_url ( "plats/roof/" ); +#$article{'roof'} -> thumbnail ( "roof_thumb.png" ); +#$article{'roof_trans'} -> thumbnail ( "roof_pkg.jpg" ); +$article{'roof_trans'} -> content_files ( "roof_trans.txt" ); + + Index: tower_buoy/bin/meta_data/nccoos_page_info_orgtest.pm =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/nccoos_page_info_orgtest.pm (revision 7) @@ -1,0 +1,261 @@ +#meta_data.pm +#Time-stamp: <2006-04-06 16:45:47 lstearns> +# +#Abstract: This module will read in tables of tower related meta data +# and output hash arrays of the information based on param id. Hacked +# together from the subroutine in tower_parse.perl and perl_defs.pm, +# a piece of code from Brian Blanton (Thanks Brian!!). + +# perl defs and subroutines common to quoddy nc/fc runs +# v11/07/2001 B.O.B. +# v02/09/2002 B.O.B. to work out of dmf +# v06/04/2002 B.O.B. added initial da stuff +# v19/08/2002 B.O.B. fixes for changes to "edu" from "com" +# v13/09/2002 B.O.B. added truxton stuff +# v13/12/2002 B.O.B. version for casco4b inclusion/ ssh assim +# vxx/09/2003 B.O.B. modified for SEACOOS +# v15/02/2004 B.O.B. turned into perl package provider (seacoos_sab_defs) + + +package nccoos_page_info_orgtest; # assumes seacoos_sab_defs.pm + +use strict; +use warnings; +use vars qw(); +#use lib '/opt/local/seacoos/bin/'; +#use Web_dev; + +BEGIN{ + use Exporter (); + + our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); + + $VERSION="1.0"; + + @ISA = qw(Exporter); + + @EXPORT = qw( + %page %article + ); + + @EXPORT_OK=(); +} + + +our(%page,%article + ); + +#my( +# ); + +###################################################################### +# Enter Page Data +###################################################################### + + + +###################################################################### +## Platforms Main Page ## ~/obs/index_test.html ## +###################################################################### + +$page{'plats'} = Web->new_page(); +$page{'plats'} -> afs_path ( "plats/" ); +$page{'plats'} -> path2main ( "../" ); +$page{'plats'} -> file_name ( "index_test.html" ); +$page{'plats'} -> short_title ( "Platforms" ); +$page{'plats'} -> long_title ( "Observation Platforms Operated ". + "by NC-COOS" ); +$page{'plats'} -> menu_items ( 'radar','tower_R4','buoy','jpop','neuse', + 'roof' ); +$page{'plats'} -> menu_type ( "vertical" ); +$page{'plats'} -> script_files ( "plats_page.js" ); +$page{'plats'} -> content_files ( "plats.txt" ); +#$page{'plats'} -> articles ( 'radar','tower_R4','buoy','jpop','neuse', +# 'roof' ); + +###################################################################### +## Menu Entries ###################################################### +###################################################################### + +$page{'radar'} = Web->new_page(); +$page{'radar'} -> afs_path ( "plats/radar/" ); +$page{'radar'} -> short_title ( "HF Radar" ); +$page{'radar'} -> long_title ( "Surface Current Radar" ); +$page{'radar'} -> file_name ( "index_test.html" ); +$page{'radar'} -> path2main ( "../../" ); +$page{'radar'} -> parent ( "plats" ); +$page{'radar'} -> menu_items ( 'radar_comp','radar_pub' ); +$page{'radar'} -> content_files ( "radar_1.txt", + #"radar_2.txt", + "technical.txt", + "radar_3.txt"); + #"radar_4.txt"); +#$page{'radar'} -> dynamic_table ( "contents/tables/codar_suv.txt" ); +#$page{'radar'} -> script_files ( 'loc_data.js' ); + +$page{'radar_hist'} = Web->new_page(); +$page{'radar_hist'} -> afs_path ( "plats/radar/" ); +$page{'radar_hist'} -> short_title ( "HF Radar" ); +$page{'radar_hist'} -> long_title ( "Surface Current Radar (Historical)" ); +$page{'radar_hist'} -> file_name ( "historical_test.html" ); +$page{'radar_hist'} -> path2main ( "../../" ); +$page{'radar_hist'} -> parent ( "plats/radar" ); +$page{'radar_hist'} -> content_files ( "radar_1.txt", + "radar_3.fix1", + "radar_anim_script.txt", + "radar_3.fix2", + "radar_anim.txt", + "radar_3.fix3"); + +$page{'radar_pub'} = Web->new_page(); +$page{'radar_pub'} -> afs_path ( "plats/radar/" ); +$page{'radar_pub'} -> short_title ( "Publications" ); +$page{'radar_pub'} -> long_title ( "Publications and Presentations" ); +$page{'radar_pub'} -> file_name ( "radar_pub_test.html" ); +$page{'radar_pub'} -> path2main ( "../../" ); +$page{'radar_pub'} -> parent ( "plats/radar" ); +$page{'radar_pub'} -> content_files ( "radar_1.txt","radar_pub.txt" ); + +$page{'radar_comp'} = Web->new_page(); +$page{'radar_comp'} -> afs_path ( "plats/radar/" ); +$page{'radar_comp'} -> short_title ( "Compare" ); +$page{'radar_comp'} -> long_title ( "Data Comparissons" ); +$page{'radar_comp'} -> file_name ( "radar_comp_test.html" ); +$page{'radar_comp'} -> path2main ( "../../" ); +$page{'radar_comp'} -> parent ( "plats/radar" ); +$page{'radar_comp'} -> content_files ( "radar_1.txt","radar_comp.txt" ); + +$page{'radar_analysis'} = Web->new_page(); +$page{'radar_analysis'} -> afs_path ( "plats/radar/" ); +$page{'radar_analysis'} -> short_title ( "Analysis" ); +$page{'radar_analysis'} -> long_title ( "Data Analysis" ); +$page{'radar_analysis'} -> file_name ( "radar_analysis_test.html" ); +$page{'radar_analysis'} -> path2main ( "../../" ); +$page{'radar_analysis'} -> parent ( "plats/radar" ); +$page{'radar_analysis'} -> content_files ( "radar_1.txt","radar_analysis.txt" ); + +$page{'tower_R4'} = Web->new_page(); +$page{'tower_R4'} -> afs_path ( "plats/tower_R4/" ); +$page{'tower_R4'} -> short_title ( "R4 Tower" ); +$page{'tower_R4'} -> long_title ( "Navy Tower R4" ); +$page{'tower_R4'} -> file_name ( "index_test.html" ); +$page{'tower_R4'} -> path2main ( "../../" ); +$page{'tower_R4'} -> menu_items ( 'tower_R4_sys','tower_R4_pkg' ); +$page{'tower_R4'} -> parent ( "plats" ); +$page{'tower_R4'} -> content_files ( "tower_R4.txt" ); +$page{'tower_R4'} -> dynamic_table ( "contents/tables/tower_r4.txt" ); + +$page{'tower_R4_sys'} = Web->new_page(); +$page{'tower_R4_sys'} -> afs_path ( "plats/tower_R4/" ); +$page{'tower_R4_sys'} -> short_title ( "System" ); +$page{'tower_R4_sys'} -> long_title ( "System Info" ); +$page{'tower_R4_sys'} -> file_name ( "sys_info_test.html" ); +$page{'tower_R4_sys'} -> path2main ( "../../" ); +$page{'tower_R4_sys'} -> parent ( "plats/tower_R4" ); +$page{'tower_R4_sys'} -> content_files ( "tower_R4.txt" ); +$page{'tower_R4_sys'} -> dynamic_table ( "contents/tables/tower_r4_sys.txt" ); + + +$page{'buoy'} = Web->new_page(); +$page{'buoy'} -> afs_path ( "plats/buoy/" ); +$page{'buoy'} -> short_title ( "Buoy" ); +$page{'buoy'} -> long_title ( "Lookout Shoals Research Buoy" ); +$page{'buoy'} -> file_name ( "index_test.html" ); +$page{'buoy'} -> path2main ( "../../" ); +$page{'buoy'} -> parent ( "plats" ); +$page{'buoy'} -> menu_items ( 'buoy_sys','buoy_pkg' ); +$page{'buoy'} -> content_files ( "buoy_lsrb.txt" ); +# "buoy_down.txt" ); +# "technical.txt" ); +$page{'buoy'} -> script_files ( "popup.js" ); +$page{'buoy'} -> dynamic_table ( "contents/tables/buoy_lsrb.txt"); + #"contents/tables/buoy_lsrb_surf.txt", + #"contents/tables/buoy_lsrb_midw.txt"); + +$page{'buoy_sys'} = Web->new_page(); +$page{'buoy_sys'} -> afs_path ( "plats/buoy/" ); +$page{'buoy_sys'} -> short_title ( "System" ); +$page{'buoy_sys'} -> long_title ( "Buoy System Data" ); +$page{'buoy_sys'} -> file_name ( "sys_test.html" ); +$page{'buoy_sys'} -> path2main ( "../../" ); +$page{'buoy_sys'} -> parent ( "plats/buoy" ); +$page{'buoy_sys'} -> content_files ( "buoy_lsrb.txt" );#,"buoy_down.txt"); +$page{'buoy_sys'} -> dynamic_table ( "contents/tables/buoy_lsrb_sys.txt" ); + +$page{'buoy_pkg'} = Web->new_page(); +$page{'buoy_pkg'} -> afs_path ( "plats/buoy/" ); +$page{'buoy_pkg'} -> short_title ( "Package" ); +$page{'buoy_pkg'} -> long_title ( "Buoy Package Info" ); +$page{'buoy_pkg'} -> file_name ( "pkg_test_test.html" ); +$page{'buoy_pkg'} -> path2main ( "../../" ); +$page{'buoy_pkg'} -> parent ( "plats/buoy" ); +$page{'buoy_pkg'} -> content_files ( "buoy_lsrb.txt", "buoy_pkg.txt" ); + + +$page{'jpop'} = Web->new_page(); +$page{'jpop'} -> afs_path ( "plats/jpop/" ); +$page{'jpop'} -> short_title ( "JPOP" ); +$page{'jpop'} -> long_title ( "Jennette's Pier Observing Partnership" ); +$page{'jpop'} -> file_name ( "index_test.html" ); +$page{'jpop'} -> path2main ( "../../" ); +$page{'jpop'} -> parent ( "plats" ); +$page{'jpop'} -> content_files ( "jpop.txt" ); + + +$page{'neuse'} = Web->new_page(); +$page{'neuse'} -> afs_path ( "plats/neuse/" ); +$page{'neuse'} -> short_title ( "Neuse" ); +$page{'neuse'} -> long_title ( "Neuse River Profiling Station" ); +$page{'neuse'} -> file_name ( "index_test.html" ); +$page{'neuse'} -> path2main ( "../../" ); +$page{'neuse'} -> parent ( "plats" ); +$page{'neuse'} -> content_files ( "neuse.txt" ); + + +$page{'roof'} = Web->new_page(); +$page{'roof'} -> afs_path ( "plats/roof/" ); +$page{'roof'} -> short_title ( "Roof" ); +$page{'roof'} -> long_title ( "Roof Development Package" ); +$page{'roof'} -> file_name ( "index_test.html" ); +$page{'roof'} -> path2main ( "../../" ); +$page{'roof'} -> parent ( "plats" ); +$page{'roof'} -> menu_items ( 'roof_sys','roof_pkg' ); +$page{'roof'} -> content_files ( "roof.txt" ); +$page{'roof'} -> dynamic_table ( "contents/tables/roof.txt" ); + +$page{'roof_sys'} = Web->new_page(); +$page{'roof_sys'} -> afs_path ( "plats/roof/" ); +$page{'roof_sys'} -> short_title ( "System" ); +$page{'roof_sys'} -> long_title ( "System Info" ); +$page{'roof_sys'} -> file_name ( "sys_info_test.html" ); +$page{'roof_sys'} -> path2main ( "../../" ); +$page{'roof_sys'} -> parent ( "plats/roof" ); +$page{'roof_sys'} -> content_files ( "roof.txt","roof_sys.txt" ); +$page{'roof_sys'} -> dynamic_table ( "contents/tables/roof_sys.txt" ); + +$page{'roof_pkg'} = Web->new_page(); +$page{'roof_pkg'} -> afs_path ( "plats/roof/" ); +$page{'roof_pkg'} -> short_title ( "Package" ); +$page{'roof_pkg'} -> long_title ( "Package Details" ); +$page{'roof_pkg'} -> file_name ( "pkg_info_test.html" ); +$page{'roof_pkg'} -> path2main ( "../../" ); +$page{'roof_pkg'} -> parent ( "plats/roof" ); +#$page{'roof_pkg'} -> articles ( 'roof_daq','roof_com','roof_trans' ); +$page{'roof_pkg'} -> content_files ( "roof.txt","roof_pkg.txt" ); + + + +$page{'blank'} = Web->new_page(); +$page{'blank'} -> afs_path ( "" ); +$page{'blank'} -> short_title ( '' ); +$page{'blank'} -> long_title ( "" ); +$page{'blank'} -> path2main ( "" ); + + +$article{'radar'} = Web->new_article(); +$article{'radar'} -> short_title ( "Radar" ); +$article{'radar'} -> long_title ( "Surface Current Radar Observations" ); +$article{'radar'} -> target_url ( "plats/radar/" ); +#$article{'radar'} -> thumbnail ( "radar_thumb.png" ); +$article{'radar'} -> thumbnail ( "img/thumbnails/codar_receive.jpg" ); +$article{'radar'} -> content_files ( "radar.txt" ); Index: tower_buoy/bin/meta_data/nccoos_page_info_test.pm =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/nccoos_page_info_test.pm (revision 7) @@ -1,0 +1,665 @@ +#meta_data.pm +#Time-stamp: <2006-06-26 15:08:03 lstearns> +# +#Abstract: This module will read in tables of tower related meta data +# and output hash arrays of the information based on param id. Hacked +# together from the subroutine in tower_parse.perl and perl_defs.pm, +# a piece of code from Brian Blanton (Thanks Brian!!). + +# perl defs and subroutines common to quoddy nc/fc runs +# v11/07/2001 B.O.B. +# v02/09/2002 B.O.B. to work out of dmf +# v06/04/2002 B.O.B. added initial da stuff +# v19/08/2002 B.O.B. fixes for changes to "edu" from "com" +# v13/09/2002 B.O.B. added truxton stuff +# v13/12/2002 B.O.B. version for casco4b inclusion/ ssh assim +# vxx/09/2003 B.O.B. modified for SEACOOS +# v15/02/2004 B.O.B. turned into perl package provider (seacoos_sab_defs) + + +package nccoos_page_info; # assumes seacoos_sab_defs.pm + +use strict; +use warnings; +use vars qw(); +#use lib '/opt/local/seacoos/bin/'; +#use Web_dev; + +BEGIN{ + use Exporter (); + + our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); + + $VERSION="1.0"; + + @ISA = qw(Exporter); + + @EXPORT = qw( + %page %article + ); + + @EXPORT_OK=(); +} + + +our(%page,%article + ); + +#my( +# ); + + + + + +###################################################################### +# Enter Page Data +###################################################################### + + +###################################################################### +## Main Page ## ~/index.html ## +###################################################################### + +#$page{'main'} = Web->new_page(); +#$page{'main'} -> afs_path ( "" ); +#$page{'main'} -> path2main ( "" ); +#$page{'main'} -> file_name ( "index.html" ); +#$page{'main'} -> short_title ( "Main" ); +#$page{'main'} -> long_title ( "North Carolina Coastal ". + "Ocean Observing System" ); +##$page{'main'} -> menu_items ( 'main','obs','mods','data' ); +##$page{'main'} -> menu_type ( "vertical" ); +#$page{'main'} -> content_files ( "main.txt" ); + + +###################################################################### +## Platforms Main Page ## ~/obs/index.html ## +###################################################################### + +#$page{'plats'} = Web->new_page(); +#$page{'plats'} -> afs_path ( "plats/" ); +#$page{'plats'} -> path2main ( "../" ); +#$page{'plats'} -> file_name ( "index.html" ); +#$page{'plats'} -> short_title ( "Platforms" ); +#$page{'plats'} -> long_title ( "Observation Platforms Operated ". + "by NC-COOS" ); +#$page{'plats'} -> menu_items ( 'radar','tower_R4','buoy','jpop','neuse', + 'roof' ); +#$page{'plats'} -> menu_type ( "vertical" ); +#$page{'plats'} -> script_files ( "plats_page.js" ); +#$page{'plats'} -> content_files ( "plats.txt" ); +#$page{'plats'} -> articles ( 'radar','tower_R4','buoy','jpop','neuse', + 'roof' ); + +###################################################################### +## Observations Main Page ## ~/obs/index.html ## +###################################################################### + +#$page{'obs'} = Web->new_page(); +#$page{'obs'} -> afs_path ( "obs/" ); +#$page{'obs'} -> path2main ( "../" ); +#$page{'obs'} -> file_name ( "index.html" ); +#$page{'obs'} -> short_title ( "Merged Maps" ); +#$page{'obs'} -> long_title ( "Observations of Oceanic and ". + "Atmospheric Conditions" ); +#$page{'obs'} -> menu_items ( 'vel','wind','sst','wl','salin','waves'); +#$page{'obs'} -> menu_type ( "vertical" ); +#$page{'obs'} -> script_files ( "obs_page.js" ); +##$page{'obs'} -> content_files ( "obs.txt" ); +#$page{'obs'} -> articles ( 'currents','winds','sst','wl'); + + +###################################################################### +## Modeling Main Page ## ~/mods/index.html ## +###################################################################### + +#$page{'mods'} = Web->new_page(); +#$page{'mods'} -> afs_path ( "mods/" ); +#$page{'mods'} -> path2main ( "../" ); +#$page{'mods'} -> file_name ( "index.html" ); +#$page{'mods'} -> short_title ( "Models" ); +#$page{'mods'} -> long_title ( "Physical Models of Oceanic and ". + "Atmospheric Conditions" ); +#$page{'mods'} -> menu_items ('adcirc','quoddy','eta'); +#$page{'mods'} -> menu_type ( "horizontal" ); +#$page{'mods'} -> content_files ( "mods.txt" ); + + +###################################################################### +## Data Access Main Page ## ~/data/index.html ## +###################################################################### + +#$page{'data'} = Web->new_page(); +#$page{'data'} -> afs_path ( "data/" ); +#$page{'data'} -> path2main ( "../" ); +##$page{'data'} -> file_name ( "data_access.html" ); +##$page{'data'} -> file_name ( "file_access.html" ); +#$page{'data'} -> file_name ( "" ); +#$page{'data'} -> short_title ( "File Access" ); +#$page{'data'} -> long_title ( "Access to Real-Time Data"); +##$page{'data'} -> menu_items ( 'latest');#,'d_obs','d_mods'); +##$page{'data'} -> menu_type ( "vertical" ); +##$page{'data'} -> content_files ( "data_access.txt" ); +##$page{'data'} -> content_files ( "file_access.txt" ); + +###################################################################### +## Data Access Main Page ## ~/cgi-bin/nph-dods/data/ ## +###################################################################### + +#$page{'dods'} = Web->new_page(); +#$page{'dods'} -> afs_path ( "cgi-bin/nph-dods/data/" ); +#$page{'dods'} -> path2main ( "../" ); +#$page{'dods'} -> file_name ( "" ); +#$page{'dods'} -> short_title ( "DODS Access" ); +##$page{'dods'} -> long_title ( "Access to Real-Time Data"); +##$page{'dods'} -> menu_items ( 'latest');#,'d_obs','d_mods'); +##$page{'dods'} -> menu_type ( "vertical" ); +##$page{'dods'} -> content_files ( "contents/dods_page.txt" ); + + + +###################################################################### +## Menu Entries ###################################################### +###################################################################### + +#$page{'radar'} = Web->new_page(); +#$page{'radar'} -> afs_path ( "plats/radar/" ); +#$page{'radar'} -> short_title ( "HF Radar" ); +#$page{'radar'} -> long_title ( "Surface Current Radar" ); +#$page{'radar'} -> file_name ( "index.html" ); +#$page{'radar'} -> path2main ( "../../" ); +#$page{'radar'} -> parent ( "plats" ); +#$page{'radar'} -> menu_items ( 'radar_comp','radar_pub' ); +#$page{'radar'} -> content_files ( "radar_1.txt", + #"radar_2.txt", + "technical.txt", + "radar_3.txt"); + #"radar_4.txt"); +##$page{'radar'} -> dynamic_table ( "contents/tables/codar_suv.txt" ); +##$page{'radar'} -> script_files ( 'loc_data.js' ); + +#$page{'radar_hist'} = Web->new_page(); +#$page{'radar_hist'} -> afs_path ( "plats/radar/" ); +#$page{'radar_hist'} -> short_title ( "HF Radar" ); +#$page{'radar_hist'} -> long_title ( "Surface Current Radar (Historical)" ); +#$page{'radar_hist'} -> file_name ( "historical.html" ); +#$page{'radar_hist'} -> path2main ( "../../" ); +#$page{'radar_hist'} -> parent ( "plats/radar" ); +#$page{'radar_hist'} -> content_files ( "radar_1.txt", + "radar_3.fix1", + "radar_anim_script.txt", + "radar_3.fix2", + "radar_anim.txt", + "radar_3.fix3"); + +#$page{'radar_pub'} = Web->new_page(); +#$page{'radar_pub'} -> afs_path ( "plats/radar/" ); +#$page{'radar_pub'} -> short_title ( "Publications" ); +#$page{'radar_pub'} -> long_title ( "Publications and Presentations" ); +#$page{'radar_pub'} -> file_name ( "radar_pub.html" ); +#$page{'radar_pub'} -> path2main ( "../../" ); +#$page{'radar_pub'} -> parent ( "plats/radar" ); +#$page{'radar_pub'} -> content_files ( "radar_1.txt","radar_pub.txt" ); + +#$page{'radar_comp'} = Web->new_page(); +#$page{'radar_comp'} -> afs_path ( "plats/radar/" ); +#$page{'radar_comp'} -> short_title ( "Compare" ); +#$page{'radar_comp'} -> long_title ( "Data Comparissons" ); +#$page{'radar_comp'} -> file_name ( "radar_comp.html" ); +#$page{'radar_comp'} -> path2main ( "../../" ); +#$page{'radar_comp'} -> parent ( "plats/radar" ); +#$page{'radar_comp'} -> content_files ( "radar_1.txt","radar_comp.txt" ); + +#$page{'radar_analysis'} = Web->new_page(); +#$page{'radar_analysis'} -> afs_path ( "plats/radar/" ); +#$page{'radar_analysis'} -> short_title ( "Analysis" ); +#$page{'radar_analysis'} -> long_title ( "Data Analysis" ); +#$page{'radar_analysis'} -> file_name ( "radar_analysis.html" ); +#$page{'radar_analysis'} -> path2main ( "../../" ); +#$page{'radar_analysis'} -> parent ( "plats/radar" ); +#$page{'radar_analysis'} -> content_files ( "radar_1.txt","radar_analysis.txt" ); + +#$page{'tower_R4'} = Web->new_page(); +#$page{'tower_R4'} -> afs_path ( "plats/tower_R4/" ); +#$page{'tower_R4'} -> short_title ( "R4 Tower" ); +#$page{'tower_R4'} -> long_title ( "Navy Tower R4" ); +#$page{'tower_R4'} -> file_name ( "index.html" ); +#$page{'tower_R4'} -> path2main ( "../../" ); +#$page{'tower_R4'} -> menu_items ( 'tower_R4_sys','tower_R4_pkg' ); +#$page{'tower_R4'} -> parent ( "plats" ); +#$page{'tower_R4'} -> content_files ( "tower_R4.txt" ); +#$page{'tower_R4'} -> dynamic_table ( "contents/tables/tower_r4.txt" ); + +#$page{'tower_R4_sys'} = Web->new_page(); +#$page{'tower_R4_sys'} -> afs_path ( "plats/tower_R4/" ); +#$page{'tower_R4_sys'} -> short_title ( "System" ); +#$page{'tower_R4_sys'} -> long_title ( "System Info" ); +#$page{'tower_R4_sys'} -> file_name ( "sys_info.html" ); +#$page{'tower_R4_sys'} -> path2main ( "../../" ); +#$page{'tower_R4_sys'} -> parent ( "plats/tower_R4" ); +#$page{'tower_R4_sys'} -> content_files ( "tower_R4.txt" ); +#$page{'tower_R4_sys'} -> dynamic_table ( "contents/tables/tower_r4_sys.txt" ); + +##$page{'tower_R4_pkg'} = Web->new_page(); +##$page{'tower_R4_pkg'} -> afs_path ( "plats/tower_R4/" ); +##$page{'tower_R4_pkg'} -> short_title ( "Package" ); +##$page{'tower_R4_pkg'} -> long_title ( "Package Details" ); +##$page{'tower_R4_pkg'} -> file_name ( "pkg_info.html" ); +##$page{'tower_R4_pkg'} -> path2main ( "../../" ); +##$page{'tower_R4_pkg'} -> parent ( "plats/tower_R4" ); +##$page{'tower_R4_pkg'} -> content_files ( "tower_R4.txt","tower_R4_pkg.txt" ); + + +#This page will be replaced by the contents of buoy_data +##$page{'buoy'} = Web->new_page(); +##$page{'buoy'} -> afs_path ( "plats/buoy/" ); +##$page{'buoy'} -> short_title ( "Buoy" ); +##$page{'buoy'} -> long_title ( "Cape Lookout Buoy" ); +##$page{'buoy'} -> file_name ( "index.html" ); +##$page{'buoy'} -> path2main ( "../../" ); +##$page{'buoy'} -> parent ( "plats" ); +##$page{'buoy'} -> content_files ( "buoy.txt" ); + +$page{'buoy'} = Web->new_page(); +$page{'buoy'} -> afs_path ( "plats/buoy/" ); +$page{'buoy'} -> short_title ( "Buoy" ); +$page{'buoy'} -> long_title ( "Lookout Shoals Research Buoy" ); +$page{'buoy'} -> file_name ( "index.html" ); +$page{'buoy'} -> path2main ( "../../" ); +$page{'buoy'} -> parent ( "plats" ); +$page{'buoy'} -> menu_items ( 'buoy_sys','buoy_pkg' ); +$page{'buoy'} -> content_files ( "buoy_lsrb.txt"); + #"buoy_down.txt" ); + #"technical.txt" ); +$page{'buoy'} -> script_files ( "popup.js" ); +$page{'buoy'} -> dynamic_table ( "contents/tables/buoy_lsrb.txt"); + #"contents/tables/buoy_lsrb_surf.txt", + #"contents/tables/buoy_lsrb_midw.txt"); +$page{'buoy_sys'} = Web->new_page(); +$page{'buoy_sys'} -> afs_path ( "plats/buoy/" ); +$page{'buoy_sys'} -> short_title ( "System" ); +$page{'buoy_sys'} -> long_title ( "Buoy System Data" ); +$page{'buoy_sys'} -> file_name ( "sys.html" ); +$page{'buoy_sys'} -> path2main ( "../../" ); +$page{'buoy_sys'} -> parent ( "plats/buoy" ); +$page{'buoy_sys'} -> content_files ( "buoy_lsrb.txt" ); +$page{'buoy_sys'} -> dynamic_table ( "contents/tables/buoy_lsrb_sys.txt" ); + +#$page{'buoy_pkg'} = Web->new_page(); +#$page{'buoy_pkg'} -> afs_path ( "plats/buoy/" ); +#$page{'buoy_pkg'} -> short_title ( "Package" ); +#$page{'buoy_pkg'} -> long_title ( "Buoy Package Info" ); +#$page{'buoy_pkg'} -> file_name ( "pkg_test.html" ); +#$page{'buoy_pkg'} -> path2main ( "../../" ); +#$page{'buoy_pkg'} -> parent ( "plats/buoy" ); +#$page{'buoy_pkg'} -> content_files ( "buoy_lsrb.txt", "buoy_pkg.txt" ); + + +#$page{'jpop'} = Web->new_page(); +#$page{'jpop'} -> afs_path ( "plats/jpop/" ); +#$page{'jpop'} -> short_title ( "JPOP" ); +#$page{'jpop'} -> long_title ( "Jennette's Pier Observing Partnership" ); +#$page{'jpop'} -> file_name ( "index.html" ); +#$page{'jpop'} -> path2main ( "../../" ); +#$page{'jpop'} -> parent ( "plats" ); +#$page{'jpop'} -> content_files ( "jpop.txt" ); + + +#$page{'neuse'} = Web->new_page(); +#$page{'neuse'} -> afs_path ( "plats/neuse/" ); +#$page{'neuse'} -> short_title ( "Neuse" ); +#$page{'neuse'} -> long_title ( "Neuse River Profiling Station" ); +#$page{'neuse'} -> file_name ( "index.html" ); +#$page{'neuse'} -> path2main ( "../../" ); +#$page{'neuse'} -> parent ( "plats" ); +#$page{'neuse'} -> content_files ( "neuse.txt" ); + + +#$page{'roof'} = Web->new_page(); +#$page{'roof'} -> afs_path ( "plats/roof/" ); +#$page{'roof'} -> short_title ( "Roof" ); +#$page{'roof'} -> long_title ( "Roof Development Package" ); +#$page{'roof'} -> file_name ( "index.html" ); +#$page{'roof'} -> path2main ( "../../" ); +#$page{'roof'} -> parent ( "plats" ); +#$page{'roof'} -> menu_items ( 'roof_sys','roof_pkg' ); +#$page{'roof'} -> content_files ( "roof.txt" ); +#$page{'roof'} -> dynamic_table ( "contents/tables/roof.txt" ); + +#$page{'roof_sys'} = Web->new_page(); +#$page{'roof_sys'} -> afs_path ( "plats/roof/" ); +#$page{'roof_sys'} -> short_title ( "System" ); +#$page{'roof_sys'} -> long_title ( "System Info" ); +#$page{'roof_sys'} -> file_name ( "sys_info.html" ); +#$page{'roof_sys'} -> path2main ( "../../" ); +#$page{'roof_sys'} -> parent ( "plats/roof" ); +#$page{'roof_sys'} -> content_files ( "roof.txt","roof_sys.txt" ); +#$page{'roof_sys'} -> dynamic_table ( "contents/tables/roof_sys.txt" ); + +#$page{'roof_pkg'} = Web->new_page(); +#$page{'roof_pkg'} -> afs_path ( "plats/roof/" ); +#$page{'roof_pkg'} -> short_title ( "Package" ); +#$page{'roof_pkg'} -> long_title ( "Package Details" ); +#$page{'roof_pkg'} -> file_name ( "pkg_info.html" ); +#$page{'roof_pkg'} -> path2main ( "../../" ); +#$page{'roof_pkg'} -> parent ( "plats/roof" ); +##$page{'roof_pkg'} -> articles ( 'roof_daq','roof_com','roof_trans' ); +#$page{'roof_pkg'} -> content_files ( "roof.txt","roof_pkg.txt" ); + +#$page{'sst'} = Web->new_page(); +#$page{'sst'} -> afs_path ( "obs/" ); +##$page{'sst'} -> on_mouseover ('sst_v_w.png'); +#$page{'sst'} -> file_name ( "sst.html" ); +#$page{'sst'} -> short_title ( "SST" ); +#$page{'sst'} -> long_title ( "Sea Surface Temperature" ); +#$page{'sst'} -> parent ( "obs" ); +#$page{'sst'} -> path2main ( "../" ); +#$page{'sst'} -> script_files ( "popup.js" ); +#$page{'sst'} -> image_maps ( "obs_sst.map" ); +#$page{'sst'} -> content_files ( "sst.txt" ); + +#$page{'wind'} = Web->new_page(); +#$page{'wind'} -> afs_path ( "obs/" ); +##$page{'wind'} -> on_mouseover ( 'wind_v.png' ); +#$page{'wind'} -> file_name ( "wind.html" ); +#$page{'wind'} -> short_title ( "Wind" ); +#$page{'wind'} -> long_title ( "Wind Velocities" ); +#$page{'wind'} -> parent ( "obs" ); +#$page{'wind'} -> path2main ( "../" ); +#$page{'wind'} -> script_files ( "popup.js" ); +#$page{'wind'} -> image_maps ( "obs_wind.map" ); +#$page{'wind'} -> content_files ( "wind.txt" ); + +#$page{'vel'} = Web->new_page(); +#$page{'vel'} -> afs_path ( "obs/" ); +##$page{'vel'} -> on_mouseover ('vel.png'); +#$page{'vel'} -> file_name ( "vel.html" ); +#$page{'vel'} -> short_title ( "Currents" ); +#$page{'vel'} -> long_title ( "Water Velocities" ); +#$page{'vel'} -> parent ( "obs" ); +#$page{'vel'} -> script_files ( "popup.js" ); +#$page{'vel'} -> image_maps ( "obs_vel.map" ); +#$page{'vel'} -> path2main ( "../" ); +#$page{'vel'} -> content_files ( "vel.txt" ); + +##$page{'salin'} = Web->new_page(); +##$page{'salin'} -> afs_path ( "obs/" ); +##$page{'salin'} -> on_mouseover ('salin_v_w.png'); +##$page{'salin'} -> file_name ( "salin.html" ); +##$page{'salin'} -> short_title ( "Salinity" ); +##$page{'salin'} -> path2main ( "../" ); +##$page{'salin'} -> parent ( "obs" ); + + +#$page{'wl'} = Web->new_page(); +#$page{'wl'} -> afs_path ( "obs/" ); +##$page{'wl'} -> on_mouseover ('wl_v_w.png'); +#$page{'wl'} -> file_name ( "wl.html" ); +#$page{'wl'} -> short_title ( "Water Level" ); +#$page{'wl'} -> long_title ( "Water Level" ); +#$page{'wl'} -> path2main ( "../" ); +#$page{'wl'} -> parent ( "obs" ); +#$page{'wl'} -> content_files ( "wl.txt" ); + +#$page{'radial'} = Web->new_page(); +##$page{'radial'} -> on_mouseover ('radial.png'); +#$page{'radial'} -> afs_path ( "obs/" ); +#$page{'radial'} -> file_name ( "radial.html" ); +#$page{'radial'} -> short_title ( "Radials" ); +#$page{'radial'} -> long_title ( "Radial Surface Velocities" ); +#$page{'radial'} -> path2main ( "../" ); +#$page{'radial'} -> parent ( "obs" ); +#$page{'radial'} -> content_files ( "radial.txt" ); + + +#$page{'exper'} = Web->new_page(); +#$page{'exper'} -> afs_path ( "" ); +##$page{'exper'} -> file_name ( "" ); +#$page{'exper'} -> short_title ( "Note: Experimental!" ); +#$page{'exper'} -> path2main ( "../" ); + +#$page{'adcirc'} = Web->new_page(); +#$page{'adcirc'} -> afs_path ( "mods/adcirc/" ); +#$page{'adcirc'} -> file_name ( "index.html" ); +#$page{'adcirc'} -> short_title ( "ADCIRC" ); +#$page{'adcirc'} -> long_title ( "ADCIRC Tidal and Wind Model" ); +#$page{'adcirc'} -> path2main ( "../../" ); +#$page{'adcirc'} -> content_files ( "adcirc.txt" ); +##$page{'adcirc'} -> menu_items ( 'adcirc_wl','adcirc_suv' ); +#$page{'adcirc'} -> parent ( "mods" ); + +#$page{'adcirc_wl'} = Web->new_page(); +#$page{'adcirc_wl'} -> afs_path ( "mods/adcirc/" ); +#$page{'adcirc_wl'} -> file_name ( "adcirc_wl.html" ); +#$page{'adcirc_wl'} -> short_title ( "Water Level" ); +#$page{'adcirc_wl'} -> long_title ( "ADCIRC Water Level" ); +#$page{'adcirc_wl'} -> path2main ( "../../" ); +#$page{'adcirc_wl'} -> content_files ( "adcirc_wl.txt" ); +#$page{'adcirc_wl'} -> parent ( "mods/adcirc" ); + +#$page{'adcirc_suv'} = Web->new_page(); +#$page{'adcirc_suv'} -> afs_path ( "mods/adcirc/" ); +#$page{'adcirc_suv'} -> file_name ( "adcirc_suv.html" ); +#$page{'adcirc_suv'} -> short_title ( "Currents" ); +#$page{'adcirc_suv'} -> long_title ( "ADCIRC Surface Currents" ); +#$page{'adcirc_suv'} -> path2main ( "../../" ); +#$page{'adcirc_suv'} -> content_files ( "adcirc_suv.txt" ); +#$page{'adcirc_suv'} -> parent ( "mods/adcirc" ); + + +#$page{'quoddy'} = Web->new_page(); +#$page{'quoddy'} -> afs_path ( "mods/quoddy/" ); +#$page{'quoddy'} -> file_name ( "index.html" ); +#$page{'quoddy'} -> short_title ( "QUODDY" ); +#$page{'quoddy'} -> long_title ( "QUODDY Tidal and Wind Model" ); +#$page{'quoddy'} -> path2main ( "../../" ); +#$page{'quoddy'} -> content_files ( "quoddy.txt" ); +#$page{'quoddy'} -> menu_items ( 'quoddy_sst','quoddy_suv' ); +#$page{'quoddy'} -> parent ( "mods" ); + +#$page{'quoddy_sst'} = Web->new_page(); +#$page{'quoddy_sst'} -> afs_path ( "mods/quoddy/" ); +#$page{'quoddy_sst'} -> file_name ( "quoddy_sst.html" ); +#$page{'quoddy_sst'} -> short_title ( "SST" ); +#$page{'quoddy_sst'} -> long_title ( "QUODDY Sea Surface Temperature" ); +#$page{'quoddy_sst'} -> path2main ( "../../" ); +#$page{'quoddy_sst'} -> content_files ( "quoddy_sst.txt" ); +#$page{'quoddy_sst'} -> parent ( "mods/quoddy" ); + +#$page{'quoddy_wl'} = Web->new_page(); +#$page{'quoddy_wl'} -> afs_path ( "mods/quoddy/" ); +#$page{'quoddy_wl'} -> file_name ( "quoddy_wl.html" ); +#$page{'quoddy_wl'} -> short_title ( "Water Level" ); +#$page{'quoddy_wl'} -> long_title ( "QUODDY Water Level" ); +#$page{'quoddy_wl'} -> path2main ( "../../" ); +#$page{'quoddy_wl'} -> content_files ( "quoddy_wl.txt" ); +#$page{'quoddy_wl'} -> parent ( "mods/quoddy" ); + +#$page{'quoddy_suv'} = Web->new_page(); +#$page{'quoddy_suv'} -> afs_path ( "mods/quoddy/" ); +#$page{'quoddy_suv'} -> file_name ( "quoddy_suv.html" ); +#$page{'quoddy_suv'} -> short_title ( "Currents" ); +#$page{'quoddy_suv'} -> long_title ( "QUODDY Surface Currents" ); +#$page{'quoddy_suv'} -> path2main ( "../../" ); +#$page{'quoddy_suv'} -> content_files ( "quoddy_suv.txt" ); +#$page{'quoddy_suv'} -> parent ( "mods/quoddy" ); + +#$page{'eta'} = Web->new_page(); +#$page{'eta'} -> afs_path ( "mods/eta/" ); +#$page{'eta'} -> file_name ( "index.html" ); +#$page{'eta'} -> short_title ( "ETA" ); +#$page{'eta'} -> long_title ( "ETA Atmospheric Model" ); +#$page{'eta'} -> path2main ( "../../" ); +#$page{'eta'} -> content_files ( "eta.txt" ); +#$page{'eta'} -> menu_items ( 'eta_wind','eta_sst' ); +#$page{'eta'} -> parent ( "mods" ); + +#$page{'eta_wind'} = Web->new_page(); +#$page{'eta_wind'} -> afs_path ( "mods/eta/" ); +#$page{'eta_wind'} -> file_name ( "eta_wind.html" ); +#$page{'eta_wind'} -> short_title ( "Wind" ); +#$page{'eta_wind'} -> long_title ( "ETA Wind Velocity" ); +#$page{'eta_wind'} -> path2main ( "../../" ); +#$page{'eta_wind'} -> content_files ( "eta_wind.txt" ); +#$page{'eta_wind'} -> parent ( "mods/eta" ); + +#$page{'eta_sst'} = Web->new_page(); +#$page{'eta_sst'} -> afs_path ( "mods/eta/" ); +#$page{'eta_sst'} -> file_name ( "eta_sst.html" ); +#$page{'eta_sst'} -> short_title ( "SST" ); +#$page{'eta_sst'} -> long_title ( "ETA Sea Surface Temperature" ); +#$page{'eta_sst'} -> path2main ( "../../" ); +#$page{'eta_sst'} -> content_files ( "eta_sst.txt" ); +#$page{'eta_sst'} -> parent ( "mods/eta" ); + +#$page{'blank'} = Web->new_page(); +#$page{'blank'} -> afs_path ( "" ); +#$page{'blank'} -> short_title ( '' ); +#$page{'blank'} -> long_title ( "" ); +#$page{'blank'} -> path2main ( "" ); + + + +##$page{'hycom'} = Web->new_page(); +##$page{'hycom'} -> afs_path ( "mods/" ); +##$page{'hycom'} -> file_name ( "hycom.html" ); +##$page{'hycom'} -> short_title ( "HYCOM" ); +##$page{'hycom'} -> path2main ( "../" ); + + +##$page{'latest'} = Web->new_page(); +##$page{'latest'} -> afs_path ( "data/" ); +##$page{'latest'} -> file_name ( "latest_v2.0" ); +##$page{'latest'} -> short_title ( "Latest Real-Time Data" ); +##$page{'latest'} -> path2main ( "../" ); + + +#$article{'obs'} = Web->new_article(); +#$article{'obs'} -> short_title ( "Observations" ); +#$article{'obs'} -> long_title ( "Merged Maps" ); +#$article{'obs'} -> target_url ( "obs/" ); +##$article{'obs'} -> thumbnail ( "obs_thumb.png" ); +#$article{'obs'} -> thumbnail ( "img/blank_map_thumb.png" ); +#$article{'obs'} -> content_files ( "obs.txt" ); + +#$article{'currents'} = Web->new_article(); +#$article{'currents'} -> short_title ( "Currents" ); +#$article{'currents'} -> long_title ( "Sea Surface Currents" ); +##$article{'currents'} -> target_url ( "img/rt/vel.png" ); +#$article{'currents'} -> target_url ( "obs/vel.html" ); +##$article{'currents'} -> thumbnail ( "obs_thumb.png" ); +#$article{'currents'} -> thumbnail ( "img/obs/suv_latest_thumb.png" ); +#$article{'currents'} -> content_files ( "currents.txt" ); + +#$article{'winds'} = Web->new_article(); +#$article{'winds'} -> short_title ( "Winds" ); +#$article{'winds'} -> long_title ( "Wind Veolcities" ); +#$article{'winds'} -> target_url ( "obs/wind.html" ); +#$article{'winds'} -> thumbnail ( "img/obs/wind_latest_thumb.png" ); +#$article{'winds'} -> content_files ( "winds.txt" ); + +#$article{'sst'} = Web->new_article(); +#$article{'sst'} -> short_title ( "SST" ); +#$article{'sst'} -> long_title ( "Sea Surface Temperature" ); +#$article{'sst'} -> target_url ( "obs/sst.html" ); +#$article{'sst'} -> thumbnail ( "img/obs/sst_latest_thumb.png" ); +#$article{'sst'} -> content_files ( "sst.txt" ); + +#$article{'wl'} = Web->new_article(); +#$article{'wl'} -> short_title ( "Water Level" ); +#$article{'wl'} -> long_title ( "Water Level" ); +#$article{'wl'} -> target_url ( "obs/wl.html" ); +##$article{'wl'} -> thumbnail ( "wl_thumb.png" ); +#$article{'wl'} -> thumbnail ( "img/obs/wl_latest_thumb.png" ); +#$article{'wl'} -> content_files ( "wl.txt" ); + +##$article{'salin'} = Web->new_article(); +##$article{'salin'} -> short_title ( "Salinity" ); +##$article{'salin'} -> long_title ( "Surface Salinity" ); +##$article{'salin'} -> target_url ( "obs/salin.html" ); +##$article{'salin'} -> thumbnail ( "salin_thumb.png" ); +##$article{'salin'} -> thumbnail ( "example.png" ); +##$article{'salin'} -> content_files ( "salin.txt" ); + +#$article{'radial'} = Web->new_article(); +#$article{'radial'} -> short_title ( "Radials" ); +#$article{'radial'} -> long_title ( "Surface Current Radial Components " ); +#$article{'radial'} -> target_url ( "obs/radial.html" ); +##$article{'radial'} -> thumbnail ( "radial_thumb.png" ); +#$article{'radial'} -> thumbnail ( "img/blank_map_thumb.png" ); +#$article{'radial'} -> content_files ( "radials.txt" ); + +#$article{'radar'} = Web->new_article(); +#$article{'radar'} -> short_title ( "Radar" ); +#$article{'radar'} -> long_title ( "Surface Current Radar Observations" ); +#$article{'radar'} -> target_url ( "plats/radar/" ); +##$article{'radar'} -> thumbnail ( "radar_thumb.png" ); +#$article{'radar'} -> thumbnail ( "img/thumbnails/codar_receive.jpg" ); +#$article{'radar'} -> content_files ( "radar.txt" ); + +$article{'tower_R4'} = Web->new_article(); +$article{'tower_R4'} -> short_title ( "Tower R4" ); +$article{'tower_R4'} -> long_title ( "Tower R4 Package" ); +$article{'tower_R4'} -> target_url ( "plats/tower_R4/" ); +#$article{'tower_R4'} -> thumbnail ( "tower_R4_thumb.png" ); +$article{'tower_R4'} -> thumbnail ( "img/thumbnails/r8_tower.jpg" ); +$article{'tower_R4'} -> content_files ( "tower_R4.txt" ); + +#$article{'buoy'} = Web->new_article(); +#$article{'buoy'} -> short_title ( "Buoy" ); +#$article{'buoy'} -> long_title ( "Cape Lookout Buoy" ); +#$article{'buoy'} -> target_url ( "plats/buoy/" ); +##$article{'buoy'} -> thumbnail ( "buoy_thumb.png" ); +#$article{'buoy'} -> thumbnail ( "img/thumbnails/buoy_unload2.png" ); +#$article{'buoy'} -> content_files ( "buoy.txt" ); + +#$article{'jpop'} = Web->new_article(); +#$article{'jpop'} -> short_title ( "Jpop" ); +#$article{'jpop'} -> long_title ( "Jennette's Pier Observing Partnership" ); +#$article{'jpop'} -> target_url ( "plats/jpop/" ); +##$article{'jpop'} -> thumbnail ( "jpop_thumb.png" ); +#$article{'jpop'} -> thumbnail ( "img/thumbnails/jpier_thumb.png" ); +#$article{'jpop'} -> content_files ( "jpop.txt" ); + +#$article{'neuse'} = Web->new_article(); +#$article{'neuse'} -> short_title ( "Neuse" ); +#$article{'neuse'} -> long_title ( "Neuse River Profiler" ); +#$article{'neuse'} -> target_url ( "plats/neuse/" ); +##$article{'neuse'} -> thumbnail ( "neuse_thumb.png" ); +#$article{'neuse'} -> thumbnail ( "img/thumbnails/neuse_platform2.png" ); +#$article{'neuse'} -> content_files ( "neuse.txt" ); + +#$article{'roof'} = Web->new_article(); +#$article{'roof'} -> short_title ( "Development" ); +#$article{'roof'} -> long_title ( "Development Package for Towers and Buoys" ); +#$article{'roof'} -> target_url ( "plats/roof/" ); +##$article{'roof'} -> thumbnail ( "roof_thumb.png" ); +#$article{'roof'} -> thumbnail ( "img/thumbnails/roof_pkg.jpg" ); +#$article{'roof'} -> content_files ( "roof.txt" ); + +#$article{'roof_daq'} = Web->new_article(); +#$article{'roof_daq'} -> short_title ( "DAQ" ); +#$article{'roof_daq'} -> long_title ( "Data Acquisition Package" ); +##$article{'roof_daq'} -> target_url ( "plats/roof/" ); +##$article{'roof'} -> thumbnail ( "roof_thumb.png" ); +##$article{'roof_daq'} -> thumbnail ( "roof_pkg.jpg" ); +#$article{'roof_daq'} -> content_files ( "roof_daq.txt" ); + +#$article{'roof_com'} = Web->new_article(); +#$article{'roof_com'} -> short_title ( "ComLib" ); +#$article{'roof_com'} -> long_title ( "Communications Library" ); +##$article{'roof_com'} -> target_url ( "plats/roof/" ); +##$article{'roof'} -> thumbnail ( "roof_thumb.png" ); +##$article{'roof_com'} -> thumbnail ( "roof_pkg.jpg" ); +#$article{'roof_com'} -> content_files ( "roof_com.txt" ); + +#$article{'roof_trans'} = Web->new_article(); +#$article{'roof_trans'} -> short_title ( "Transfer" ); +#$article{'roof_trans'} -> long_title ( "Data Transfer Package" ); +##$article{'roof_trans'} -> target_url ( "plats/roof/" ); +##$article{'roof'} -> thumbnail ( "roof_thumb.png" ); +##$article{'roof_trans'} -> thumbnail ( "roof_pkg.jpg" ); +#$article{'roof_trans'} -> content_files ( "roof_trans.txt" ); + + Index: tower_buoy/bin/meta_data/parse.table =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/parse.table (revision 7) @@ -1,0 +1,71 @@ +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#VAR_ID #parsing tricks #parsing output +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#System Information +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +GPS "\>(.*)\;\*[0-9]*\<" $gps_string +RESET_TIME (.*) $reset_time +RESET_DIFF (.*) $reset_diff +GPS_TIME (.*) $gps_time +#GPS1 "\>RPV([0-9]*)\+([0-9]*)\-([0-9]*)\;\*[0-9]*\<" $junk,$gps_lat,$gps_lon +#GPS1 ">RPV(.{5})\+(.{7})[\+\-]{1}(.{7})[.]{8}\;[.]{3}\<" $junk,$gps_lat,$gps_lon,$junk2 +GPS1 ".{11}(.{7}).(.{7}).*" $gps_lat,$gps_lon +BOOT (.*) $boot_time +SAMPLE_LOOP (.*) $read_time +#ID (.*) $tower_id +#SOFTWARE (.*) $software_version +SAMPLE_INTERVAL (.*) $sample_interval +NEWFILE_INTERVAL (.*) $newfile_interval +#serial (.*) $serial_string +TT (.*) $t_time +#RLCAD (.*) $rlc_string +#BBAD (.*) $bnb_string +CLOCK (.*) $sample_loop +#SAMPLE_LOOP (.*) $sample_loop +#LINK "(.....)(.*)" $link_time,$kw_hrs +LINK "([0-9]*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*)" $link_time,$kw_hrs,$amps,$volts,$amp_hrs,$p_amp_hrs,$p_amps,$time_remain,$bar_graph,$box_temp +#LINK "([0-9]*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*)" $link_time,$kw_hrs,$amps,$volts,$amp_hrs,$p_amp_hrs,$p_amps,$time_remain,$bar_graph + +#"20522,-00.02,-0000.3,11.85,-0003.1,-0005.4,-0001.1,255.0,5,25" + +DISK1 ([0-9\.]+)%[\w\W\s]+[\s]([0-9]+\.[0-9]+)[\sM.*] $disk1p,$disk1t +DISK2 ([0-9\.]+)%[\w\W\s]+[\s]([0-9]+\.[0-9]+)[\sM.*] $disk2p,$disk2t +MEM1 ([0-9\.]+)%[\w\W\s]+[\s]([0-9]+\.[0-9]+)[\sM.*] $mem1p,$mem1t +MEM2 ([0-9\.]+)%[\w\W\s]+[\s]([0-9]+\.[0-9]+)[\sM.*] $mem2p,$mem2t +#DISK2 "(.*)\% of (.*) M.*" $disk2p,$disk2t +FILES ([0-9]+)[\w\W\s]+[fF.*] $num_files + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#Met Sensors +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ATEMP (.*) $a_temp +RH (.*) $r_hum +PSP (.*) $psp +PIRA (.*) $pir_case_t +PIRB (.*) $pir_dome_t +PIRC (.*) $pir_therm +BARO "PS\=\+[0]*([0-9]*\.[0-9]*)" $baro +#RAIN "\*\*([0-9\.]*)" $rain +RAIN @avg @cumrain +WSPDA @avg @wi_spd_a +WDIRA @avg @wi_dir_a +WSPDB @avg @wi_spd_b +WDIRB @avg @wi_dir_b +COMP1 @avg @comp_1 +COMP2 @avg @comp_2 +#COMP "\$C([0-9\.]*)P([0-9\.\-]*)R([0-9\.\-]*)T([0-9\.\*]*)" $comp_dir,$comp_pitch,$comp_roll,$junk1 +COMP @gva @comp #_dir,@comp_pitch,@comp_roll + +CTDA "TS(.*),(.*),(.*),(.*)S>" $sal,$temp,$cond,$press +CTDB "TS(.*),(.*),(.*),(.*)S>" $sal,$temp,$cond,$press + +#CTD1 "#00TS(.*),(.*),(.*),(.*),(.*),(.*)S>" $sal,$temp,$cond,$press,$junk1,$junk2 +#CTD2 "#01TS(.*),(.*),(.*),(.*),(.*),(.*)S>" $sal,$temp,$cond,$press,$junk1,$junk2 + +CTD1 "#00TS([0-9\.]*),([0-9\.]*),([0-9\.]*),([0-9\.]*),(.*)" $sn1,$temp1,$cond1,$press1,$junk1 +CTD2 "#01TS([0-9\.]*),([0-9\.]*),([0-9\.]*),([0-9\.]*),(.*)" $sn2,$temp2,$cond2,$press2,$junk1 + + +# Make sure the last data line has a carriage return for the chop statement Index: tower_buoy/bin/meta_data/parse.table.20060328 =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/parse.table.20060328 (revision 7) @@ -1,0 +1,65 @@ +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#VAR_ID #parsing tricks #parsing output +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#System Information +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +GPS "\>(.*)\;\*[0-9]*\<" $gps_string +RESET_TIME (.*) $reset_time +RESET_DIFF (.*) $reset_diff +GPS_TIME (.*) $gps_time +BOOT (.*) $boot_time +SAMPLE_LOOP (.*) $read_time +#ID (.*) $tower_id +#SOFTWARE (.*) $software_version +SAMPLE_INTERVAL (.*) $sample_interval +NEWFILE_INTERVAL (.*) $newfile_interval +#serial (.*) $serial_string +TT (.*) $t_time +#RLCAD (.*) $rlc_string +#BBAD (.*) $bnb_string +CLOCK (.*) $sample_loop +#SAMPLE_LOOP (.*) $sample_loop +#LINK "(.....)(.*)" $link_time,$kw_hrs +LINK "([0-9]*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*)" $link_time,$kw_hrs,$amps,$volts,$amp_hrs,$p_amp_hrs,$p_amps,$time_remain,$bar_graph,$box_temp + +#"20522,-00.02,-0000.3,11.85,-0003.1,-0005.4,-0001.1,255.0,5,25" + +DISK1 ([0-9\.]+)%[\w\W\s]+[\s]([0-9]+\.[0-9]+)[\sM.*] $disk1p,$disk1t +DISK2 ([0-9\.]+)%[\w\W\s]+[\s]([0-9]+\.[0-9]+)[\sM.*] $disk2p,$disk2t +MEM1 ([0-9\.]+)%[\w\W\s]+[\s]([0-9]+\.[0-9]+)[\sM.*] $mem1p,$mem1t +MEM2 ([0-9\.]+)%[\w\W\s]+[\s]([0-9]+\.[0-9]+)[\sM.*] $mem2p,$mem2t +#DISK2 "(.*)\% of (.*) M.*" $disk2p,$disk2t +FILES ([0-9]+)[\w\W\s]+[F.*] $num_files + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#Met Sensors +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ATEMP (.*) $a_temp +RH (.*) $r_hum +PSP (.*) $psp +PIRA (.*) $pir_case_t +PIRB (.*) $pir_dome_t +PIRC (.*) $pir_therm +BARO "PS\=\+[0]*([0-9]*\.[0-9]*)" $baro +RAIN "\*\*([0-9\.]*)" $rain +WSPDA @avg @wi_spd_a +WDIRA @avg @wi_dir_a +WSPDB @avg @wi_spd_b +WDIRB @avg @wi_dir_b +COMP1 @avg @comp_1 +COMP2 @avg @comp_2 +COMP "\$C([0-9\.]*)P([0-9\.\-]*)R([0-9\.\-]*)T([0-9\.\*]*)" $comp_dir,$comp_pitch,$comp_roll,$junk1 + +CTDA "TS(.*),(.*),(.*),(.*)S>" $sal,$temp,$cond,$press +CTDB "TS(.*),(.*),(.*),(.*)S>" $sal,$temp,$cond,$press + +#CTD1 "#00TS(.*),(.*),(.*),(.*),(.*),(.*)S>" $sal,$temp,$cond,$press,$junk1,$junk2 +#CTD2 "#01TS(.*),(.*),(.*),(.*),(.*),(.*)S>" $sal,$temp,$cond,$press,$junk1,$junk2 + +CTD1 "#00TS([0-9\.]*),([0-9\.]*),([0-9\.]*),([0-9\.]*),(.*)" $sn1,$temp1,$cond1,$press1,$junk1 +CTD2 "#01TS([0-9\.]*),([0-9\.]*),([0-9\.]*),([0-9\.]*),(.*)" $sn2,$temp2,$cond2,$press2,$junk1 + + +# Make sure the last data line has a carriage return for the chop statement Index: tower_buoy/bin/meta_data/parse_test.table =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/parse_test.table (revision 7) @@ -1,0 +1,65 @@ +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#VAR_ID #parsing tricks #parsing output +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#System Information +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +GPS "\>(.*)\;\*[0-9]*\<" $gps_string +RESET_TIME (.*) $reset_time +RESET_DIFF (.*) $reset_diff +GPS_TIME (.*) $gps_time +BOOT (.*) $boot_time +SAMPLE_LOOP (.*) $read_time +#ID (.*) $tower_id +#SOFTWARE (.*) $software_version +SAMPLE_INTERVAL (.*) $sample_interval +NEWFILE_INTERVAL (.*) $newfile_interval +#serial (.*) $serial_string +TT (.*) $t_time +#RLCAD (.*) $rlc_string +#BBAD (.*) $bnb_string +CLOCK (.*) $sample_loop +#SAMPLE_LOOP (.*) $sample_loop +#LINK "(.....)(.*)" $link_time,$kw_hrs +LINK "([0-9]*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*)" $link_time,$kw_hrs,$amps,$volts,$amp_hrs,$p_amp_hrs,$p_amps,$time_remain,$bar_graph,$box_temp + +#"20522,-00.02,-0000.3,11.85,-0003.1,-0005.4,-0001.1,255.0,5,25" + +DISK1 ([0-9\.]+)%[\w\W\s]+[\s]([0-9]+\.[0-9]+)[\sM.*] $disk1p,$disk1t +DISK2 ([0-9\.]+)%[\w\W\s]+[\s]([0-9]+\.[0-9]+)[\sM.*] $disk2p,$disk2t +MEM1 ([0-9\.]+)%[\w\W\s]+[\s]([0-9]+\.[0-9]+)[\sM.*] $mem1p,$mem1t +MEM2 ([0-9\.]+)%[\w\W\s]+[\s]([0-9]+\.[0-9]+)[\sM.*] $mem2p,$mem2t +#DISK2 "(.*)\% of (.*) M.*" $disk2p,$disk2t +FILES ([0-9]+)[\w\W\s]+[F.*] $num_files + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#Met Sensors +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ATEMP (.*) $a_temp +RH (.*) $r_hum +PSP (.*) $psp +PIRA (.*) $pir_case_t +PIRB (.*) $pir_dome_t +PIRC (.*) $pir_therm +BARO "PS\=\+[0]*([0-9]*\.[0-9]*)" $baro +RAIN "\*\*([0-9\.]*)" $rain +WSPDA @avg @wi_spd_a +WDIRA @avg @wi_dir_a +WSPDB @avg @wi_spd_b +WDIRB @avg @wi_dir_b +COMP1 @avg @comp_1 +COMP2 @avg @comp_2 +COMP "\$C([0-9\.]*)P([0-9\.\-]*)R([0-9\.\-]*)T([0-9\.\*]*)" $comp_dir,$comp_pitch,$comp_roll,$junk1 + +CTDA "TS(.*),(.*),(.*),(.*)S>" $sal,$temp,$cond,$press +CTDB "TS(.*),(.*),(.*),(.*)S>" $sal,$temp,$cond,$press + +#CTD1 "#00TS(.*),(.*),(.*),(.*),(.*),(.*)S>" $sal,$temp,$cond,$press,$junk1,$junk2 +#CTD2 "#01TS(.*),(.*),(.*),(.*),(.*),(.*)S>" $sal,$temp,$cond,$press,$junk1,$junk2 + +CTD1 "#00TS([0-9\.]*),([0-9\.]*),([0-9\.]*),([0-9\.]*),(.*)" $sal,$temp,$cond,$press,$junk1 +CTD2 "#01TS(.*),(.*),(.*),(.*),(.*)" $sal,$temp,$cond,$press,$junk1 + + +# Make sure the last data line has a carriage return for the chop statement Index: tower_buoy/bin/meta_data/subvars.table =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/subvars.table (revision 7) @@ -1,0 +1,14 @@ +#%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +# Parent Variable # Children (or Sub-variables) +#%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +LINK LINK_VOLTS,LINK_AMPS,LINK_AMP_HRS,LINK_TEMP +CTDA CONDA,WTEMPA,PRESSA,SALA,DENSA +CTDB CONDB,WTEMPB,PRESSB,SALB,DENSB +CTD1 COND1,WTEMP1,PRESS1,SAL1,DENS1 +CTD2 COND2,WTEMP2,PRESS2,SAL2,DENS2 +DISK1 DISK1T,DISK1F +DISK2 DISK2T,DISK2F +MEM1 MEM1T,MEM1F +MEM2 MEM2T,MEM2F +COMP COMP_DIR,COMP_PITCH,COMP_ROLL +GPS1 GPSLAT,GPSLON Index: tower_buoy/bin/meta_data/tower_parse.defaults =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/tower_parse.defaults (revision 7) @@ -1,0 +1,9 @@ + +#$base_dir , '/afs/isis.unc.edu/depts/marine/workspace/hseim/sablam4/lstearns/perl/test_nemo/' +$base_dir , '/seacoos/data/nc-coos/tower/' +$tower_id, 'T1' +$d_data_dir, "${base_dir}raw_data/" +$out_data_dir, "${base_dir}proc_data/" +#$out_data_dir, "/seacoos/data/nc-coos/test_data/" +$d_out_file_name, 'test_data.nc' +# Index: tower_buoy/bin/meta_data/variable.table =================================================================== --- (revision ) +++ tower_buoy/bin/meta_data/variable.table (revision 7) @@ -1,0 +1,167 @@ +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#VAR_ID #RANGE #PRECISION #DERIVED #OUT_UNITS #FORMAT #DIMS #LONG_NAME #STANDARD_NAME #DESCRIPTION +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#System Information +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#These don't depend on anything! + +#Coordinate stuff +LATITUDE 30 40 .01 N/A degrees_north FLOAT a latitude latitude Decimal degrees of Latitude +LONGITUDE -80 -70 .01 N/A degrees_east FLOAT o longitude longitude Decimal degrees of Longitude + +#Okay, these are pretty weird... +TOWER_FILES N/A N/A N/A N/A FLOAT f tower_files N/A Index to raw data files +CHARACTERS N/A N/A N/A N/A CHAR c characters N/A Array of characters for string params +time N/A N/A N/A datenum DOUBLE t time N/A Time as Matlab Datenum +file_time N/A N/A N/A datenum DOUBLE f file_time N/A File Time as Matlab Datenum + +#Time related stuff +year N/A N/A N/A year FLOAT t year year Year +month N/A N/A N/A month FLOAT t month month Month +day N/A N/A N/A day FLOAT t day day Day +hour N/A N/A N/A hour FLOAT t hour hour Hour +minute N/A N/A N/A minute FLOAT t minute minute Minute +second N/A N/A N/A second FLOAT t second second Second + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#All of these occur once per file + +#Settings from parameter file +ID N/A N/A N/A string CHAR f c platform_id N/A Platform ID name +SOFTWARE N/A N/A N/A string CHAR f c software_version N/A Software Version Number +SAMPLE N/A N/A N/A minute FLOAT f sample_interval N/A Sampling Interval for DAQ loop +SAMPLE_INTERVAL N/A N/A N/A minute FLOAT f sample_interval N/A Sampling Interval for DAQ loop +NEWFILE_INTERVAL N/A N/A N/A hour FLOAT f newfile_interval N/A Newfile generation interval +BADFLAG N/A N/A N/A string CHAR f c badflag N/A Badflag +serial N/A N/A N/A string CHAR f c serial_devices N/A Serial Device List +ACTIVE_SERIAL N/A N/A N/A string CHAR f c serial_devices N/A Serial Device List +BBAD N/A N/A N/A string CHAR f c bb_ad_string N/A B&B A/D converter output +ACTIVE_BBAD N/A N/A N/A string CHAR f c bb_ad_string N/A B&B A/D converter output +RLCAD N/A N/A N/A string CHAR f c rlc_ad_string N/A RLC A/D converter output +ACTIVE_RLCAD N/A N/A N/A string CHAR f c rlc_ad_string N/A RLC A/D converter output + +#CPU related information +DISK1 N/A N/A N/A N/A CHAR f c disk_1_usage N/A Disk 1 % usage and total +DISK1F N/A N/A N/A Mb FLOAT f disk_1_free N/A Disk 1 Free Space +DISK1T N/A N/A N/A Mb FLOAT f disk_1_total N/A Disk 1 Total Space +DISK2 N/A N/A N/A N/A CHAR f c disk_2_usage N/A Disk 2 % usage and total +DISK2F N/A N/A N/A Mb FLOAT f disk_2_free N/A Disk 2 Free Space +DISK2T N/A N/A N/A Mb FLOAT f disk_2_total N/A Disk 2 Total Space +MEM1 N/A N/A N/A N/A CHAR f c mem_1_usage N/A Memory 1 % usage and total +MEM1F N/A N/A N/A Mb FLOAT f mem_1_free N/A Mem 1 Free Space +MEM1T N/A N/A N/A Mb FLOAT f mem_1_total N/A Mem 1 Total Space +MEM2 N/A N/A N/A N/A CHAR f c mem_2_usage N/A Memory 2 % usage and total +MEM2F N/A N/A N/A Mb FLOAT f mem_2_free N/A Mem 2 Free Space +MEM2T N/A N/A N/A Mb FLOAT f mem_2_total N/A Mem 2 Total Space +FILES N/A N/A N/A N/A FLOAT f num_files N/A Total number of files on disk + +#Clock related parameters +RESET N/A N/A N/A string CHAR f c clock_reset_string N/A Clock Reset string +RESET_TIME N/A N/A N/A string CHAR f c time_after_reset N/A Time After Reset +BEFORE_RESET N/A N/A N/A string CHAR f c time_before_reset N/A Time Before Reset +AFTER_RESET N/A N/A N/A string CHAR f c time_after_reset N/A Time After Reset +RESET_DIFF N/A N/A N/A string CHAR f c reset_delta_time N/A Difference In Time Before and After Reset +TRANSFER N/A N/A N/A string CHAR f c transfer_time N/A Last Successful Transfer +TT N/A N/A N/A string CHAR f c t_time N/A Transfer Time +BOOT N/A N/A N/A string CHAR f c boot_time N/A System boot time +GPS_TIME N/A N/A N/A string CHAR f c gps_time N/A GPS Time + +#Serial devices that occur once per file... +GPS N/A N/A N/A string CHAR f c gps_output_string N/A GPS output string +GPSLAT N/A N/A N/A string FLOAT f gps_latitude N/A GPS Latitude +GPSLON N/A N/A N/A string FLOAT f gps_longitude N/A GPS Longitude + + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#This one is time_dependant! + +SAMPLE_LOOP N/A N/A N/A seconds FLOAT t o a loop_time N/A Time to read all sensors +CLOCK N/A N/A N/A seconds FLOAT t o a loop_time N/A Time to read all sensors +LINK N/A N/A N/A data CHAR t o a link_string N/A Link Output String +LINK_VOLTS 0 14 N/A N/A volts FLOAT t o a battery_voltage voltage Battery Voltage +LINK_AMPS 0 6 N/A N/A amps FLOAT t o a current_draw N/A Current Draw +LINK_AMP_HRS N/A N/A N/A amp hrs FLOAT t o a amp_hours N/A Amp Hours of battery usage +LINK_TEMP N/A N/A N/A celsius FLOAT t o a box_temperature N/A Hoffman Box Temparature + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#Met Sensors +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +ATEMP -40 60 .01 no celsius FLOAT t o a air_temperature air_temperature Atmospheric temperature +RH 0 100 1 no percent FLOAT t o a relative_humidity relative_humidity Relative humidity +PSP 0 1000 1 no W m-2 FLOAT t o a short_wave_radiation net_shortwave_radiation Short Wave Radiation +PIRA -40 60 N/A no deg K FLOAT t o a pir_case_t N/A PIR Case Temperature +PIRB -40 60 N/A no deg K FLOAT t o a pir_dome_t N/A PIR Dome Temperature +PIRC -40 60 N/A no N/A FLOAT t o a pir_thermopile N/A PIR Thermistor Temperature +PIR 0 1000 N/A yes W m-2 FLOAT t o a ir_radiation net_longwave_radiation Infrared Radiation +BARO 900 1200 N/A no mbar FLOAT t o a barometric_pressure air_pressure Barometric Pressure at 100m +RAIN 0 10 1 no mm FLOAT t o a rainfall pecipitation_rate mm of rain +WSPDA 0 100 .1 no m s-1 FLOAT t o a wind_speed_a wind_speed Wind Speed +WDIRA 0 360 5 no degrees_true FLOAT t o a wind_from_direction_a wind_from_direction Wind From Direction +WGSTA 0 100 .1 no m s-1 FLOAT t o a wind_gust_a wind_gust Wind Gust +WNORTHA 0 360 5 no m s-1 FLOAT t o a wind_north_a northward_wind Wind North Velocity +WEASTA 0 100 .1 no m s-1 FLOAT t o a wind_east_a eastward_wind Wind East Velocity +WNORTHSTDA 0 100 5 no m s-1 FLOAT t o a wind_north_std_a N/A Wind North Velocity Standard Deviation +WEASTSTDA 0 100 .1 no m s-1 FLOAT t o a wind_east_std_a N/A Wind East Velocity Standard Deviation +WSPDSTDA 0 100 5 no m s-1 FLOAT t o a wind_spd_std_a N/A Wind Speed Standard Deviation +WDIRSTDA 0 100 .1 no m s-1 FLOAT t o a wind_dir_std_a N/A Wind Direction Standard Deviation +WSPDB 0 100 .1 no m s-1 FLOAT t o a wind_speed_b wind_speed Wind Speed +WDIRB 0 360 5 no degrees_true FLOAT t o a wind_from_direction_b wind_from_direction Wind From Direction +WGSTB 0 100 .1 no m s-1 FLOAT t o a wind_gust_b wind_gust Wind Gust +WNORTHB 0 100 5 no m s-1 FLOAT t o a wind_north_b northward_wind Wind North Velocity +WEASTB 0 100 .1 no m s-1 FLOAT t o a wind_east_b eastward_wind Wind East Velocity +WNORTHSTDB 0 100 5 no m s-1 FLOAT t o a wind_north_std_b N/A Wind North Velocity Standard Deviation +WEASTSTDB 0 100 .1 no m s-1 FLOAT t o a wind_east_std_b N/A Wind East Velocity Standard Deviation +WSPDSTDB 0 100 5 no m s-1 FLOAT t o a wind_spd_std_b N/A Wind Speed Standard Deviation +WDIRSTDB 0 100 .1 no m s-1 FLOAT t o a wind_dir_std_b N/A Wind Direction Standard Deviation +#COMP N/A N/A N/A N/A CHAR t o a compass_string N/A Compass digital output string +COMP_DIR 0 360 5 no degrees_true FLOAT t o a compass_direction compass_direction Compass Direction +COMP_PITCH 0 360 5 no degrees_horiz FLOAT t o a compass_pitch compass_pitch Compass Pitch +COMP_ROLL 0 360 5 no degrees_horiz FLOAT t o a compass_roll compass_roll Compass Roll +COMPMEAN 0 360 5 no degrees_true FLOAT f compass_direction compass_direction Mean Compass Direction +COMPSTD 0 360 5 no degrees_true FLOAT f compass_dir_std N/A Compass Direction Standard Deviation +COMPMAX 0 360 5 no degrees_true FLOAT f compass_dir_max N/A Max Compass Direction +PITCHMEAN 0 360 5 no degrees_true FLOAT f pitch pitch Mean Pitch +PITCHSTD 0 360 5 no degrees_true FLOAT f pitch_std N/A Pitch Standard Deviation +PITCHMAX 0 360 5 no degrees_true FLOAT f pitch_max N/A Max Pitch +ROLLMEAN 0 360 5 no degrees_true FLOAT f roll roll Mean Roll +ROLLSTD 0 360 5 no degrees_true FLOAT f roll_std N/A Roll Standard Deviation +ROLLMAX 0 360 5 no degrees_true FLOAT f roll_max N/A Max Roll +COMP1 N/A N/A N/A degrees_true FLOAT t o a compass1 N/A Compass Analog 1 output +COMP2 N/A N/A N/A string CHAR t o a compass2_string N/A Compass Analog 2 output string + +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +#In Water Sensors +#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +CTDA N/A N/A N/A N/A CHAR t o a ctd_a_string N/A CTD A output string +CONDA 0 5 N/A no mS/L FLOAT t o a conductivity_a N/A Conductivity from CTD A +WTEMPA 0 40 .1 no deg C FLOAT t o a water_temp_a N/A Temperature from CTD A +PRESSA 0 50 .1 no mbar FLOAT t o a pressure_a N/A Pressure from CTD A +SALA 0 40 .05 yes PSU FLOAT t o a salin_a N/A Salinity from CTD A +DENSA 1000 1050 N/A yes kg/m^3 FLOAT t o a density_a N/A Density from CTD A + +CTDB N/A N/A N/A N/A CHAR t o a ctd_b_string N/A CTD B output string +CONDB 0 5 N/A no mS/L FLOAT t o a conductivity_b N/A Conductivity from CTD B +WTEMPB 0 40 .1 no deg C FLOAT t o a water_temp_b N/A Temperature from CTD B +PRESSB 0 50 .1 no mbar FLOAT t o a pressure_b N/A Pressure from CTD B +SALB 0 40 .05 yes PSU FLOAT t o a salin_b N/A Salinity from CTD B +DENSB 1000 1050 N/A yes kg/m^3 FLOAT t o a density_b N/A Density from CTD B + +CTD1 N/A N/A N/A N/A CHAR t o a ctd_1_string N/A CTD 1 output string +COND1 0 5 N/A no mS/L FLOAT t o a conductivity_1 N/A Conductivity from CTD 1 +WTEMP1 0 40 .1 no deg C FLOAT t o a water_temp_1 N/A Temperature from CTD 1 +PRESS1 0 50 .1 no mbar FLOAT t o a pressure_1 N/A Pressure from CTD 1 +SAL1 0 40 .05 yes PSU FLOAT t o a salin_1 N/A Salinity from CTD 1 +DENS1 1000 1050 N/A yes kg/m^3 FLOAT t o a density_1 N/A Density from CTD 1 + +CTD2 N/A N/A N/A N/A CHAR t o a ctd_2_string N/A CTD 2 output string +COND2 0 5 N/A no mS/L FLOAT t o a conductivity_2 N/A Conductivity from CTD 2 +WTEMP2 0 40 .1 no deg C FLOAT t o a water_temp_2 N/A Temperature from CTD 2 +PRESS2 0 50 .1 no mbar FLOAT t o a pressure_2 N/A Pressure from CTD 2 +SAL2 0 40 .05 yes PSU FLOAT t o a salin_2 N/A Salinity from CTD 2 +DENS2 1000 1050 N/A yes kg/m^3 FLOAT t o a density_2 N/A Density from CTD 2 + +ADCP N/A N/A N/A string CHAR t o a adcp_string N/A Output string from ADCP Index: tower_buoy/bin/tower_parse.perl =================================================================== --- (revision ) +++ tower_buoy/bin/tower_parse.perl (revision 7) @@ -1,0 +1,1461 @@ +#!/afs/isis/pkg/isis/bin/perl +#tower_strip.perl +#Time-stamp: <2006-03-15 15:48:23 lstearns> +# +#Abstract: +# This script is designed to parse existing tower data for a given +# time range and save the output as a netcdf file containing the +# converted data values as well as ancillary information. +# +# ./tower_parse.perl -help +# For more information on input arguments +# +#Created: 2003.09?.?? maybe +#Author: Luke Stearns +#Modifications: started back up 2004.03.?? still going.... +# +# Luke Stearns 2006.03.15 - going back to improve some of the comments +# + + +###################################################################### +# Set up libraries and paths. + +use lib '/opt/local/seacoos/bin/'; +use lib '/opt/local/seacoos/bin/meta_data/'; +use meta_data; +$bin_dir = '/opt/local/seacoos/bin/meta_data/'; + +#meta_data.pm is a module I wrote to access some data tables in +#/opt/local/seacoos/bin/meta_data/ +#I intended these tables as a first step towards designing a relational +#database to store instrument configuration and deployment information. + +#Development paths and libraries: +# use lib '/afs/isis.unc.edu/depts/marine/workspace/hseim/sablam4/'. +# 'lstearns/perl/test_nemo/'; +# use lib '/afs/isis.unc.edu/depts/marine/workspace/hseim/sablam4/'. +# 'lstearns/perl/test_nemo/meta_data/'; +# use meta_data; +# $bin_dir = '/afs/isis.unc.edu/depts/marine/workspace/hseim/sablam4/'. +# 'lstearns/perl/test_nemo/meta_data/'; + +#Other included modules: +use NetCDF; +use Date::Manip; +use Statistics::Basic::StdDev; +use Math::BigFloat; + +###################################################################### +# Keep track of the time it takes to run the script +$starttime = time; + +###################################################################### +# Handle input arguments, namely a date string and a path, if given +#I'd like to handle a variety of input arguments +&handle_input; + +###################################################################### +# Read information about variables from the tables: parsing info, +# conversions, and meta-data + +#This is now handled by the 'use meta_data;' line above. + +###################################################################### +# Read in the data files and parse each line of data! +# This subroutine drives the bulk of the script! +if ($debug) {print "\nReading data files:\n";} +$first_one = 1; +&read_data; + +###################################################################### +# Finally, write the data to the NetCDF file. This is where it +# crashes more often than not. +&write_netcdf; + +###################################################################### +# Let us know how long it took! +$cummtime = time - $starttime; +if ($debug) { + print "Closing NetCDF files:\nALL DONE!"; + print "\nTotal time $cummtime sec\n"; +} + +if ($nemo) { + print "Attempting to scp file to nemo... (will require passwd)\n"; + system("scp $out_data_dir$out_file_name nemo.isis.unc.edu:/seacoos/". + "data/nc-coos/roof/"); +} + +###################################################################### +####################### BEGIN SUBROUTINES ############################ +###################################################################### + +###################################################################### +### Read Data ######################################################## +sub read_data { + + #Set the starting time index (will be incremented to 0 first) + $time_index = -1; + $file_index = -1; + + #Set the fill value in case of missing data. + $fill_value = -9999; + + #Get all of the filenames (including path) to the files in the + #directory of data that satisfy the matching pattern. + @tower_files = (); + + #For each of the dates determined by the user input (&handle_input + #takes us to &handle_date that sets the array @dates) find the files + #for that date and store them in the array @tower_files + foreach $date_string (@dates) { + $data_sub_dir = $month_dirs{$date_string}; + @t_files = glob("${d_data_dir}/$data_sub_dir/${tower_id}_${date_string}*.tx*"); + push(@tower_files,@t_files); + } + + if ($debug) { + print "... Found ".eval($#tower_files +1)." files.\n"; + } + + #I'm not sure where else to put this... I want to hang on to the + #sample loop time, and this is where I put it... + $expected_vars{time} = "SAMPLE_LOOP"; + + #Loop through the filenames loading, then reading each file... + foreach $file (@tower_files) { + + open(DATA_FILE,$file); + #Loop through all lines of data + while ($data_line=) { + + #Here's the work! Seperate all of the data and store it in + #a way that we can easily stuff it into the NetCDF files at + #the end of it all + &seperate_sensors; + + } #Done reading this file + close(DATA_FILE); + + } #Done looping through the files + + #Just a thought here... perhaps all parsing and conversions should + #occur here, operating on the arrays of data, rather than for each + #time... That might also be a better way to handle derived + #variables like pir, density, etc. Maybe later. +} + + +###################################################################### +### Write Netcdf ##################################################### +sub write_netcdf { + + #I think I'd like to pull this out into another script. The point + #of this subroutine is to initialize and populate the NetCDF file + #that will contain the data. + + #################################################################### + # Create a NetCDF file to work with! + if ($debug) { + print "\nCreating NetCDF files:\n"; + } + $nc_name = "${out_data_dir}$out_file_name"; + $nc_sname = "${out_data_dir}$out_file_sname"; + + unless ($#platform_time>0) { + print "Exiting Now! \nFATAL ERROR:\n"; + die " There must be at least one valid record!\n". + " Please try another date range!\n"; + } + + + $ncid = NetCDF::create($nc_name,NetCDF::CLOBBER); + die "Couldn't open $nc_name\n" if $ncid<0; + + $ncid_system = NetCDF::create($nc_sname,NetCDF::CLOBBER); + die "Couldn't open $nc_sname\n" if $ncid_system<0; + + + #################################################################### + # Put Global Attributes... + + if ($debug) { + print "... Putting global variables\n"; + } + + #I had this, but it puts them in random order, so I'll use the order + #direct from globals.table + foreach $global_att (@globals) { + $g_a_value = eval("$global_value{$global_att}"); + $g_a_format = $global_format{$global_att}; + + unless ($g_a_value =~/N\/A/) { + if ($debug>2) { + print "$global_att is $g_a_value\n" + } + $attid = NetCDF::attput($ncid,NetCDF::GLOBAL,"$global_att", + eval('NetCDF::'.$g_a_format), + "$g_a_value"); + $attid = NetCDF::attput($ncid_system,NetCDF::GLOBAL,"$global_att", + eval('NetCDF::'.$g_a_format), + "$g_a_value"); + $attid != -1 || die "\n Couldn't write global attribute $global_att\n"; + } + } + + + + #################################################################### + # Define dimensions, fixed ones first + @{$Vars{LONGITUDE}} = ($tower_lon{$tower_id}); + @{$Vars{LATITUDE}} = ($tower_lat{$tower_id}); + + #I did it this way because I was starting from Brians script (which + #was generally extremely helpful) + %dims = ( + LONGITUDE => 1, + LATITUDE => 1, + TOWER_FILES => $#tower_files+1, + CHARACTERS => 50, + time => $#platform_time+1 + ); + %dim_names = ( + 'a' => 'LATITUDE', + 'o' => 'LONGITUDE', + 'f' => 'TOWER_FILES', + 'c' => 'CHARACTERS', + 't' => 'time' + ); + + + foreach $dim (keys %dims) { + if ($dimensions{$dim}=~/[fc]/){ + $ncid{$dim} = $ncid_system; + } + elsif ($dimensions{$dim}=~/[tao]/) { + $ncid{$dim} = $ncid; + } + + unless ($dim =~/time/) { + $dimid{$dim} = NetCDF::dimdef($ncid{$dim},$dim,$dims{$dim}); + die "Couldn't define $dim dimension\n" if $dimid{$dim}<0; + } + } + + #################################################################### + # Define time dimension + $dimid{time} = NetCDF::dimdef($ncid,"time",NetCDF::UNLIMITED); + die "Couldn't define record dimension\n" if $dimid{time}<0; + + + #################################################################### + # Define variables and put attributes, fixed ones first + if ($debug) { + print "... Defining variables and putting attributes\n"; + } + #################################################################### + # Define variables and put attributes, now time dependant ones + + #Dimension variables like lat and lon. + @all_attributes = ('long_name', 'standard_name', 'units', + 'description', 'range', 'precision' + ); + + @zeros = (0,0,0); #Variables are dependant at most on 4 dimensions + + #foreach $param (keys %Vars) { + foreach $param (@vars) { + if ($param =~/CLOCK/ || $param =~/BBAD/) { + #We'll skip these for now... + } + elsif (defined $Vars{$param}) { + &vardef_attput; + } + } + + #################################################################### + # End Definition period! + $status = NetCDF::endef($ncid); + die "Couldn't end definition\n" if $status<0; + $status = NetCDF::endef($ncid_system); + die "Couldn't end definition\n" if $status<0; + + + #################################################################### + # Start putting variables, first the fixed variables + if ($debug) { + print "... Putting variables:\n\n"; + } + foreach $param (keys %Vars) { + &varput; + } + + #################################################################### + # All done, let's close up! + $status = NetCDF::close($ncid); + $status = NetCDF::close($ncid_system); + +} + +###################################################################### +### Seperate Sensors ################################################# +sub seperate_sensors { + + #This subroutine parses each line of data in a data file: determines + #what the format of the line is, and sends the results onward to + #compute derived variables, parse complicated data strings, and + #convert to scientific units. The organization of this one is + #pretty confusing... + + @data_line = split(', ',$data_line); + @va = (); + #If there is at least one comma in the data line it is of the usual + #data format (not ADCP!) and we'll treat it normally. + + if ($#data_line) { + #Everything other than the CTD and ADCP should fit this... + if ($#data_line == 5) { + ($time,$param_id,$type,$value,$units,$error_string) = @data_line; + } + + #The CTD is still a special case becuase data is comma delimited. + elsif ($#data_line == 8) { + ($time,$param_id,$type,$va[0],$va[1],$va[2],$va[3],$units, + $error_string) = @data_line; + $value = join(',',@va); + $value =~s/\s+//g; + } + + #The CTD is still a special case becuase data is comma delimited. + elsif ($#data_line == 9) { + #print "9\n@data_line\n"; + + ($time,$param_id,$type,$va[0],$va[1],$va[2],$va[3],$va[4], + $units,$error_string) = @data_line; + $value = join(',',@va); + $value =~s/\s+//g; + } + + #The CTD is still a special case becuase data is comma delimited. + elsif ($#data_line == 10) { + #print "10\n@data_line\n"; + + ($time,$param_id,$type,$va[0],$va[1],$va[2],$va[3],$va[4], + $va[5],$units,$error_string) = @data_line; + $value = join(',',@va); + $value =~s/\s+//g; + } + + else { + #print "WARNING: Data line not parsed correctly!\n@data_line\n"; + #This is so a failed parse doesn't end up going to the previous + #param_id + ($time,$param_id,$type,@junk) = @data_line; + #print "!!!!$param_id\n"; + + #$param_id = 'failed'; + $value = "$fill_value,$fill_value,$fill_value,$fill_value"; + + } + if($param_id=~m/CTD1/) { + #$press = 0; + #print "HEY! @data_line"; + #print "$sal = $temp = $press = $cond = $fill_value\n"; + } + + #If it has failed the previous two options, than something is wrong. + #In fact, the second choice shouldn't ever occur, because Sara has + #implemented a change that puts quotes around data values that need + #special parsing. + + #elsif ($debug>2) { + #print "Error suspected for data line:\n$data_line\n"; + #} + $big_type = $type; + $big_type =~s/\([0-9]\)//g; + + #This is a first attempt at dealing with variables that contain + #a number of sub variables. For example the CTD output string + #contains temparature conductivity salinity and density. + #our (@sub_vars,%sub_vars); + + @sub_vars = @{$sub_vars{$param_id}}; + + &compute_sub_vars; + + + if ($param_id=~/ID/) { + $file_index++; + } + #If we are at the start of a file, keep track of the settings + #listed, especially the param_id's that we expect to be in + #each record, so that we can insert fill values where needed. + + if ($type=~/SETTING/ && $param_id=~/ACTIVE/) { + #The following pattern is used in several of these cases. It + #should probably be a subroutine... + #1. Get rid of double quotes in the data string + #2. Seperate the string into an array (each character is an entry) + #3. If it is empty put in a dash as the first character (not sure + # why I chose that... + #4. Fill the unused portion of the 50 character array with spaces + #5. Add the result to the master hash array for this param_id + + #1 + $value =~s/\"//g; + #2 + @value = split("","$value"); + @this_val = @value; + #3 + unless ($#value+1) { + @value = ("-"); + } + #4 + for ($ii=$#value+1; $ii<50; $ii++) { + @this_val[$ii] = " "; + } + #5 + push(@{$Vars{$param_id}},@this_val); + + $expected_vars = $value; + $expected_vars=~s/\"//g; + @expected_vars = split('\s',$expected_vars); + + + my($t_type) = $param_id; + $t_type =~s/^ACTIVE\_//; + + @{$expected_vars{$t_type}} = @expected_vars; + } + elsif ($type=~/CPU/) { + #see if ($type=~/SETTING/ && $param_id=~/ACTIVE/) { + $value =~s/\"//g; + @value = split("","$value"); + @this_val = @value; + unless ($#value+1) { + @value = (" "); + } + for ($ii=$#value+1; $ii<50; $ii++) { + @this_val[$ii] = " "; + } + push(@{$Vars{$param_id}},@this_val); + } + elsif ($type=~/CLOCK/) { + #see if ($type=~/SETTING/ && $param_id=~/ACTIVE/) { + $value =~s/\"//g; + @value = split("","$value"); + @this_val = @value; + unless ($#value+1) { + @value = (" "); + } + for ($ii=$#value+1; $ii<50; $ii++) { + @this_val[$ii] = " "; + } + push(@{$Vars{$param_id}},@this_val); + } + + #The next little clause here is sort of weird. There are some + #computed or parsed variables that are not in the raw file as + #a param_id. For example PIRA PIRB and PIRC are all parameters + #but we really want to know what PIR is and we don't care about + #the raw data that goes into it... I'm just letting the script + #know to expect these variables to be included later. + + elsif ($#{$expected_vars{$big_type}}) { + push(@{$loop_vars{$big_type}},$param_id); + + if ($param_id=~/LINK$/) { + if ($first_one) { + @expected_vars = ('LINK','LINK_AMPS','LINK_VOLTS','LINK_AMP_HRS', + 'LINK_TEMP'); + push(@{$expected_vars{$big_type}},@expected_vars); + + @expected_vars = ('SAMPLE_LOOP','BBAD_SAMPLE_LOOP'); + push(@{$expected_vars{TIME}},@expected_vars); + + @expected_vars = ('PIR'); + push(@{$expected_vars{RLCAD}},@expected_vars); + + $first_one = 0; + } + push(@{$loop_vars{$big_type}}, 'LINK','LINK_AMPS','LINK_VOLTS', + 'LINK_AMP_HRS','LINK_TEMP'); + } + } + + + #If we are at the start of a data record, use this time for the + #rest of the samples in this loop (may want to change this...) + if ($param_id=~/ATEMP/) { + + $time_index++; + #Here I'm trying to work in some logic to deal with times when + #not every expected variable gets reported in the loop, for + #example when the BBAD has a time-out error. This leads to + #the system not reporting WSPDA or WDIRA, which is otherwise + #not noticed, and the empty values lead to a segmentation fault + #when the netcdf file is written. + foreach $expected_type (keys %expected_vars) { + $num_expected = $#{$expected_vars{$expected_type}}; + $num_recieved = $#{$loop_vars{$expected_type}}; + + #Check to see if the number expected is greater than the number + #recieved (and also greater than 0, to deal with system info that + #doesn't describe variables in the loop!) + if ($num_expected>$num_recieved && $num_expected && $time_index>=0) { + + #For every parameter that we are expecting, we should put in a + #fill value. Actually this all should probably go outside the + #loop as part of the initialization process. + foreach $expected_var (@{$expected_vars{$expected_type}}) { + #write fill value! + + ${$Vars{$expected_var}}[$time_index] = $fill_value; + } #End Foreach expected var + + #Okay, this one is a bit wierd. Clock (sample_loop) is not + #yet included in RLCAD, BBAD, or SERIAL, so it isn't expected. + #Thus if it isn't reported, we need to insert a fill_value + + #In the current version, this IS fixed. In fact CLOCK isn't used + #at all. It has been replaced by SAMPLE_LOOP. + unless(${$Vars{"CLOCK"}}[$time_index]) { + ${$Vars{"CLOCK"}}[$time_index] = $fill_value; + } #end unless clock thing... + }#end if still expecting more... + }#end foreach expected type + + %loop_vars = (); + + + #Now that is out of the way, time is a bit more normal, but still + #needs to be dealt with seperately as it occurs only once per + #sample loop and is not explicitly a loop variable. + + $platform_time[$time_index] = $time; + $u_date = &UnixDate(&ParseDate("$time"),"%Y,%m,%d,%H,%M,%S"); + ($year,$month,$day,$hour,$minute,$second) = split(',',$u_date); + + $u_date = &UnixDate(&ParseDate("$time UTC"),"%s"); + $um1_date = &UnixDate(&ParseDate("$platform_time[$time_index -1] UTC"), + "%s"); + $sample_interval = $u_date - $um1_date; + $hrs_per_sample = $sample_interval/3600; #Seconds/hr + + unless ($time_index) { + $hrs_per_sample = 1/30; + } + #1970/01/01 00:00:00 as a datenum + $epoch_dn = 719529; + + #Convert the seconds since epoch to a datenum + $datenum = $u_date/86400 + $epoch_dn; + + ${$Vars{'year'}}[$time_index] = $year; + ${$Vars{'month'}}[$time_index] = $month; + ${$Vars{'day'}}[$time_index] = $day; + ${$Vars{'hour'}}[$time_index] = $hour; + ${$Vars{'minute'}}[$time_index] = $minute; + ${$Vars{'second'}}[$time_index] = $second; + ${$Vars{'time'}}[$time_index] = $datenum; + + }#end if ATEMP + + #Apply information from the parse table to split up the output + &parse_vars; + + #Use the coefficients and formulas from the conversions table to + #apply any necessary conversions + &convert_vars; + + #I'm not sure of a good way to get it to automatically convert + #and derive pir from the case temperature and the thermistor... + #This way is definitely a hack... + + #If we have data for PIRA and PIRC, then we can compute PIR + if ($param_id =~/PIRC/ | $param_id =~/PIRA/) { + + if ($Vars{PIRA}[-1]!=~/$fill_value/ && + $Vars{PIRC}[-1]!=~/$fill_value/){ + $temporary_param = $param_id; + $param_id = 'PIR'; + + $pir_ct = $Vars{PIRA}[-1]; + $pir_th = $Vars{PIRC}[-1]; + + &convert_vars; + $param_id = $temporary_param; + } + else { + $Vars{PIR} = $fill_value; + } + } + $value = undef; + + } + + #Otherwise the data line has no commas, so it must be an adcp line + else { + #I haven't put any logic in here yet + #&parse_adcp; + } +} + +###################################################################### +### Parse Vars ####################################################### +sub parse_vars { + + #Seperate out the output from matching conditions + + #The hash array parse_output comes from the meta_data perl module that + #looks into the data tables. It explains the string format for each + #variable and how to assign the variables given that format. + $output = $parse_output{$param_id}; + @output = split(',',$output); + + + if ($units{$param_id}=~/string/) { + #It was complaining about the gps checksum until I added '' + eval("$output[0] = '$value';"); + } + else { + #Apply matching conditions from the parse table + $old_v = $value; + + #Okay, this is hard wired... I know it's better to avoid, but I wanted + #a quick fix... This handles wind, which is an array of values separated + #by spaces. An average value should be presented for later conversion. + if ($parse_info{$param_id}=~/\@avg/) { + #Spit up space delimited values and ignore fill values + $old_v =~s/\ \-9999//g; + @value = split(' ',$old_v); + eval("$output[0]".' = @value;'); + } + + #If the output is one parameter (applies to almost all sensors) + elsif ($#output==0) { + #Assign the output value to the parse_info matching condition + #Here $1 signifies the part that matches what is inside the + #first set of parenthesis in a matching condition. + #Example: if $value is "PS=+14.693" + # then $value =~m/"PS\=\+(.*)"/; + # sets $1 to be 14.693 + $value =~m/$parse_info{$param_id}/; + @value = $1; + + #As long as there is a defined value, set the output to that + if (defined $value[0]) { + eval("$output[0]".' = $value[0];'); + } + else { + eval("$output[0] = $fill_value;"); + } + } + + #Applies to the ctd and the link, in particular + elsif ($#output>0) { + if ($param_id =~m/CTD/) { + #As long as the string begins with '"#0' proceed. + if ($value=~m/^\"\#0/) { + $pi = $parse_info{$param_id}; + } + else { + $pi = 'NOBAD!!'; + } + } + else { + $pi = $parse_info{$param_id}; + } + $value =~m/$pi/; + + #Loop through each output parameter and assign the value + #For example suppose there were three variables in the matching + #condition '$value =~m/$pi/;', then they will be assigned to + #$1,$2, and $3, thus you want to assign them as + #eval("$output[0] = $1;"); + #so if @output = ($temp,$humidity,$pressure) + #then you have $temp set to the contents of $1. Clear??? + for ($out_num=1; $out_num<=$#output+1; $out_num++) { + eval("$output[$out_num-1] =\$$out_num;"); + } + } + } +} + +###################################################################### +### Convert Vars ##################################################### +sub convert_vars { + our($fill_value); + + #Again, these coefficients and formulas are coming from the + #meta_data perl module, and the corresponding data tables. + + #Since conversion coefficients are different for the different + #platforms it looks like this $R4_conversion_coeff{PSP} + + #Get conversion coefficients and formula from hash array for + #each tower id and each parameter id. + eval ('$c_coeff = $'.$tower_id.'_conversion_coeff{$param_id};'); + eval ('$c_formula = $'.$tower_id.'_conversion_formula{$param_id};'); + + #Split up conversion coefficients from the converstions table + @v = split(',',$c_coeff); + + #If there is any set of conversion coefficients (and hence a + #conversion to be applied), apply them! + if ($#v+1) { + $temp_var = ''; + if ($c_formula=~/^\&/) { + #If the conversion formula is a subroutine call, evaluate! + eval("$c_formula"); + } + else { + #As long as the output wasn't the fill value, convert it. + my ($out) = eval("$output[0]"); + unless($out=~/$fill_value/) { + $temp_var = eval("$c_formula"); + } + + #Otherwise, we don't want to convert a fill value to + #something else! + else { + $temp_var = $fill_value; + } + + #Set the array index based upon the record dimension + &set_index; + + #This should go somewhere else... + if ($param_id=~/RAIN/) { + #print "Hrs per : $hrs_per_sample\n"; + $temp_var = $temp_var/$hrs_per_sample; + } + + #Finally, set this value of the Vars super duper array + #for this time to the value that we've computed + ${$Vars{$param_id}}[$index] = $temp_var; + } + } + + else { + #print "No conversion info available for $param_id at $tower_id\n"; + } +} + + +###################################################################### +### Handle Input ##################################################### +sub handle_input { + + #By putting default values in a file, the script should easily switch + #back and forth between the afs version and the local nemo version! + open(DEFAULTS,"${bin_dir}tower_parse.defaults"); + while () { + #Get rid of the newline + chop; + #Ignore comments starting with # + $_=~s/#.*//; + #If the line is non-empty + if ($_) { + my($var_name, $default_value) = split(','); + eval("$var_name = $default_value;"); + } + } + + ($date_string,%varargin) = @ARGV; + + #Associate each input argument pair with the appropriate variable + %varargout = ( + '-out' => '$out_file_name', + '-d' => '$debug', + '-t' => '$tower_id', + '-p' => '$package', + ); + + #Set each variable to the value of the associated input argument + #Example 1: '-d 1' sets the debug flag to true + #Example 2: '-out 2004_06.nc' sets the output file name to 2004_06.nc + foreach $argin (keys %varargin) { + eval("$varargout{$argin} = '$varargin{$argin}';"); + } + + $d_data_dir = "$d_data_dir$tower_id/"; + $out_data_dir = "$out_data_dir$tower_id/"; + + #Since there are a few different types of date string inputs, we need + #to figure out how to deal with this one! + if ($date_string) { + &handle_date; + } + + #If there's no date string, then we don't know what to look for! + else { + die "Must at least input a date string!\n". + "./tower_parse.perl '200406' -out 2004_06.nc -d 1\n"; + } + + #Helps the user chooose an appropriate filename + unless ($out_file_name=~/.nc$/) { + if ($out_file_name) { + $out_file_sname = "${out_file_name}_sys.nc"; + $out_file_name = "${out_file_name}.nc"; + } + else { + $out_file_name = $d_out_file_name; + @do = split('',$d_out_file_name); + $out_file_sname = join('',@do[0..$#do-3],'_sys.nc'); + } + } + else { + unless ($out_file_sname) { + @do = split('',$out_file_name); + $out_file_sname = join('',@do[0..$#do-3],'_sys.nc'); + } + } + + #This will come up many times throughout the script. Another way of + #looking at the debug flag is that it turns on comments (verbose). + if ($debug) { + print "\n\nData dir : $d_data_dir\nOutput dir : $out_data_dir\n". + "Outfile name : $out_file_name and $out_file_sname\n"; + if ($#dates) { + print "\nLooking for data between $dates[0] and $dates[-1]\n"; + } + } + + +} + + +###################################################################### +### Handle Date ###################################################### +sub handle_date { + #Deal with date input. + if ($date_string=~/\ /) { + ($st_date,$en_date) = split(' ',$date_string); + @st_date = split('',$st_date); + @en_date = split('',$en_date); + + #print "So $st_date, $en_date is $#st_date or @st_date\n"; + $st_date = join('',(@st_date[0..3],' ',@st_date[4..5],' ',@st_date[6..7])); + $en_date = join('',(@en_date[0..3],' ',@en_date[4..5],' ',@en_date[6..7])); + + #print "So $st_date, $en_date is @st_date\n"; + $this_date = $st_date; + $this_parsed = &ParseDate($st_date); + $en_parsed = &ParseDate($en_date); + + @dates = (); + %month_dirs = (); + + while ($this_parsed <= $en_parsed) { + $ymd = &UnixDate($this_parsed,"%Y%m%d"); + push(@dates,$ymd); + $month_dirs{$ymd} = &UnixDate($this_parsed,"%Y_%m"); + $this_date = &UnixDate(&DateCalc($this_date,"+ 1 day"), "%Y %m %d"); + $this_parsed = &ParseDate($this_date); + } + #print "$#dates Dates! @dates\n"; + } + elsif ($date_string=~/latest/) { + $today = &ParseDate("today"); + $date1 = &UnixDate(&DateCalc("$today","- 2 day"),"%Y%m%d"); + $date2 = &UnixDate(&DateCalc("$today","- 1 day"),"%Y%m%d"); + $date3 = &UnixDate("$today","%Y%m%d"); + $mond1 = &UnixDate(&DateCalc("$today","- 2 day"),"%Y_%m"); + $mond2 = &UnixDate(&DateCalc("$today","- 1 day"),"%Y_%m"); + $mond3 = &UnixDate("$today","%Y_%m"); + @dates = ($date1,$date2,$date3); + %month_dirs = ($date1,$mond1,$date2,$mond2,$date3,$mond3); + #print "@dates\n"; + } + elsif ($date_string =~/help/) { + #oops this isn't a date string at all! + # I should probably put this somewhere else... + print "\nUsage: ./tower_parse.perl date_string\n\n". + "Optional argument pairs:\n". + " -out output file name\n". + " -d debug\n". +# " -dir directory path to data\n". + " -t tower id\n". + " -nemo scp data file to nemo\n\n"; + print "Date string can have any of the following formats:\n". + " yyyymm Finds all data for the month\n". + " yyyymmdd Finds data just for one day\n". + " 'yyyymmdd yyyymmdd' Finds data within the date range\n". + " latest Finds today, yesterday and the previous day\n"; + die "\n"; + } + else { + @dates = ($date_string); + @date_str = split('',$date_string); + $fn = join('',(@date_str[0..3],'_',@date_str[4..5])); + + unless($out_file_name) { + #Unless it has been input by the user! + $out_file_name = "${tower_id}_${fn}.nc"; + $out_file_sname = "${tower_id}_${fn}_sys.nc"; + } + + #Also change default data directory! + $month_dirs{$date_string} = $fn; + } + @month_dirs = values (%month_dirs); +} + + +###################################################################### +### Parse ADCP ####################################################### +sub parse_adcp { + + #print "We have ADCP data!\n"; + #$data = join('',@data); + +} + + +###################################################################### +### Vardef Attput #################################################### +sub vardef_attput { + + #This is the generic variable definition and attribute put used by + #write_netcdf. + $format = 'NetCDF::'.$format{$param}; + if ($debug>2) { + print "$param is of format $format\n"; + } + + @dimensions = split('\s',$dimensions{$param}); + @dim_names = @dim_names{@dimensions}; + @dim_ids = @dimid{@dim_names}; + + $dimensions = join('',@dimensions); + + #Set the record dimension to be time or file number based on + #contents of variables.table + if ($dimensions=~/f/) { + $ncid{$param} = $ncid_system; + } + elsif ($dimensions=~/t/) { + $ncid{$param} = $ncid; + } + + + $varid{$param} = NetCDF::vardef($ncid{$param},$param, + eval("$format"), + [@dim_ids]); + + die "Couldn't define variable $param\n" if $varid{$param}<0; + + + #print "$param should have $#all_attributes\n"; + foreach $attribute (@all_attributes) { + $att_val = eval('\$'.$attribute.'{$param}'); + if (defined $att_val && $att_val!=~/^N\/A/) { + $attid = NetCDF::attput($ncid{$param},$varid{$param},"$attribute", + NetCDF::CHAR, + eval('\$'.$attribute.'{$param}')); + }#end if + }#end foreach $attribute +} + +###################################################################### +### Varput ########################################################### +sub varput { + $format = 'NetCDF::'.$format{$param}; + + @dimensions = split('\s',$dimensions{$param}); + @dim_names = @dim_names{@dimensions}; + #@dim_ids = @dimid{@dim_names}; + @dim_counts = @dims{@dim_names}; + @dim_starts = @zeros[0..$#dim_names]; + + unless ($param =~/CLOCK/ || $param =~/BBAD/ || + $param =~/GPS/ || $param =~/LINK$/) { + + #No matter how good it looks, test the arrray for undefined values! + #(This is painfully slow and really should be replaced by initializing + #the arrays at the start...) + @temp_array = @{$Vars{$param}}; + for ($ii=0; $ii<=$#temp_array; $ii++) { + unless (defined($temp_array[$ii])) { + ${$Vars{$param}}[$ii] = $fill_value; + } + } + + if ($debug>1) { + print "$param length ".eval($#{$Vars{$param}}+1). + ", id $varid{$param}\n"; + } + + unless ($format=~/CHAR/) { + #Put the variable into the netcdf file! + $status = NetCDF::varput($ncid{$param},$varid{$param}, + \@dim_starts,\@dim_counts, + \@{$Vars{$param}}); + } + else { + #Test to make sure it is as long as we expected... + if ($#{$Vars{$param}}+1==($#tower_files+1)*50) { + $status = NetCDF::varput($ncid{$param},$varid{$param}, + \@dim_starts,\@dim_counts, + \@{$Vars{$param}}); + } + elsif ($debug>1) { + print "Didn't have enough values for $param\n"; + } + } + }#End unless that ignores clock,bbad,gps and link strings + else { + print "$param being ignored\n"; + } +} + +###################################################################### +### Compute Sub Vars ################################################# +sub compute_sub_vars { + + if ($#sub_vars +1) { + $orig_param = $param_id; + + foreach $sub_param (@sub_vars) { + $param_id = $sub_param; + &convert_vars; + } + $param_id = $orig_param; + } +} + +###################################################################### +### Set Index ######################################################## +sub set_index { + + #If the record dimension is time, use the time index + if ($dimensions{$param_id}=~/t/) { + $index = $time_index; + } + #If the record dimension is file number use that index + elsif ($dimensions{$param_id}=~/f/) { + $index = $file_index; + } +} + + +###################################################################### +### Avg Wind ######################################################### +sub avg_wind { + #1. Check for all necessary components: + # a. 'spda' -> WSPDA + # b. 'dira' -> WDIRA + # c. 'spdb' -> WSPDB (Optional) [alternative is 'spdn' if empty] + # d. 'dirb' -> WDIRB (Optional) [alternative is 'dirn' if empty] + # e. 'cmp1' -> COMP1 (Optional) [alternative is an offset, which + # defaults to 0 unless otherwise set... Does not requre pkgb] + # f. 'cmp2' -> COMP2 [Not Used!] + # + #2. Loop through times: + # a. Replace out of range values or empty package with fill_value + # b. Apply direction offset + # c. Compute vector components (u,v) + # + #3. Compute statistics + # + #4. Store data values + + my(@junk) = (); + my(@input) = (@_); + %names = ('spda'=>'wi_spd_a', + 'dira'=>'wi_dir_a', + 'spdb'=>'wi_spd_b', + 'dirb'=>'wi_dir_b', + 'spdn'=>'junk', + 'dirn'=>'junk', + 'cmp1'=>'comp_1', + 'cmp2'=>'comp_2'); + + + #1. Check for all necessary components: + if ($input[0]=~/spda/) { + #First variable on the list, initialize temporary data arrays + + #If we've already been through the loop once... + if ($dira[0]) { + $real_last_var = $last_var; + + if ($#cmp1<0) { + #No compass data. Nor is there an available offset. + @cmp1 = (0); + } + } + else { + #for the first one, so it doesn't confuse the real_last_var + $real_last_var = 'NOPE'; + } + + #Now initialize the arrays + @spda = @dira = @spdb = @dirb = @cmp1 = @cmp2 = (); + } + elsif ($input[0]=~/dir/) { + if ($#input==1) { + #Then we have been given a directional offset and should + #apply it! + $offset = $input[1]; + } + else { + $offset = 0; + } + } + #print("\@$input[0] = \@$names{$input[0]};\n"); + eval("\@$input[0] = \@$names{$input[0]};"); + + if ($input[0]=~/$real_last_var/) { + #Write the data from this sample. + &handle_wind; + &write_wind; + } + + $last_var = $input[0]; +} + + +###################################################################### +### Handle Wind ###################################################### +sub handle_wind { + #This subroutine works for average_wind: once data arrays are + #collected it preforms all the necessary operations on them. + + my($time); + our($u_mean_a,$u_max_a,$u_std_a,$u_mean_b,$u_max_b,$u_std_b, + $v_mean_a,$v_max_a,$v_std_a,$v_mean_b,$v_max_b,$v_std_b, + $mean_spd_a,$mean_dir_a,$mean_spd_b,$mean_dir_b,$spd_std_a, + $dir_std_a,$spd_std_b,$dir_std_b,$gust_a,$gust_b) = $fill_value; + + my(@u_a,@v_a,@u_b,@v_b,@temp_cmp,@comp_off) = (); + + + #Loop through samples... + for ($time=0; $time<=$#spda; $time++) { + + #Make sure there is some directional offset to apply! + if ($#cmp1<1) { + #If compass data wasn't parsed correctly, fix it! + if ($cmp1[0]=~/\ /) { + @temp_cmp = split(' ',$cmp1[0]); + @cmp1 = @temp_cmp; + $comp_off[$time] = &volts2comp($cmp1[$time]) + $offset; + } + #No compass, using fixed offset + else { + $comp_off[$time] = &volts2comp($cmp1[0]) + $offset; + } + } + else{ + #There is a compass reading so use that (buoy) + $comp_off[$time] = &volts2comp($cmp1[$time]) + $offset; + } + + + #Apply simple, static conversion from voltage to scientific values + ($spda[$time],$dira[$time]) = &volts2spddir($spda[$time],$dira[$time]); + ($spdb[$time],$dirb[$time]) = &volts2spddir($spdb[$time],$dirb[$time]); + + + #Make sure speeds are reasonable and if speed or direction are + #bad, both are badflagged + $bada = ($spda[$time]>100 | $spda[$time]==$fill_value | + $dira[$time]==$fill_value); + if ($bada) { + $spda[$time] = $dira[$time] = $u_a[$time] = $v_a[$time] = $fill_value; + } + else { + #Take the direction mod 360 + $dira[$time] = &modulo($dira[$time] + $comp_off[$time], 360); + #Convert Spd and Dir to U and V components + ($u_a[$time],$v_a[$time]) = &spddir2uv($spda[$time],$dira[$time]); + } + + #Ditto for the b package! (as long as there is a b package...) + unless ($#spdb<0) { + $badb = ($spdb[$time]>100 | $spdb[$time]==$fill_value | + $dirb[$time]==$fill_value); + if ($badb) { + $spdb[$time] = $dirb[$time] = $u_b[$time] = + $v_b[$time] = $fill_value; + } + else { + $dirb[$time] = &modulo($dirb[$time] + $comp_off[$time], 360); + ($u_b[$time],$v_b[$time]) = &spddir2uv($spdb[$time],$dirb[$time]); + } + } + } + + #a package stats + #($mean,$std,$max) = &fill_stats(@array); + ($u_mean_a,$u_std_a,$u_max_a) = &fill_stats(@u_a); + ($v_mean_a,$v_std_a,$v_max_a) = &fill_stats(@v_a); + #In terms of speed, mean speed is wrong + (undef,$spd_std_a,$gust_a) = &fill_stats(@spda); + #For direction, only std dev is right... + (undef,$dir_std_a,undef) = &fill_stats(@dira); + + ($mean_spd_a,$mean_dir_a) = &uv2spddir($u_mean_a,$v_mean_a); + + ($comp_mean,$comp_std,undef) = &fill_stats(@comp_off); + + #b package stats + unless ($#u_b<0) { + ($u_mean_b,$u_std_b,$u_max_b) = &fill_stats(@u_b); + ($v_mean_b,$v_std_b,$v_max_b) = &fill_stats(@v_b); + #In terms of speed, mean speed is wrong + (undef,$spd_std_b,$gust_b) = &fill_stats(@spdb); + #For direction, only std dev is right... + (undef,$dir_std_b,undef) = &fill_stats(@dirb); + + ($mean_spd_b,$mean_dir_b) = &uv2spddir($u_mean_b,$v_mean_b); + } +} + +###################################################################### +### Write_Wind ######################################################## +sub write_wind { + + unless ($mean_dir_a == $fill_value || + $mean_spd_a == $fill_value) { + #put variables into array!!! + ${$Vars{WSPDA}}[$index] = $mean_spd_a; + ${$Vars{WDIRA}}[$index] = $mean_dir_a; + ${$Vars{WEASTA}}[$index] = $u_mean_a; + ${$Vars{WNORTHA}}[$index] = $v_mean_a; + ${$Vars{WSPDSTDA}}[$index] = $spd_std_a; + ${$Vars{WDIRSTDA}}[$index] = $dir_std_a; + ${$Vars{WGSTA}}[$index] = $gust_a; + } + else { + ${$Vars{WSPDA}}[$index] = $fill_value; + ${$Vars{WDIRA}}[$index] = $fill_value; + ${$Vars{WEASTA}}[$index] = $fill_value; + ${$Vars{WNORTHA}}[$index] = $fill_value; + ${$Vars{WSPDSTDA}}[$index] = $fill_value; + ${$Vars{WDIRSTDA}}[$index] = $fill_value; + ${$Vars{WGSTA}}[$index] = $fill_value; + } + unless ($mean_dir_b == $fill_value || + $mean_spd_b == $fill_value) { + #put variables into array!!! + ${$Vars{WSPDB}}[$index] = $mean_spd_b; + ${$Vars{WDIRB}}[$index] = $mean_dir_b; + ${$Vars{WEASTB}}[$index] = $u_mean_b; + ${$Vars{WNORTHB}}[$index] = $v_mean_b; + ${$Vars{WSPDSTDB}}[$index] = $spd_std_b; + ${$Vars{WDIRSTDB}}[$index] = $dir_std_b; + ${$Vars{WGSTB}}[$index] = $gust_b; + } + else { + ${$Vars{WSPDB}}[$index] = $fill_value; + ${$Vars{WDIRB}}[$index] = $fill_value; + ${$Vars{WEASTB}}[$index] = $fill_value; + ${$Vars{WNORTHB}}[$index] = $fill_value; + ${$Vars{WSPDSTDB}}[$index] = $fill_value; + ${$Vars{WDIRSTDB}}[$index] = $fill_value; + ${$Vars{WGSTB}}[$index] = $fill_value; + } + + unless ($comp_std == 0 || + $comp_mean == -9999) { + ${$Vars{COMP1}}[$index] = $comp_mean; + } + else { + ${$Vars{COMP1}}[$index] = $fill_value; + } +} + +###################################################################### +### Volts2SpdDir ##################################################### +sub volts2spddir { + + my($volts_spd,$volts_dir) = @_; + my($wind_spd,$wind_dir) = undef; + + unless($volts_spd=~/$fill_value/) { + #0->1 V : 0 60 m/s + $wind_spd = $volts_spd*60; + } + else { $wind_spd = $fill_value; } + + unless($volts_dir=~/$fill_value/) { + #0->1 V : 0 360 deg + $wind_dir = $volts_dir*360; + } + else { $wind_dir = $fill_value; } + + return ($wind_spd,$wind_dir); +} + +###################################################################### +### Volts2Comp ####################################################### +sub volts2comp { + + my($volts_comp) = @_; + + unless($volts_comp=~/$fill_value/) { + #0->1 V : 0 360 deg + return $volts_comp*360; + } + else { return $fill_value; } +} + + + +###################################################################### +### SpdDir2UV ######################################################## +sub spddir2uv { + #convert speed and direction to u and v + my($wind_spd,$wind_dir) = @_; + my($deg2rad) = .0174533; + my($wind_u,$wind_v) = undef; + + + unless($wind_spd=~/$fill_value/ || $wind_dir=~/$fill_value/) { + #okay this is terrible but I'm at a loss what else to do. + $wind_v = ($wind_spd)*cos($wind_dir*$deg2rad); + $wind_u = ($wind_spd)*sin($wind_dir*$deg2rad); + return ($wind_u,$wind_v); + } + else { + #print "no!?"; + return ($fill_value,$fill_value); + } +} + +###################################################################### +### UV2SpdDir ######################################################## +sub uv2spddir { + #convert speed and direction to u and v + my($wind_u,$wind_v) = @_; + my($deg2rad) = .0174533; + my($wind_spd,$wind_dir) = undef; + + unless($wind_u=~/$fill_value/ || $wind_v=~/$fill_value/) { + $wind_spd = ($wind_u**2 + $wind_v**2)**(1/2); + $wind_dir = &modulo(atan2($wind_u, $wind_v)/$deg2rad,360); + return ($wind_spd,$wind_dir); + } + else { + return ($fill_value,$fill_value); + } +} + +###################################################################### +### Avg Rain ######################################################### +sub avg_rain { + #Convert cumulative rainfall readings for self siphoning rain + #guage into a rainfall amount over the sampling period. + + #I haven't figured this out yet... + #print "RAIN???\n"; + + #First I need to check the voltage -> volume. + #Then, make sure it isn't in the process of dumping (look at diff, + #confirm that it isn't largely negative) + #Finally look at the change since the previous sample loop to get + #the cumulative rain (and if it is negative, add the dumping + #volume) + + ${$Vars{RAIN}}[$index] = $fill_value; +} + + + + +###################################################################### +### Fill Stats ####################################################### +sub fill_stats(@array) { + + my(@array,$mean_value); + @array = @_; + + $array = join(',',@array); + $array =~s/$fill_value//g; + $array =~s/\,\,/\,/g; + @array = split(',',$array); + + unless ($#array<0) { + ($mean) = &mean(@array); + ($std) = &std_dev(@array); + ($max) = &max(@array); + return ($mean,$std,$max); + } + else { + return ($fill_value,$fill_value,$fill_value); + } +} + +###################################################################### +### Mean ############################################################# +sub mean(@array) { + my(@array,$mean_value); + @array = @_; + + $sum_array = join('+',@array); + + if ($sum_array =~m/\+\+/) { + return $fill_value; + } + #print "Averaging!\n$sum_array\n"; + + eval('$mean_value = ('."$sum_array".')/($#array+1);'); + return $mean_value; +} + +###################################################################### +### Std Dev ########################################################## +sub std_dev(@array) { + my(@array,$std_dev); + @array = @_; + + my $temp_std = new Statistics::Basic::StdDev(\@array); + $std_dev = $temp_std -> query; + + return $std_dev; +} + +###################################################################### +### Max ############################################################## +sub max { + #From perldoc.com + my $max = shift(@_); + foreach $foo (@_) { + $max = $foo if $max < $foo; + } + return $max; +} + +###################################################################### +### Modulo ########################################################### +sub modulo($element,$modulus) { + #Do modulus of the element, but don't throw away the remainder + + my($element,$modulus,$el,$floor) = @_; + + if ($element < 0) { + return $element + $modulus; + } + elsif ($element <= $modulus) { + return $element; + } + elsif ($element > 3*$modulus) { + #print "Wow $element is HUGE!\n"; + return $fill_value; + } + elsif ($element > 2*$modulus) { + return $element - 2*$modulus; + } + elsif ($element > $modulus) { + return $element - $modulus; + } +} + + + + Index: tower_buoy/bin/tower_parse_dev.perl =================================================================== --- (revision ) +++ tower_buoy/bin/tower_parse_dev.perl (revision 7) @@ -1,0 +1,1659 @@ +#!/afs/isis/pkg/perl-582/bin/perl +#tower_strip.perl +#Time-stamp: <2006-06-12 11:52:14 lstearns> +# +#Abstract: +# This script is designed to parse existing tower data for a given +# time range and save the output as a netcdf file containing the +# converted data values as well as ancillary information. +# +# ./tower_parse.perl -help +# For more information on input arguments +# +#Created: 2003.09?.?? maybe +#Author: Luke Stearns +#Modifications: started back up 2004.03.?? still going.... +# +# Luke Stearns 2006.03.15 - going back to improve some of the comments +# + + +###################################################################### +# Set up libraries and paths. + +use lib '/opt/local/seacoos/bin/'; +use lib '/opt/local/seacoos/bin/meta_data/'; +use meta_data; +$bin_dir = '/opt/local/seacoos/bin/meta_data/'; + +#meta_data.pm is a module I wrote to access some data tables in +#/opt/local/seacoos/bin/meta_data/ +#I intended these tables as a first step towards designing a relational +#database to store instrument configuration and deployment information. + +#Development paths and libraries: +# use lib '/afs/isis.unc.edu/depts/marine/workspace/hseim/sablam4/'. +# 'lstearns/perl/test_nemo/'; +# use lib '/afs/isis.unc.edu/depts/marine/workspace/hseim/sablam4/'. +# 'lstearns/perl/test_nemo/meta_data/'; +# use meta_data; +# $bin_dir = '/afs/isis.unc.edu/depts/marine/workspace/hseim/sablam4/'. +# 'lstearns/perl/test_nemo/meta_data/'; + +#Other included modules: +use NetCDF; +use Date::Manip; +use Statistics::Basic::StdDev; +use Math::BigFloat; + +###################################################################### +# Keep track of the time it takes to run the script +$starttime = time; + +###################################################################### +# Handle input arguments, namely a date string and a path, if given +# I'd like to handle a variety of input arguments +&handle_input; + +###################################################################### +# Read information about variables from the tables: parsing info, +# conversions, and meta-data + +#This is now handled by the 'use meta_data;' line above. + +###################################################################### +# Read in the data files and parse each line of data! +# This subroutine drives the bulk of the script! +if ($debug) {print "\nReading data files:\n";} +$first_one = 1; +&read_data; + +###################################################################### +# Finally, write the data to the NetCDF file. This is where it +# crashes more often than not. +#&test_data; +&write_netcdf; + +###################################################################### +# Let us know how long it took! +$cummtime = time - $starttime; +if ($debug) { + print "Closing NetCDF files:\nALL DONE!"; + print "\nTotal time $cummtime sec\n"; +} + +if ($nemo) { + print "Attempting to scp file to nemo... (will require passwd)\n"; + system("scp $out_data_dir$out_file_name nemo.isis.unc.edu:/seacoos/". + "data/nc-coos/roof/"); +} + +###################################################################### +####################### BEGIN SUBROUTINES ############################ +###################################################################### + +###################################################################### +### Read Data ######################################################## +sub read_data { + + #Set the starting time index (will be incremented to 0 first) + $time_index = -1; + $file_index = -1; + + #Set the fill value in case of missing data. + $fill_value = -9999; + + #Get all of the filenames (including path) to the files in the + #directory of data that satisfy the matching pattern. + @tower_files = (); + + #For each of the dates determined by the user input (&handle_input + #takes us to &handle_date that sets the array @dates) find the files + #for that date and store them in the array @tower_files + foreach $date_string (@dates) { + $data_sub_dir = $month_dirs{$date_string}; + @t_files = glob("${d_data_dir}/$data_sub_dir/${tower_id}_${date_string}*.tx*"); + push(@tower_files,@t_files); + + } + + if ($debug) { + print "... Found ".eval($#tower_files +1)." files.\n"; + } + + #I'm not sure where else to put this... I want to hang on to the + #sample loop time, and this is where I put it... + $expected_vars{time} = "SAMPLE_LOOP"; + + #Loop through the filenames loading, then reading each file... + foreach $file (@tower_files) { + $file_time = $file; + #$file_time =~m/([0-9_]+).txt/; + $file_time =~m/([0-9]{4})([0-9]{2})([0-9]{2})_([0-9]{2})([0-9]{2})[0-9]+.txt/; + $file_time_str = "$1/$2/$3 $4:$5:00"; + + #Convert to number of seconds since epoch + $file_u_date = &UnixDate(&ParseDate("$file_time_str UTC"),"%s"); + + #1970/01/01 00:00:00 as a datenum + $epoch_dn = 719529; + + #Convert the seconds since epoch to a datenum + $file_datenum = $file_u_date/86400 + $epoch_dn; + + $file_index++; + ${$Vars{'file_time'}}[$file_index] = $file_datenum; + + open(DATA_FILE,$file); + #Loop through all lines of data + while ($data_line=) { + + #Here's the work! Seperate all of the data and store it in + #a way that we can easily stuff it into the NetCDF files at + #the end of it all + &seperate_sensors; + + } #Done reading this file + close(DATA_FILE); + + } #Done looping through the files + + #Just a thought here... perhaps all parsing and conversions should + #occur here, operating on the arrays of data, rather than for each + #time... That might also be a better way to handle derived + #variables like pir, density, etc. Maybe later. +} + +###################################################################### +### Test Data ######################################################## +sub test_data { + print "Trying all keys of data array\n"; + foreach $param (@vars) { + print "...$param,"; + @temp_array = @{$Vars{$param}}; + print "Array: $#temp_array, $temp_array[0]\n"; + } + +} +###################################################################### +### Write Netcdf ##################################################### +sub write_netcdf { + + #I think I'd like to pull this out into another script. The point + #of this subroutine is to initialize and populate the NetCDF file + #that will contain the data. + + #################################################################### + # Create a NetCDF file to work with! + if ($debug) { + print "\nCreating NetCDF files:\n"; + } + $nc_name = "${out_data_dir}$out_file_name"; + $nc_sname = "${out_data_dir}$out_file_sname"; + + unless ($#platform_time>0) { + print "Exiting Now! \nFATAL ERROR:\n"; + die " There must be at least one valid record!\n". + " Please try another date range!\n"; + } + + + $ncid = NetCDF::create($nc_name,NetCDF::CLOBBER); + die "Couldn't open $nc_name\n" if $ncid<0; + + $ncid_system = NetCDF::create($nc_sname,NetCDF::CLOBBER); + die "Couldn't open $nc_sname\n" if $ncid_system<0; + + + #################################################################### + # Put Global Attributes... + + if ($debug) { + print "... Putting global variables\n"; + } + + #I had this, but it puts them in random order, so I'll use the order + #direct from globals.table + foreach $global_att (@globals) { + $g_a_value = eval("$global_value{$global_att}"); + $g_a_format = $global_format{$global_att}; + + unless ($g_a_value =~/N\/A/) { + if ($debug>2) { + print "$global_att is $g_a_value\n" + } + $attid = NetCDF::attput($ncid,NetCDF::GLOBAL,"$global_att", + eval('NetCDF::'.$g_a_format), + "$g_a_value"); + $attid = NetCDF::attput($ncid_system,NetCDF::GLOBAL,"$global_att", + eval('NetCDF::'.$g_a_format), + "$g_a_value"); + $attid != -1 || die "\n Couldn't write global attribute $global_att\n"; + } + } + + + + #################################################################### + # Define dimensions, fixed ones first + @{$Vars{LONGITUDE}} = ($tower_lon{$tower_id}); + @{$Vars{LATITUDE}} = ($tower_lat{$tower_id}); + + #I did it this way because I was starting from Brians script (which + #was generally extremely helpful) + %dims = ( + LONGITUDE => 1, + LATITUDE => 1, + TOWER_FILES => $#tower_files+1, + CHARACTERS => 50, + time => $#platform_time+1 + ); + %dim_names = ( + 'a' => 'LATITUDE', + 'o' => 'LONGITUDE', + 'f' => 'TOWER_FILES', + 'c' => 'CHARACTERS', + 't' => 'time' + ); + + + foreach $dim (keys %dims) { + if ($dimensions{$dim}=~/[fc]/){ + $ncid{$dim} = $ncid_system; + } + elsif ($dimensions{$dim}=~/[tao]/) { + $ncid{$dim} = $ncid; + } + + unless ($dim =~/time/) { + $dimid{$dim} = NetCDF::dimdef($ncid{$dim},$dim,$dims{$dim}); + die "Couldn't define $dim dimension\n" if $dimid{$dim}<0; + } + } + + #################################################################### + # Define time dimension + $dimid{time} = NetCDF::dimdef($ncid,"time",NetCDF::UNLIMITED); + die "Couldn't define record dimension\n" if $dimid{time}<0; + + + #################################################################### + # Define variables and put attributes, fixed ones first + if ($debug) { + print "... Defining variables and putting attributes\n"; + } + #################################################################### + # Define variables and put attributes, now time dependant ones + + #Dimension variables like lat and lon. + @all_attributes = ('long_name', 'standard_name', 'units', + 'description', 'range', 'precision' + ); + + @zeros = (0,0,0); #Variables are dependant at most on 4 dimensions + + #foreach $param (keys %Vars) { + foreach $param (@vars) { + if ($param =~/CLOCK/ || $param =~/BBAD/) { + #We'll skip these for now... + } + elsif (defined $Vars{$param}) { + &vardef_attput; + } + } + + #################################################################### + # End Definition period! + $status = NetCDF::endef($ncid); + die "Couldn't end definition\n" if $status<0; + $status = NetCDF::endef($ncid_system); + die "Couldn't end definition\n" if $status<0; + + + #################################################################### + # Start putting variables, first the fixed variables + if ($debug) { + print "... Putting variables:\n\n"; + } + #foreach $param (keys %Vars) { + foreach $param (@vars) { + if ($param =~/CLOCK/ || $param =~/BBAD/) { + #We'll skip these for now... + } + elsif (defined $Vars{$param}) { + &varput; + } + } + + #################################################################### + # All done, let's close up! + $status = NetCDF::close($ncid); + $status = NetCDF::close($ncid_system); + +} + +###################################################################### +### Seperate Sensors ################################################# +sub seperate_sensors { + + #This subroutine parses each line of data in a data file: determines + #what the format of the line is, and sends the results onward to + #compute derived variables, parse complicated data strings, and + #convert to scientific units. The organization of this one is + #pretty confusing... + + @data_line = split(', ',$data_line); + @va = (); + #If there is at least one comma in the data line it is of the usual + #data format (not ADCP!) and we'll treat it normally. + + if ($#data_line) { + #Everything other than the CTD and ADCP should fit this... + if ($#data_line == 5) { + ($time,$param_id,$type,$value,$units,$error_string) = @data_line; + } + + #The CTD is still a special case becuase data is comma delimited. + elsif ($#data_line == 8) { + ($time,$param_id,$type,$va[0],$va[1],$va[2],$va[3],$units, + $error_string) = @data_line; + $value = join(',',@va); + $value =~s/\s+//g; + } + + #The CTD is still a special case becuase data is comma delimited. + elsif ($#data_line == 9) { + #print "9\n@data_line\n"; + + ($time,$param_id,$type,$va[0],$va[1],$va[2],$va[3],$va[4], + $units,$error_string) = @data_line; + $value = join(',',@va); + $value =~s/\s+//g; + } + + #The CTD is still a special case becuase data is comma delimited. + elsif ($#data_line == 10) { + #print "10\n@data_line\n"; + + ($time,$param_id,$type,$va[0],$va[1],$va[2],$va[3],$va[4], + $va[5],$units,$error_string) = @data_line; + $value = join(',',@va); + $value =~s/\s+//g; + } + + else { + #print "WARNING: Data line not parsed correctly!\n@data_line\n"; + #This is so a failed parse doesn't end up going to the previous + #param_id + ($time,$param_id,$type,@junk) = @data_line; + #print "!!!!$param_id\n"; + + #$param_id = 'failed'; + $value = "$fill_value,$fill_value,$fill_value,$fill_value"; + + } + if($param_id=~m/CTD1/) { + #$press = 0; + #print "HEY! @data_line"; + #print "$sal = $temp = $press = $cond = $fill_value\n"; + } + + #If it has failed the previous two options, than something is wrong. + #In fact, the second choice shouldn't ever occur, because Sara has + #implemented a change that puts quotes around data values that need + #special parsing. + + #elsif ($debug>2) { + #print "Error suspected for data line:\n$data_line\n"; + #} + $big_type = $type; + $big_type =~s/\([0-9]\)//g; + + #This is a first attempt at dealing with variables that contain + #a number of sub variables. For example the CTD output string + #contains temparature conductivity salinity and density. + #our (@sub_vars,%sub_vars); + + @sub_vars = @{$sub_vars{$param_id}}; + + &compute_sub_vars; + + + #If we are at the start of a file, keep track of the settings + #listed, especially the param_id's that we expect to be in + #each record, so that we can insert fill values where needed. + + if ($type=~/SETTING/ && $param_id=~/ACTIVE/) { + #The following pattern is used in several of these cases. It + #should probably be a subroutine... + #1. Get rid of double quotes in the data string + #2. Seperate the string into an array (each character is an entry) + #3. If it is empty put in a dash as the first character (not sure + # why I chose that... + #4. Fill the unused portion of the 50 character array with spaces + #5. Add the result to the master hash array for this param_id + + #1 + $value =~s/\"//g; + #2 + @value = split("","$value"); + @this_val = @value; + #3 + unless ($#value+1) { + @value = ("-"); + } + #4 + for ($ii=$#value+1; $ii<50; $ii++) { + @this_val[$ii] = " "; + } + #5 + push(@{$Vars{$param_id}},@this_val); + + $expected_vars = $value; + $expected_vars=~s/\"//g; + @expected_vars = split('\s',$expected_vars); + + + my($t_type) = $param_id; + $t_type =~s/^ACTIVE\_//; + + @{$expected_vars{$t_type}} = @expected_vars; + } + elsif ($type=~/CPU/) { + #see if ($type=~/SETTING/ && $param_id=~/ACTIVE/) { + $value =~s/\"//g; + @value = split("","$value"); + @this_val = @value; + unless ($#value+1) { + @value = (" "); + } + for ($ii=$#value+1; $ii<50; $ii++) { + @this_val[$ii] = " "; + } + push(@{$Vars{$param_id}},@this_val); + } + elsif ($type=~/CLOCK/) { + #see if ($type=~/SETTING/ && $param_id=~/ACTIVE/) { + $value =~s/\"//g; + @value = split("","$value"); + @this_val = @value; + unless ($#value+1) { + @value = (" "); + } + for ($ii=$#value+1; $ii<50; $ii++) { + @this_val[$ii] = " "; + } + push(@{$Vars{$param_id}},@this_val); + } + + #The next little clause here is sort of weird. There are some + #computed or parsed variables that are not in the raw file as + #a param_id. For example PIRA PIRB and PIRC are all parameters + #but we really want to know what PIR is and we don't care about + #the raw data that goes into it... I'm just letting the script + #know to expect these variables to be included later. + + elsif ($#{$expected_vars{$big_type}}) { + push(@{$loop_vars{$big_type}},$param_id); + + if ($param_id=~/LINK$/) { + if ($first_one) { + @expected_vars = ('LINK','LINK_AMPS','LINK_VOLTS','LINK_AMP_HRS', + 'LINK_TEMP'); + push(@{$expected_vars{$big_type}},@expected_vars); + + @expected_vars = ('SAMPLE_LOOP','BBAD_SAMPLE_LOOP'); + push(@{$expected_vars{TIME}},@expected_vars); + + @expected_vars = ('PIR'); + push(@{$expected_vars{RLCAD}},@expected_vars); + + $first_one = 0; + } + push(@{$loop_vars{$big_type}}, 'LINK','LINK_AMPS','LINK_VOLTS', + 'LINK_AMP_HRS','LINK_TEMP'); + } + } + + + #If we are at the start of a data record, use this time for the + #rest of the samples in this loop (may want to change this...) + if ($param_id=~/ATEMP/) { + $time_index++; + #Here I'm trying to work in some logic to deal with times when + #not every expected variable gets reported in the loop, for + #example when the BBAD has a time-out error. This leads to + #the system not reporting WSPDA or WDIRA, which is otherwise + #not noticed, and the empty values lead to a segmentation fault + #when the netcdf file is written. + foreach $expected_type (keys %expected_vars) { + $num_expected = $#{$expected_vars{$expected_type}}; + $num_recieved = $#{$loop_vars{$expected_type}}; + + #Check to see if the number expected is greater than the number + #recieved (and also greater than 0, to deal with system info that + #doesn't describe variables in the loop!) + if ($num_expected>$num_recieved && $num_expected && $time_index>=0) { + + #For every parameter that we are expecting, we should put in a + #fill value. Actually this all should probably go outside the + #loop as part of the initialization process. + foreach $expected_var (@{$expected_vars{$expected_type}}) { + #write fill value! + + ${$Vars{$expected_var}}[$time_index] = $fill_value; + } #End Foreach expected var + + #Okay, this one is a bit wierd. Clock (sample_loop) is not + #yet included in RLCAD, BBAD, or SERIAL, so it isn't expected. + #Thus if it isn't reported, we need to insert a fill_value + + #In the current version, this IS fixed. In fact CLOCK isn't used + #at all. It has been replaced by SAMPLE_LOOP. + unless(${$Vars{"CLOCK"}}[$time_index]) { + ${$Vars{"CLOCK"}}[$time_index] = $fill_value; + } #end unless clock thing... + }#end if still expecting more... + }#end foreach expected type + + %loop_vars = (); + + + #Now that is out of the way, time is a bit more normal, but still + #needs to be dealt with seperately as it occurs only once per + #sample loop and is not explicitly a loop variable. + + $platform_time[$time_index] = $time; + $u_date = &UnixDate(&ParseDate("$time"),"%Y,%m,%d,%H,%M,%S"); + ($year,$month,$day,$hour,$minute,$second) = split(',',$u_date); + + $u_date = &UnixDate(&ParseDate("$time UTC"),"%s"); + $um1_date = &UnixDate(&ParseDate("$platform_time[$time_index -1] UTC"), + "%s"); + $sample_interval = $u_date - $um1_date; + $hrs_per_sample = $sample_interval/3600; #Seconds/hr + + unless ($time_index) { + $hrs_per_sample = 1/30; + } + #1970/01/01 00:00:00 as a datenum + $epoch_dn = 719529; + + #Convert the seconds since epoch to a datenum + $datenum = $u_date/86400 + $epoch_dn; + + ${$Vars{'year'}}[$time_index] = $year; + ${$Vars{'month'}}[$time_index] = $month; + ${$Vars{'day'}}[$time_index] = $day; + ${$Vars{'hour'}}[$time_index] = $hour; + ${$Vars{'minute'}}[$time_index] = $minute; + ${$Vars{'second'}}[$time_index] = $second; + ${$Vars{'time'}}[$time_index] = $datenum; + + }#end if ATEMP + + #Apply information from the parse table to split up the output + &parse_vars; + + if ($param_id=~/GPS1/) { + $param_id = 'GPSLON'; + &convert_vars; + $param_id = 'GPSLAT'; + &convert_vars; + $param_id = 'GPS1'; + } + + + #Use the coefficients and formulas from the conversions table to + #apply any necessary conversions + &convert_vars; + + #I'm not sure of a good way to get it to automatically convert + #and derive pir from the case temperature and the thermistor... + #This way is definitely a hack... + + #If we have data for PIRA and PIRC, then we can compute PIR + if ($param_id =~/PIRC/ | $param_id =~/PIRA/) { + + if ($Vars{PIRA}[-1]!=~/$fill_value/ && + $Vars{PIRC}[-1]!=~/$fill_value/){ + $temporary_param = $param_id; + $param_id = 'PIR'; + + $pir_ct = $Vars{PIRA}[-1]; + $pir_th = $Vars{PIRC}[-1]; + + &convert_vars; + $param_id = $temporary_param; + } + else { + $Vars{PIR} = $fill_value; + } + } + $value = undef; + + } + + #Otherwise the data line has no commas, so it must be an adcp line + else { + #I haven't put any logic in here yet + #&parse_adcp; + } +} + +###################################################################### +### Parse Vars ####################################################### +sub parse_vars { + + #Seperate out the output from matching conditions + + #The hash array parse_output comes from the meta_data perl module that + #looks into the data tables. It explains the string format for each + #variable and how to assign the variables given that format. + $output = $parse_output{$param_id}; + @output = split(',',$output); + + + if ($units{$param_id}=~/string/) { + #It was complaining about the gps checksum until I added '' + eval("$output[0] = '$value';"); + } + else { + #Apply matching conditions from the parse table + $old_v = $value; + + #Okay, this is hard wired... I know it's better to avoid, but I wanted + #a quick fix... This handles wind, which is an array of values separated + #by spaces. An average value should be presented for later conversion. + if ($parse_info{$param_id}=~/\@avg/) { + #Spit up space delimited values and ignore fill values + $old_v =~s/\ \-9999//g; + @value = split(' ',$old_v); + eval("$output[0]".' = @value;'); + } + elsif ($parse_info{$param_id}=~/\@gva/) { + #This is for the compass pitch and roll which is weird... + @comp = @pitch = @roll = (); + + @value = split('\$',$old_v); + foreach $vals (@value) { + $vals =~m/$C([0-9\.\-]*)P([0-9\.\-]*)R([0-9\.\-]*)T.*/; + push(@comp,$1); + push(@pitch,$2); + push(@roll,$3); + #print "so $1, $2, $3\n"; + } + #eval("$output[0]".' = @value;'); + } + + #If the output is one parameter (applies to almost all sensors) + elsif ($#output==0) { + #Assign the output value to the parse_info matching condition + #Here $1 signifies the part that matches what is inside the + #first set of parenthesis in a matching condition. + #Example: if $value is "PS=+14.693" + # then $value =~m/"PS\=\+(.*)"/; + # sets $1 to be 14.693 + $value =~m/$parse_info{$param_id}/; + @value = $1; + + #As long as there is a defined value, set the output to that + if (defined $value[0]) { + eval("$output[0]".' = $value[0];'); + } + else { + eval("$output[0] = $fill_value;"); + } + + } + + #Applies to the ctd and the link, in particular + elsif ($#output>0) { + if ($param_id =~m/CTD/) { + #As long as the string begins with '"#0' proceed. + if ($value=~m/^\"\#0/) { + $pi = $parse_info{$param_id}; + } + else { + $pi = 'NOBAD!!'; + } + } + else { + + $pi = $parse_info{$param_id}; + } + if ($param_id=~/LINK/) { + #print "$value\n$pi\n"; + } + elsif ($param_id=~/GPS1/) { + #print "$value\n"; + @v = split('',$value); + $mygps_lat = join('',@v[11..17]); + $mygps_lon = join('',@v[19..25]); + + } + $value =~m/$pi/; + + #Loop through each output parameter and assign the value + #For example suppose there were three variables in the matching + #condition '$value =~m/$pi/;', then they will be assigned to + #$1,$2, and $3, thus you want to assign them as + #eval("$output[0] = $1;"); + #so if @output = ($temp,$humidity,$pressure) + #then you have $temp set to the contents of $1. Clear??? + for ($out_num=1; $out_num<=$#output+1; $out_num++) { + eval("$output[$out_num-1] =\$$out_num;"); + } + if ($param_id=~/LINK/) { + #print ": $link_time, $link_volts, \n"; + } + elsif ($param_id=~/GPS1/) { + if ($mygps_lat+0) {$gps_lat = $mygps_lat;} + else {$gps_lat = $fill_value;} + if ($mygps_lon+0) {$gps_lon = $mygps_lon;} + else {$gps_lon = $fill_value;} + } + } + } +} + +###################################################################### +### Convert Vars ##################################################### +sub convert_vars { + our($fill_value); + + #Again, these coefficients and formulas are coming from the + #meta_data perl module, and the corresponding data tables. + + #Since conversion coefficients are different for the different + #platforms it looks like this $R4_conversion_coeff{PSP} + + #Get conversion coefficients and formula from hash array for + #each tower id and each parameter id. + eval ('$c_coeff = $'.$tower_id.'_conversion_coeff{$param_id};'); + eval ('$c_formula = $'.$tower_id.'_conversion_formula{$param_id};'); + + #Split up conversion coefficients from the converstions table + @v = split(',',$c_coeff); + + #If there is any set of conversion coefficients (and hence a + #conversion to be applied), apply them! + if ($#v+1) { + $temp_var = ''; + if ($c_formula=~/^\&/) { + #If the conversion formula is a subroutine call, evaluate! + eval("$c_formula"); + } + else { + #As long as the output wasn't the fill value, convert it. + my ($out) = eval("$output[0]"); + unless($out=~/$fill_value/) { + $temp_var = eval("$c_formula"); + } + + #Otherwise, we don't want to convert a fill value to + #something else! + else { + $temp_var = $fill_value; + } + + #Set the array index based upon the record dimension + &set_index; + + #This should go somewhere else... + if ($param_id=~/RAIN/) { + #print "Hrs per : $hrs_per_sample\n"; + $temp_var = $temp_var/$hrs_per_sample; + } + + #Finally, set this value of the Vars super duper array + #for this time to the value that we've computed + unless ($index +1) { + print "Warning. $param_id has index $index. Adjusting...\n"; + ${$Vars{$param_id}}[$index+1] = $temp_var; + } + else { + ${$Vars{$param_id}}[$index] = $temp_var; + } + } + } + + else { + #print "No conversion info available for $param_id at $tower_id\n"; + } +} + + +###################################################################### +### Handle Input ##################################################### +sub handle_input { + + #By putting default values in a file, the script should easily switch + #back and forth between the afs version and the local nemo version! + open(DEFAULTS,"${bin_dir}tower_parse.defaults"); + while () { + #Get rid of the newline + chop; + #Ignore comments starting with # + $_=~s/#.*//; + #If the line is non-empty + if ($_) { + my($var_name, $default_value) = split(','); + eval("$var_name = $default_value;"); + } + } + + ($date_string,%varargin) = @ARGV; + + #Associate each input argument pair with the appropriate variable + %varargout = ( + '-out' => '$out_file_name', + '-d' => '$debug', + '-t' => '$tower_id', + '-p' => '$package', + ); + + #Set each variable to the value of the associated input argument + #Example 1: '-d 1' sets the debug flag to true + #Example 2: '-out 2004_06.nc' sets the output file name to 2004_06.nc + foreach $argin (keys %varargin) { + eval("$varargout{$argin} = '$varargin{$argin}';"); + } + + $d_data_dir = "$d_data_dir$tower_id/"; + $out_data_dir = "$out_data_dir$tower_id/"; + + #Since there are a few different types of date string inputs, we need + #to figure out how to deal with this one! + if ($date_string) { + &handle_date; + } + + #If there's no date string, then we don't know what to look for! + else { + die "Must at least input a date string!\n". + "./tower_parse.perl '200406' -out 2004_06.nc -d 1\n"; + } + + #Helps the user chooose an appropriate filename + unless ($out_file_name=~/.nc$/) { + if ($out_file_name) { + $out_file_sname = "${out_file_name}_sys.nc"; + $out_file_name = "${out_file_name}.nc"; + } + else { + $out_file_name = $d_out_file_name; + @do = split('',$d_out_file_name); + $out_file_sname = join('',@do[0..$#do-3],'_sys.nc'); + } + } + else { + unless ($out_file_sname) { + @do = split('',$out_file_name); + $out_file_sname = join('',@do[0..$#do-3],'_sys.nc'); + } + } + + #This will come up many times throughout the script. Another way of + #looking at the debug flag is that it turns on comments (verbose). + if ($debug) { + print "\n\nData dir : $d_data_dir\nOutput dir : $out_data_dir\n". + "Outfile name : $out_file_name and $out_file_sname\n"; + if ($#dates) { + print "\nLooking for data between $dates[0] and $dates[-1]\n"; + } + } + + +} + + +###################################################################### +### Handle Date ###################################################### +sub handle_date { + #Deal with date input. + if ($date_string=~/\ /) { + ($st_date,$en_date) = split(' ',$date_string); + @st_date = split('',$st_date); + @en_date = split('',$en_date); + + #print "So $st_date, $en_date is $#st_date or @st_date\n"; + $st_date = join('',(@st_date[0..3],' ',@st_date[4..5],' ',@st_date[6..7])); + $en_date = join('',(@en_date[0..3],' ',@en_date[4..5],' ',@en_date[6..7])); + + #print "So $st_date, $en_date is @st_date\n"; + $this_date = $st_date; + $this_parsed = &ParseDate($st_date); + $en_parsed = &ParseDate($en_date); + + @dates = (); + %month_dirs = (); + + while ($this_parsed <= $en_parsed) { + $ymd = &UnixDate($this_parsed,"%Y%m%d"); + push(@dates,$ymd); + $month_dirs{$ymd} = &UnixDate($this_parsed,"%Y_%m"); + $this_date = &UnixDate(&DateCalc($this_date,"+ 1 day"), "%Y %m %d"); + $this_parsed = &ParseDate($this_date); + } + #print "$#dates Dates! @dates\n"; + } + elsif ($date_string=~/latest/) { + $today = &ParseDate("today"); + $date1 = &UnixDate(&DateCalc("$today","- 2 day"),"%Y%m%d"); + $date2 = &UnixDate(&DateCalc("$today","- 1 day"),"%Y%m%d"); + $date3 = &UnixDate("$today","%Y%m%d"); + $mond1 = &UnixDate(&DateCalc("$today","- 2 day"),"%Y_%m"); + $mond2 = &UnixDate(&DateCalc("$today","- 1 day"),"%Y_%m"); + $mond3 = &UnixDate("$today","%Y_%m"); + @dates = ($date1,$date2,$date3); + %month_dirs = ($date1,$mond1,$date2,$mond2,$date3,$mond3); + #print "@dates\n"; + } + elsif ($date_string =~/help/) { + #oops this isn't a date string at all! + # I should probably put this somewhere else... + print "\nUsage: ./tower_parse.perl date_string\n\n". + "Optional argument pairs:\n". + " -out output file name\n". + " -d debug\n". +# " -dir directory path to data\n". + " -t tower id\n". + " -nemo scp data file to nemo\n\n"; + print "Date string can have any of the following formats:\n". + " yyyymm Finds all data for the month\n". + " yyyymmdd Finds data just for one day\n". + " 'yyyymmdd yyyymmdd' Finds data within the date range\n". + " latest Finds today, yesterday and the previous day\n"; + die "\n"; + } + else { + @dates = ($date_string); + @date_str = split('',$date_string); + $fn = join('',(@date_str[0..3],'_',@date_str[4..5])); + + unless($out_file_name) { + #Unless it has been input by the user! + $out_file_name = "${tower_id}_${fn}.nc"; + $out_file_sname = "${tower_id}_${fn}_sys.nc"; + } + + #Also change default data directory! + $month_dirs{$date_string} = $fn; + } + @month_dirs = values (%month_dirs); +} + + +###################################################################### +### Parse ADCP ####################################################### +sub parse_adcp { + + #print "We have ADCP data!\n"; + #$data = join('',@data); + +} + + +###################################################################### +### Vardef Attput #################################################### +sub vardef_attput { + + #This is the generic variable definition and attribute put used by + #write_netcdf. + $format = 'NetCDF::'.$format{$param}; + if ($debug>2) { + print "$param is of format $format\n"; + } + + @dimensions = split('\s',$dimensions{$param}); + @dim_names = @dim_names{@dimensions}; + @dim_ids = @dimid{@dim_names}; + + $dimensions = join('',@dimensions); + + #Set the record dimension to be time or file number based on + #contents of variables.table + if ($dimensions=~/f/) { + $ncid{$param} = $ncid_system; + } + elsif ($dimensions=~/t/) { + $ncid{$param} = $ncid; + } + + + $varid{$param} = NetCDF::vardef($ncid{$param},$param, + eval("$format"), + [@dim_ids]); + + die "Couldn't define variable $param\n" if $varid{$param}<0; + + + #print "$param should have $#all_attributes\n"; + foreach $attribute (@all_attributes) { + $att_val = eval('\$'.$attribute.'{$param}'); + if (defined $att_val && $att_val!=~/^N\/A/) { + $attid = NetCDF::attput($ncid{$param},$varid{$param},"$attribute", + NetCDF::CHAR, + eval('\$'.$attribute.'{$param}')); + }#end if + }#end foreach $attribute +} + +###################################################################### +### Varput ########################################################### +sub varput { + $format = 'NetCDF::'.$format{$param}; + + @dimensions = split('\s',$dimensions{$param}); + @dim_names = @dim_names{@dimensions}; + #@dim_ids = @dimid{@dim_names}; + @dim_counts = @dims{@dim_names}; + @dim_starts = @zeros[0..$#dim_names]; + + unless ($param =~/CLOCK/ || $param =~/BBAD/ || + $param =~/GPS$/ || $param =~/LINK$/) { + + #No matter how good it looks, test the arrray for undefined values! + #(This is painfully slow and really should be replaced by initializing + #the arrays at the start...) + @temp_array = @{$Vars{$param}}; + for ($ii=0; $ii<=$#temp_array; $ii++) { + unless (defined($temp_array[$ii])) { + ${$Vars{$param}}[$ii] = $fill_value; + } + } + + if ($debug>1) { + print "$param length ".eval($#{$Vars{$param}}+1). + ", id $varid{$param}\n"; + } + + unless ($format=~/CHAR/) { + #Put the variable into the netcdf file! + $status = NetCDF::varput($ncid{$param},$varid{$param}, + \@dim_starts,\@dim_counts, + \@{$Vars{$param}}); + } + else { + #Test to make sure it is as long as we expected... + if ($#{$Vars{$param}}+1==($#tower_files+1)*50) { + $status = NetCDF::varput($ncid{$param},$varid{$param}, + \@dim_starts,\@dim_counts, + \@{$Vars{$param}}); + } + elsif ($debug>1) { + print "Didn't have enough values for $param\n"; + } + } + }#End unless that ignores clock,bbad,gps and link strings + else { + print "$param being ignored\n"; + } +} + +###################################################################### +### Compute Sub Vars ################################################# +sub compute_sub_vars { + + if ($#sub_vars +1) { + $orig_param = $param_id; + + foreach $sub_param (@sub_vars) { + $param_id = $sub_param; + &convert_vars; + } + $param_id = $orig_param; + } +} + +###################################################################### +### Set Index ######################################################## +sub set_index { + + #If the record dimension is time, use the time index + if ($dimensions{$param_id}=~/t/) { + $index = $time_index; + } + #If the record dimension is file number use that index + elsif ($dimensions{$param_id}=~/f/) { + $index = $file_index; + } +} + + +###################################################################### +### Avg Wind ######################################################### +sub avg_wind { + #1. Check for all necessary components: + # a. 'spda' -> WSPDA + # b. 'dira' -> WDIRA + # c. 'spdb' -> WSPDB (Optional) [alternative is 'spdn' if empty] + # d. 'dirb' -> WDIRB (Optional) [alternative is 'dirn' if empty] + # e. 'cmp1' -> COMP1 (Optional) [alternative is an offset, which + # defaults to 0 unless otherwise set... Does not requre pkgb] + # f. 'cmp2' -> COMP2 [Not Used!] + # + #2. Loop through times: + # a. Replace out of range values or empty package with fill_value + # b. Apply direction offset + # c. Compute vector components (u,v) + # + #3. Compute statistics + # + #4. Store data values + + my(@junk) = (); + my(@input) = (@_); + %names = ('spda'=>'wi_spd_a', + 'dira'=>'wi_dir_a', + 'spdb'=>'wi_spd_b', + 'dirb'=>'wi_dir_b', + 'spdn'=>'junk', + 'dirn'=>'junk', + 'cmp1'=>'comp_1', + 'cmp2'=>'comp_2'); + + + #1. Check for all necessary components: + if ($input[0]=~/spda/) { + #First variable on the list, initialize temporary data arrays + + #If we've already been through the loop once... + if ($dira[0]) { + $real_last_var = $last_var; + + if ($#cmp1<0) { + #No compass data. Nor is there an available offset. + @cmp1 = (0); + } + } + else { + #for the first one, so it doesn't confuse the real_last_var + $real_last_var = 'NOPE'; + } + + #Now initialize the arrays + @spda = @dira = @spdb = @dirb = @cmp1 = @cmp2 = (); + } + elsif ($input[0]=~/dir/) { + if ($#input==1) { + #Then we have been given a directional offset and should + #apply it! + $offset = $input[1]; + } + else { + $offset = 0; + } + } + #print("\@$input[0] = \@$names{$input[0]};\n"); + eval("\@$input[0] = \@$names{$input[0]};"); + + if ($input[0]=~/$real_last_var/) { + #Write the data from this sample. + &handle_wind; + &write_wind; + } + + $last_var = $input[0]; +} + + +###################################################################### +### Handle Wind ###################################################### +sub handle_wind { + #This subroutine works for average_wind: once data arrays are + #collected it preforms all the necessary operations on them. + + my($time); + our($u_mean_a,$u_max_a,$u_std_a,$u_mean_b,$u_max_b,$u_std_b, + $v_mean_a,$v_max_a,$v_std_a,$v_mean_b,$v_max_b,$v_std_b, + $mean_spd_a,$mean_dir_a,$mean_spd_b,$mean_dir_b,$spd_std_a, + $dir_std_a,$spd_std_b,$dir_std_b,$gust_a,$gust_b) = $fill_value; + + my(@u_a,@v_a,@u_b,@v_b,@temp_cmp,@comp_off) = (); + + + #Loop through samples... + for ($time=0; $time<=$#spda; $time++) { + + #Make sure there is some directional offset to apply! + if ($#cmp1<1) { + #If compass data wasn't parsed correctly, fix it! + if ($cmp1[0]=~/\ /) { + @temp_cmp = split(' ',$cmp1[0]); + @cmp1 = @temp_cmp; + $comp_off[$time] = &volts2comp($cmp1[$time]) + $offset; + } + #No compass, using fixed offset + else { + $comp_off[$time] = &volts2comp($cmp1[0]) + $offset; + } + } + else{ + #There is a compass reading so use that (buoy) + $comp_off[$time] = &volts2comp($cmp1[$time]) + $offset; + } + + + #Apply simple, static conversion from voltage to scientific values + ($spda[$time],$dira[$time]) = &volts2spddir($spda[$time],$dira[$time]); + ($spdb[$time],$dirb[$time]) = &volts2spddir($spdb[$time],$dirb[$time]); + + + #Make sure speeds are reasonable and if speed or direction are + #bad, both are badflagged + $bada = ($spda[$time]>100 | $spda[$time]==$fill_value | + $dira[$time]==$fill_value); + if ($bada) { + $spda[$time] = $dira[$time] = $u_a[$time] = $v_a[$time] = $fill_value; + } + else { + #Take the direction mod 360 + $dira[$time] = &modulo($dira[$time] + $comp_off[$time], 360); + #Convert Spd and Dir to U and V components + ($u_a[$time],$v_a[$time]) = &spddir2uv($spda[$time],$dira[$time]); + } + + #Ditto for the b package! (as long as there is a b package...) + unless ($#spdb<0) { + $badb = ($spdb[$time]>100 | $spdb[$time]==$fill_value | + $dirb[$time]==$fill_value); + if ($badb) { + $spdb[$time] = $dirb[$time] = $u_b[$time] = + $v_b[$time] = $fill_value; + } + else { + $dirb[$time] = &modulo($dirb[$time] + $comp_off[$time], 360); + ($u_b[$time],$v_b[$time]) = &spddir2uv($spdb[$time],$dirb[$time]); + } + } + } + + #a package stats + #($mean,$std,$max) = &fill_stats(@array); + ($u_mean_a,$u_std_a,$u_max_a) = &fill_stats(@u_a); + ($v_mean_a,$v_std_a,$v_max_a) = &fill_stats(@v_a); + #In terms of speed, mean speed is wrong + (undef,$spd_std_a,$gust_a) = &fill_stats(@spda); + #For direction, only std dev is right... + (undef,$dir_std_a,undef) = &fill_stats(@dira); + + ($mean_spd_a,$mean_dir_a) = &uv2spddir($u_mean_a,$v_mean_a); + + ($comp_mean,$comp_std,undef) = &fill_stats(@comp_off); + + #b package stats + unless ($#u_b<0) { + ($u_mean_b,$u_std_b,$u_max_b) = &fill_stats(@u_b); + ($v_mean_b,$v_std_b,$v_max_b) = &fill_stats(@v_b); + #In terms of speed, mean speed is wrong + (undef,$spd_std_b,$gust_b) = &fill_stats(@spdb); + #For direction, only std dev is right... + (undef,$dir_std_b,undef) = &fill_stats(@dirb); + + ($mean_spd_b,$mean_dir_b) = &uv2spddir($u_mean_b,$v_mean_b); + } +} + +###################################################################### +### Write_Wind ######################################################## +sub write_wind { + + unless ($mean_dir_a == $fill_value || + $mean_spd_a == $fill_value) { + #put variables into array!!! + ${$Vars{WSPDA}}[$index] = $mean_spd_a; + ${$Vars{WDIRA}}[$index] = $mean_dir_a; + ${$Vars{WEASTA}}[$index] = $u_mean_a; + ${$Vars{WNORTHA}}[$index] = $v_mean_a; + ${$Vars{WSPDSTDA}}[$index] = $spd_std_a; + ${$Vars{WDIRSTDA}}[$index] = $dir_std_a; + ${$Vars{WGSTA}}[$index] = $gust_a; + } + else { + ${$Vars{WSPDA}}[$index] = $fill_value; + ${$Vars{WDIRA}}[$index] = $fill_value; + ${$Vars{WEASTA}}[$index] = $fill_value; + ${$Vars{WNORTHA}}[$index] = $fill_value; + ${$Vars{WSPDSTDA}}[$index] = $fill_value; + ${$Vars{WDIRSTDA}}[$index] = $fill_value; + ${$Vars{WGSTA}}[$index] = $fill_value; + } + unless ($mean_dir_b == $fill_value || + $mean_spd_b == $fill_value) { + #put variables into array!!! + ${$Vars{WSPDB}}[$index] = $mean_spd_b; + ${$Vars{WDIRB}}[$index] = $mean_dir_b; + ${$Vars{WEASTB}}[$index] = $u_mean_b; + ${$Vars{WNORTHB}}[$index] = $v_mean_b; + ${$Vars{WSPDSTDB}}[$index] = $spd_std_b; + ${$Vars{WDIRSTDB}}[$index] = $dir_std_b; + ${$Vars{WGSTB}}[$index] = $gust_b; + } + else { + ${$Vars{WSPDB}}[$index] = $fill_value; + ${$Vars{WDIRB}}[$index] = $fill_value; + ${$Vars{WEASTB}}[$index] = $fill_value; + ${$Vars{WNORTHB}}[$index] = $fill_value; + ${$Vars{WSPDSTDB}}[$index] = $fill_value; + ${$Vars{WDIRSTDB}}[$index] = $fill_value; + ${$Vars{WGSTB}}[$index] = $fill_value; + } + + unless ($comp_std == 0 || + $comp_mean == -9999) { + ${$Vars{COMP1}}[$index] = $comp_mean; + } + else { + ${$Vars{COMP1}}[$index] = $fill_value; + } +} + +###################################################################### +### Handle Comp ###################################################### +sub handle_comp { + #This subroutine works for average_wind: once data arrays are + #collected it preforms all the necessary operations on them. + + #Trying to figure out what to do with hourly compass measurements + #including pitch and roll. Need mean and std + + #print "HANDLE COMP!$#comp $#pitch $#roll\n"; + + our($compd_mean,$compd_std,$compd_max,$pitch_mean,$pitch_std, + $pitch_max,$roll_mean,$roll_std,$roll_max) = $fill_value; + + my(@u_c,@v_c,@u_p,@v_p,@u_r,@v_r) = (); + + #print "Okay? $comp[0] $pitch[0] $roll[0]?\n"; + if ($#comp>0) { + #print "ARRAY: @comp\n"; + #print "Looping compass...\n"; + #Loop through samples... + for ($time=0; $time<=$#comp; $time++) { + #Since we don't have a speed, we will use the unit vector for + #the averaging... + + #print "C: $comp[$time] P: $pitch[$time] R: $roll[$time] at 1\n"; + + #Take the direction mod 360 + $comp[$time] = &modulo($comp[$time], 360); + $pitch[$time] = &modulo($pitch[$time], 360); + $roll[$time] = &modulo($roll[$time], 360); + + #print "C: $comp[$time] P: $pitch[$time] R: $roll[$time] at 2\n"; + + #Convert Spd and Dir to U and V components + ($u_c[$time],$v_c[$time]) = &spddir2uv(1,$comp[$time]); + ($u_p[$time],$v_p[$time]) = &spddir2uv(1,$pitch[$time]); + ($u_r[$time],$v_r[$time]) = &spddir2uv(1,$roll[$time]); + + #print "C: $u_c[$time] $v_c[$time] P: $u_p[$time] $v_p[$time]". + #" R: $u_r[$time] $v_r[$time] at 3\n"; + } + + #($mean,$std,$max) = &fill_stats(@array); + ($u_c_mean,$u_c_std,$u_c_max) = &fill_stats(@u_c); + ($u_p_mean,$u_p_std,$u_p_max) = &fill_stats(@u_p); + ($u_r_mean,$u_r_std,$u_r_max) = &fill_stats(@u_r); + + ($v_c_mean,$v_c_std,$v_c_max) = &fill_stats(@v_c); + ($v_p_mean,$v_p_std,$v_p_max) = &fill_stats(@v_p); + ($v_r_mean,$v_r_std,$v_r_max) = &fill_stats(@v_r); + + #Now get back to the direction! + (undef,$compd_mean) = &uv2spddir($u_c_mean,$v_c_mean); + (undef,$compd_std) = ($u_c_std**2+$v_c_std**2)**(1/2); + (undef,$compd_max) = &uv2spddir($u_c_max,$v_c_max); + + (undef,$pitch_mean) = &uv2spddir($u_p_mean,$v_p_mean); + (undef,$pitch_std) = ($u_p_std**2+$v_p_std**2)**(1/2); + (undef,$pitch_max) = &uv2spddir($u_p_max,$v_p_max); + + (undef,$roll_mean) = &uv2spddir($u_r_mean,$v_r_mean); + (undef,$roll_std) = ($u_r_std**2+$v_r_std**2)**(1/2); + (undef,$roll_max) = &uv2spddir($u_r_max,$v_r_max); + + + #print "Compass: $comp_mean, $comp_std, $comp_max\n@comp\n"; + #print "Pitch: $pitch_mean, $pitch_std, $pitch_max\n@pitch\n"; + #print "Roll: $roll_mean, $roll_std, $roll_max\n@roll\n"; + + ${$Vars{COMPMEAN}}[$file_index] = $compd_mean; + ${$Vars{COMPSTD}}[$file_index] = $compd_std; + ${$Vars{COMPMAX}}[$file_index] = $compd_max; + ${$Vars{PITCHMEAN}}[$file_index] = $pitch_mean; + ${$Vars{PITCHSTD}}[$file_index] = $pitch_std; + ${$Vars{PITCHMAX}}[$file_index] = $pitch_max; + ${$Vars{ROLLMEAN}}[$file_index] = $roll_mean; + ${$Vars{ROLLSTD}}[$file_index] = $roll_std; + ${$Vars{ROLLMAX}}[$file_index] = $roll_max; + } + else { + #print "Nope...\n"; + ${$Vars{COMPMEAN}}[$file_index] = $fill_value; + ${$Vars{COMPSTD}}[$file_index] = $fill_value; + ${$Vars{COMPMAX}}[$file_index] = $fill_value; + ${$Vars{PITCHMEAN}}[$file_index] = $fill_value; + ${$Vars{PITCHSTD}}[$file_index] = $fill_value; + ${$Vars{PITCHMAX}}[$file_index] = $fill_value; + ${$Vars{ROLLMEAN}}[$file_index] = $fill_value; + ${$Vars{ROLLSTD}}[$file_index] = $fill_value; + ${$Vars{ROLLMAX}}[$file_index] = $fill_value; + } +} + + + +###################################################################### +### Volts2SpdDir ##################################################### +sub volts2spddir { + + my($volts_spd,$volts_dir) = @_; + my($wind_spd,$wind_dir) = undef; + + unless($volts_spd=~/$fill_value/) { + #0->1 V : 0 60 m/s + $wind_spd = $volts_spd*60; + } + else { $wind_spd = $fill_value; } + + unless($volts_dir=~/$fill_value/) { + #0->1 V : 0 360 deg + $wind_dir = $volts_dir*360; + } + else { $wind_dir = $fill_value; } + + return ($wind_spd,$wind_dir); +} + +###################################################################### +### Volts2Comp ####################################################### +sub volts2comp { + + my($volts_comp) = @_; + + unless($volts_comp=~/$fill_value/) { + #0->1 V : 0 360 deg + return $volts_comp*360; + } + else { return $fill_value; } +} + + + +###################################################################### +### SpdDir2UV ######################################################## +sub spddir2uv { + #convert speed and direction to u and v + my($wind_spd,$wind_dir) = @_; + my($deg2rad) = .0174533; + my($wind_u,$wind_v) = undef; + + + unless($wind_spd=~/$fill_value/ || $wind_dir=~/$fill_value/) { + #okay this is terrible but I'm at a loss what else to do. + $wind_v = ($wind_spd)*cos($wind_dir*$deg2rad); + $wind_u = ($wind_spd)*sin($wind_dir*$deg2rad); + return ($wind_u,$wind_v); + } + else { + #print "no!?"; + return ($fill_value,$fill_value); + } +} + +###################################################################### +### UV2SpdDir ######################################################## +sub uv2spddir { + #convert speed and direction to u and v + my($wind_u,$wind_v) = @_; + my($deg2rad) = .0174533; + my($wind_spd,$wind_dir) = undef; + + unless($wind_u=~/$fill_value/ || $wind_v=~/$fill_value/) { + $wind_spd = ($wind_u**2 + $wind_v**2)**(1/2); + $wind_dir = &modulo(atan2($wind_u, $wind_v)/$deg2rad,360); + return ($wind_spd,$wind_dir); + } + else { + return ($fill_value,$fill_value); + } +} + +###################################################################### +### Avg Rain ######################################################### +sub avg_rain { + #Convert cumulative rainfall readings for self siphoning rain + #guage into a rainfall amount over the sampling period. + + #I haven't figured this out yet... + #print "RAIN???\n"; + + #First I need to check the voltage -> volume. + #Then, make sure it isn't in the process of dumping (look at diff, + #confirm that it isn't largely negative) + #Finally look at the change since the previous sample loop to get + #the cumulative rain (and if it is negative, add the dumping + #volume) + + #print "Testing rain:\n"; + + #my ($ind,$raindiff); + #for($ind=1;$ind<$#cumrain;$ind++) { + # $raindiff = $cumrain[$ind]-$cumrain[$ind-1]; + # if ($raindiff<-.05) { + # print "Dumping???\n"; + # } + # elsif ($raindiff>.05) { + # print "Raining???\n"; + # } + #} + my($maxrain); + $maxrain = &max(@cumrain); + + + unless ($maxrain=~/$fill_value/) { + $maxrain = $maxrain*10; + } + else { + $maxrain = $fill_value; + } + ${$Vars{RAIN}}[$index] = $maxrain; +} + + + + +###################################################################### +### Fill Stats ####################################################### +sub fill_stats(@array) { + + my(@array,$mean_value); + @array = @_; + + $array = join(',',@array); + $array =~s/$fill_value//g; + $array =~s/\,\,/\,/g; + @array = split(',',$array); + + unless ($#array<0) { + ($mean) = &mean(@array); + ($std) = &std_dev(@array); + ($max) = &max(@array); + return ($mean,$std,$max); + } + else { + return ($fill_value,$fill_value,$fill_value); + } +} + +###################################################################### +### Mean ############################################################# +sub mean(@array) { + my(@array,$mean_value); + @array = @_; + + $sum_array = join('+',@array); + + if ($sum_array =~m/\+\+/) { + return $fill_value; + } + #print "Averaging!\n$sum_array\n"; + + eval('$mean_value = ('."$sum_array".')/($#array+1);'); + return $mean_value; +} + +###################################################################### +### Std Dev ########################################################## +sub std_dev(@array) { + my(@array,$std_dev); + @array = @_; + + my $temp_std = new Statistics::Basic::StdDev(\@array); + $std_dev = $temp_std -> query; + + return $std_dev; +} + +###################################################################### +### Max ############################################################## +sub max { + #From perldoc.com + my $max = shift(@_); + foreach $foo (@_) { + $max = $foo if $max < $foo; + } + return $max; +} + +###################################################################### +### Modulo ########################################################### +sub modulo($element,$modulus) { + #Do modulus of the element, but don't throw away the remainder + + my($element,$modulus,$el,$floor) = @_; + + if ($element < 0) { + return $element + $modulus; + } + elsif ($element <= $modulus) { + return $element; + } + elsif ($element > 3*$modulus) { + #print "Wow $element is HUGE!\n"; + return $fill_value; + } + elsif ($element > 2*$modulus) { + return $element - 2*$modulus; + } + elsif ($element > $modulus) { + return $element - $modulus; + } +} + + + + Index: tower_buoy/bin/tower_raw2proc.perl =================================================================== --- (revision ) +++ tower_buoy/bin/tower_raw2proc.perl (revision 7) @@ -1,0 +1,96 @@ +#!/afs/isis/pkg/perl-582/bin/perl +#raw2proc.perl +#Time-stamp: <2006-03-28 15:23:52 lstearns> +# +#Abstract: Take raw tower/roof/buoy data and convert to monthly netcdf files +# of converted data! +# +#Usage: +#####!/afs/isis/pkg/isis/bin/perl + + +########################## +# Luke Stearns # +# lstearns@email.unc.edu # +# work: (919)-962-0301 # +# mobile: (919)-619-5057 # +########################## +use Date::Manip; + +$starttime = time; + +if (1){ + $data_dir = '/seacoos/data/nc-coos/tower/'; + $raw_dir2 = $data_dir.'raw_data/'; + $proc_dir = $data_dir.'proc_data/'; + $perl_dir = '/opt/local/seacoos/bin/'; +} + +$now_LOCAL = &ParseDate("today"); +$now_LOCAL_str = &UnixDate($now_LOCAL, "%Y:%m:%d %H:%M:%S (%Z)"); +print "\n========= Starting: $now_LOCAL_str ========= Perl Version: $]\n"; + + +#$data_dir = '/afs/isis.unc.edu/depts/marine/workspace/hseim/sablam4/'. +# 'lstearns/perl/test_nemo/'; +#$raw_dir = $data_dir.'raw_data/'; + +#$perl_dir = '/afs/isis.unc.edu/depts/marine/workspace/hseim/sablam4/'. +# 'lstearns/perl/test_nemo/'; +#$perl_dir = "$data_dir"; + + +#Directory where files are pushed from iridium! (soon will move to nemo) +#$raw_dir = '/afs/isis/depts/marine/workspace/haines/nc-coos/'. +# 'test_tower_push_data/'; +$raw_dir = '/seacoos/ftp/'; + +@towers = ('R4','LSRB','T1'); + +foreach $tower_id (@towers){ + + #See if there are any new files. + @new_files = glob("${raw_dir}$tower_id/$tower_id*.txt"); + if ($#new_files>=0) { + + #Move files from nemo ftp to nemo raw dir directory + system("mv ${raw_dir}$tower_id/$tower_id*.txt ${raw_dir2}$tower_id/"); + #system("cp ${raw_dir}$tower_id/$tower_id*.txt ${raw_dir2}$tower_id/"); + + @new_file_list = glob("${raw_dir2}$tower_id/$tower_id*.txt"); + + foreach $new_file (@new_file_list) { + #Loop through files and pick out month list. + $new_file =~m/${raw_dir2}$tower_id\/$tower_id\_(.*)\_.*/; + $date_stamp = $1; + @date_stamp = split('',$date_stamp); + $month_st1 = join('',@date_stamp[0..5]); + $month_st2 = join('',@date_stamp[0..3]).'_'. + join('',@date_stamp[4..5]); + + $months{$month_st1} = $month_st2;#.".nc"; + #print "input: $month_st1 output: $month_st2\n"; + } + + foreach $month (keys %months) { + #print "$month and $months{$month}\n"; + mkdir("${raw_dir2}$tower_id/$months{$month}/"); + system("mv -f ${raw_dir2}$tower_id/${tower_id}_${month}*.txt ". + "${raw_dir2}$tower_id/$months{$month}/"); +# system("mv ${raw_dir2}$tower_id/nccoos_${tower_id}_*_${month}.txt ". +# "${raw_dir2}$tower_id/$months{$month}/"); + + print "${perl_dir}tower_parse_dev.perl $month -d 1 -t $tower_id\n"; + #system("${perl_dir}tower_parse.perl $month -out ". + # "${tower_id}_$months{$month}.nc -d 1 -t $tower_id"); + system("${perl_dir}tower_parse_dev.perl $month ". + "-d 1 -t $tower_id"); + } + } + else { + print "No new files for $tower_id\n"; + } +} + + +print "elapsed time ". time - $start_time. " seconds\n";