diff --git a/SYNOP/STATS/list_of_stations_39.txt b/SYNOP/STATS/list_of_stations_39.txt index 7313d190e7cbfb7761eb489b5a75fd794f0b376a..603bc1a79bc5b7386f84a9081dde2c0fcffefae3 100644 --- a/SYNOP/STATS/list_of_stations_39.txt +++ b/SYNOP/STATS/list_of_stations_39.txt @@ -2,89 +2,3 @@ 102019 23.576000 68.602997 102017 20.850901 69.042801 101695 25.423300 64.142601 - 101776 24.727600 65.019699 - 101784 24.561199 65.039703 - 101150 24.491600 60.999199 - 100919 19.131399 60.300999 - 101196 26.049700 61.200100 - 100968 24.956800 60.326698 - 101130 24.802999 60.595901 - 101651 30.974701 62.769402 - 101649 31.044500 63.141701 - 102026 25.736500 68.903000 - 102033 27.419001 68.613297 - 102047 27.265699 69.140900 - 102055 28.894100 69.582497 - 102052 28.299101 68.849297 - 102009 28.301201 68.477997 - 102006 27.444099 68.433899 - 102005 27.413300 68.415100 - 101315 24.804600 61.855499 - 101608 29.636101 62.657001 - 101104 23.498199 60.813999 - 100917 19.986900 60.178200 - 101609 29.233999 63.232399 - 101317 24.287001 61.845901 - 101339 25.670900 62.397598 - 100934 22.551800 60.386902 - 100971 24.944599 60.175201 - 101503 23.043600 63.120300 - 101783 24.095699 65.385101 - 101950 27.159100 66.715599 - 101840 24.582800 65.789398 - 102016 20.813801 69.039001 - 101986 24.855400 67.691704 - 101994 25.783199 68.169601 - 101194 26.811100 60.696499 - 101662 23.143600 63.726601 - 101773 30.170601 64.297600 - 101586 27.633301 62.892601 - 101887 29.311899 66.370003 - 101897 29.151800 66.166100 - 101247 28.208700 61.057499 - 101636 30.045799 63.321098 - 100974 24.049500 60.244499 - 101982 24.033300 68.062798 - 101149 24.653700 60.508701 - 101799 25.372999 64.936996 - 101794 25.393200 65.006401 - 100908 21.374800 59.779099 - 101914 23.962999 66.772797 - 101064 21.783199 61.478901 - 101028 25.607300 60.391701 - 101805 26.963100 65.400101 - 101441 29.315100 61.801899 - 101831 28.056700 64.664001 - 101775 23.896700 64.611801 - 101873 26.367599 65.977203 - 101933 26.010900 66.579399 - 101920 25.838100 66.562401 - 101928 25.708799 66.498299 - 101959 28.688299 66.816597 - 101966 29.177700 67.162300 - 102012 29.611300 67.748596 - 100955 23.112900 60.373901 - 101952 28.178600 67.282997 - 101932 26.629000 67.366600 - 102001 27.184999 68.084198 - 101826 28.746700 64.931297 - 101885 28.217699 65.574898 - 101124 23.746799 61.465599 - 100949 22.178699 60.454399 - 102035 27.006800 69.756401 - 102036 27.896500 70.082001 - 101800 26.423901 64.501404 - 101464 21.068600 63.435101 - 101421 27.907900 62.322201 - 101726 27.220600 63.840900 - 101537 25.858601 63.082199 - 101231 27.672701 60.527199 - 101908 24.649599 66.529503 - 101690 24.724701 64.050301 - 101486 22.488800 62.938099 - 101958 27.218399 67.022003 - 101103 22.346100 61.252899 - 101485 21.639400 63.098701 - 126736 27.751900 64.216797 - 101705 25.705700 63.735901 - 101690 24.724700 64.050300 diff --git a/SYNOP/STATS/orig_list_of_stations_39.txt b/SYNOP/STATS/orig_list_of_stations_39.txt new file mode 100644 index 0000000000000000000000000000000000000000..7313d190e7cbfb7761eb489b5a75fd794f0b376a --- /dev/null +++ b/SYNOP/STATS/orig_list_of_stations_39.txt @@ -0,0 +1,90 @@ + station@hdr longitude@hdr latitude@hdr + 102019 23.576000 68.602997 + 102017 20.850901 69.042801 + 101695 25.423300 64.142601 + 101776 24.727600 65.019699 + 101784 24.561199 65.039703 + 101150 24.491600 60.999199 + 100919 19.131399 60.300999 + 101196 26.049700 61.200100 + 100968 24.956800 60.326698 + 101130 24.802999 60.595901 + 101651 30.974701 62.769402 + 101649 31.044500 63.141701 + 102026 25.736500 68.903000 + 102033 27.419001 68.613297 + 102047 27.265699 69.140900 + 102055 28.894100 69.582497 + 102052 28.299101 68.849297 + 102009 28.301201 68.477997 + 102006 27.444099 68.433899 + 102005 27.413300 68.415100 + 101315 24.804600 61.855499 + 101608 29.636101 62.657001 + 101104 23.498199 60.813999 + 100917 19.986900 60.178200 + 101609 29.233999 63.232399 + 101317 24.287001 61.845901 + 101339 25.670900 62.397598 + 100934 22.551800 60.386902 + 100971 24.944599 60.175201 + 101503 23.043600 63.120300 + 101783 24.095699 65.385101 + 101950 27.159100 66.715599 + 101840 24.582800 65.789398 + 102016 20.813801 69.039001 + 101986 24.855400 67.691704 + 101994 25.783199 68.169601 + 101194 26.811100 60.696499 + 101662 23.143600 63.726601 + 101773 30.170601 64.297600 + 101586 27.633301 62.892601 + 101887 29.311899 66.370003 + 101897 29.151800 66.166100 + 101247 28.208700 61.057499 + 101636 30.045799 63.321098 + 100974 24.049500 60.244499 + 101982 24.033300 68.062798 + 101149 24.653700 60.508701 + 101799 25.372999 64.936996 + 101794 25.393200 65.006401 + 100908 21.374800 59.779099 + 101914 23.962999 66.772797 + 101064 21.783199 61.478901 + 101028 25.607300 60.391701 + 101805 26.963100 65.400101 + 101441 29.315100 61.801899 + 101831 28.056700 64.664001 + 101775 23.896700 64.611801 + 101873 26.367599 65.977203 + 101933 26.010900 66.579399 + 101920 25.838100 66.562401 + 101928 25.708799 66.498299 + 101959 28.688299 66.816597 + 101966 29.177700 67.162300 + 102012 29.611300 67.748596 + 100955 23.112900 60.373901 + 101952 28.178600 67.282997 + 101932 26.629000 67.366600 + 102001 27.184999 68.084198 + 101826 28.746700 64.931297 + 101885 28.217699 65.574898 + 101124 23.746799 61.465599 + 100949 22.178699 60.454399 + 102035 27.006800 69.756401 + 102036 27.896500 70.082001 + 101800 26.423901 64.501404 + 101464 21.068600 63.435101 + 101421 27.907900 62.322201 + 101726 27.220600 63.840900 + 101537 25.858601 63.082199 + 101231 27.672701 60.527199 + 101908 24.649599 66.529503 + 101690 24.724701 64.050301 + 101486 22.488800 62.938099 + 101958 27.218399 67.022003 + 101103 22.346100 61.252899 + 101485 21.639400 63.098701 + 126736 27.751900 64.216797 + 101705 25.705700 63.735901 + 101690 24.724700 64.050300 diff --git a/SYNOP/STATS/produce_rank_histograms_all_stations.sh b/SYNOP/STATS/produce_rank_histograms_all_stations.sh index cc3ffe2e2339638922e78824790dc1e896bb0bfa..b8b064ed220d56bbe06e87465d24a4a50c866ae9 100755 --- a/SYNOP/STATS/produce_rank_histograms_all_stations.sh +++ b/SYNOP/STATS/produce_rank_histograms_all_stations.sh @@ -128,14 +128,14 @@ sim_file=${sim_dir}/FMI_open_data_2010-2021.odb # echo " Directory with pre-computed quantiles ..." quant_dir=quantiles -echo " $quant_dir" +echo " $quant_dir" quant_file=${quant_dir}/quant_all_stations_${variable}_4.odb # # 3) Pre-computed bootstrap MSD statistics # echo " Directory with pre-computed bootstrap MSD statistics ..." bootstrap_dir=bootstrap_statistics/${variable}_${period} -echo " $bootstrap_dir" +echo " $bootstrap_dir" msd_bootstrap_file=${bootstrap_dir}/MSD_bootstrap_${variable}_${period}_all_stations.odb # # 4) Directory for results @@ -145,13 +145,13 @@ msd_bootstrap_file=${bootstrap_dir}/MSD_bootstrap_${variable}_${period}_all_stat echo " Directory for results ..." outdir=rank_histograms/${variable}_${year1}${month1}-${year2}${month2} -echo " $outdir" +echo " $outdir" if test -d "$outdir"; then echo $outdir exists else echo $outdir does not exist echo " Creating directory: $outdir" - mkdir $outdir + mkdir -p $outdir fi # ################################################################## @@ -160,6 +160,7 @@ fi # and is available as a .txt file. # station_list=list_of_stations_${variable}.txt +echo " List of synop stations (with geographical coordinates): $station_list" # # ################################################################ @@ -185,7 +186,7 @@ while [ ${line_number} -le `expr $n_lines` ] do head -`expr ${line_number}` ${station_list} | tail -1 > input.txt read station longitude latitude < input.txt -echo " Station, Longitude, Latitude: ${station} ${longitude} ${latitude}" +echo " Synop station ID, longitude, latitude: ${station} ${longitude} ${latitude}" #echo ${station} #echo ${longitude} @@ -201,7 +202,7 @@ eval ${odb_command} # ############################################################### # -# Select the quantiles for teh station: +# Select the quantiles for the station: # # 00, 06, 12 and 18 UTC are picked separately, since # select \* does not allow for parentheses (very strange) @@ -228,6 +229,21 @@ odb sql select \* where station=${station} -i ${msd_bootstrap_file} -o msd_boots # Include data for 00, 06, 12 and 18 UTC. # ############################################################## +# +echo " Checking existence of file: rank_histograms_${variable}_${station}_${year1}${month1}-${year2}${month2} ..." +outfile=${outdir}/rank_histograms_${variable}_${station}_${year1}${month1}-${year2}${month2} + +echo " $outfile" +if test -f "$outfile"; then + echo $outfile exists +else + echo $outfile does not exist + echo " Creating file: $outfile" + touch $outfile +fi + + +# ./rank_histograms_one_station < ${outdir}/rank_histograms_${variable}_${year1}${month1}-${year2}${month2}_all_stations.odb ###################################################################### diff --git a/SYNOP/STATS/produce_standard_plots_all_stations.sh b/SYNOP/STATS/produce_standard_plots_all_stations.sh index 17c72a362c9b952a2aebab28b4e35267fa515a10..4398a3658afd03107c83092ff709590a25cae3ed 100755 --- a/SYNOP/STATS/produce_standard_plots_all_stations.sh +++ b/SYNOP/STATS/produce_standard_plots_all_stations.sh @@ -133,18 +133,34 @@ sim_file=${sim_dir}/FMI_open_data_2010-2021.odb # # 2) Pre-computed quantiles # +echo " Directory for pre-computed quantiles ..." quant_dir=quantiles +echo " $quant_dir" quant_file=${quant_dir}/quant_all_stations_${variable}_4.odb # # 3) Pre-computed rank histogram data # +echo " Directory for pre-computed rank histogram data ..." rh_dir=rank_histograms/${variable}_${year1}${month1}-${year2}${month2} +echo " $rh_dir" rh_file=${rh_dir}/rank_histograms_${variable}_${year1}${month1}-${year2}${month2}_all_stations.odb # # 4) Directory for figures # +##figure_dir=figures/standard_plots_${variable}_${year1}${month1}-${year2}${month2} +##[ ! -d ${figure_dir} ] && mkdir ${figure_dir} + +echo " Directory for figures ..." figure_dir=figures/standard_plots_${variable}_${year1}${month1}-${year2}${month2} -[ ! -d ${figure_dir} ] && mkdir ${figure_dir} +echo " $figure_dir" +if test -d "$figure_dir"; then + echo $figure_dir exists +else + echo $figure_dir does not exist + echo " Creating directory: $figure_dir" + mkdir -p $figure_dir +fi + # ################################################################## # @@ -156,7 +172,7 @@ station_list=list_of_stations_${variable}.txt # ################################################################ # -# Compile the Fortran program needed for creating the figures +echo " Compiling the Fortran program needed for creating the figures ..." # gfortran fortran-programs/plots_for_one_station.f95 -o plots_for_one_station # @@ -176,7 +192,7 @@ while [ ${line_number} -le `expr $n_lines` ] do head -`expr ${line_number}` ${station_list} | tail -1 > input.txt read station longitude latitude < input.txt -echo ${station} ${longitude} ${latitude} +echo " Synop station ID, longitude, latitude: ${station} ${longitude} ${latitude}" # ################################################################ # @@ -255,9 +271,11 @@ EOF ######################## # #which python -echo Calling Python +echo " Calling python to plot quantiles rank histogram ..." +#echo Calling Python +#python3 python/plot_quantiles_rankhist.py standard_plot.cfg python3 python/plot_quantiles_rankhist.py standard_plot.cfg -echo Called Python +#echo Called Python ####################### # # Remove unnecessary files diff --git a/SYNOP/STATS/python/plot_quantiles_rankhist.py b/SYNOP/STATS/python/plot_quantiles_rankhist.py index 5478aa0e4bb1a98fd8c82059a62a9d98b8b8b063..b5fd9958ffa4fe85ca38d8a56ea5c8962e8ed7ef 100644 --- a/SYNOP/STATS/python/plot_quantiles_rankhist.py +++ b/SYNOP/STATS/python/plot_quantiles_rankhist.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ''' Written by Madeleine Ekblom, 2023-05-10 @@ -38,6 +38,7 @@ from matplotlib.dates import drange, MonthLocator, DateFormatter config = configparser.ConfigParser() +#plot_data(quantiles_data, rank_hist_data, time_series_data, fig_title, fig_name, year_beg, year_end, month_beg, month_end, True) def plot_data(quantiles_data, rank_data, time_series_data, fig_title, fig_name, year_beg, year_end, month_beg, month_end, savefig=False): ''' quantiles data give the lines and the time series data give the dots @@ -101,6 +102,8 @@ def plot_data(quantiles_data, rank_data, time_series_data, fig_title, fig_name, if savefig: plt.savefig(fig_name, dpi=300) + #plt.savefig(fig_name, dpi=300) + # plt.show( ) diff --git a/SYNOP/main_synop.sh b/SYNOP/main_synop.sh index 0a8bb8bd936df3e14219ed1f34e57c0e92ee0004..11a2df319da17fa7d1fb184497d87396e6efc028 100755 --- a/SYNOP/main_synop.sh +++ b/SYNOP/main_synop.sh @@ -15,9 +15,9 @@ echo "FOR AIR TEMPERATURE AT 2 METRE" varMETnum="39" varMETstr="2t" lon_val_min="21" #20 -lon_val_max="24" #25 +lon_val_max="23" #25 lat_val_min="61" #60 -lat_val_max="64" #65 +lat_val_max="63" #65 echo "varMETnum varMETstr lon_val_min lon_val_max lat_val_min lat_val_max:" echo "$varMETnum $varMETstr $lon_val_min $lon_val_max $lat_val_min $lat_val_max"