Compare¶
Compare.py is a small script which trace 2 PRO-files at the same time in order to compare them.
Furthermore, it compares global properties of both snow simulations (height of snow, albedo, swe, numbers of layer).
Just launch
python3 $SNOWTOOLS_CEN/plots/compare.py path_to_first_PRO_file path_to_second_PRO_file [-t1 title1] [-t2 title2] [-v variable to plot] [-b begin date for plot YYYYMMDDHH] [-e end date for plot YYYYMMDDHH] [--point chosen point] [-a altitude] [-as aspect] [-s slope] [-m massif] [-o output file for graph and text]
!!! you need xarray in your python library !!!
One word about the differents options:
-t1 and -t2 are made for the title of the graph.
By default, you have: Compare PRO1 and PRO2
with -t1 toto -t2 foo the title become Compare toto and foo
If you need a space in your title, you can do -t1 'toto is here' -t2 'he is happy'
-v is the variable to plot (by default this is -v SNOWSSA). You can use every variable which is depending on snow_layer, for example:
WSN_VEG, SNOWRO, SNOWTEMP, SNOWLIQ, SNOWDZ, SNOWDEND, SNOWSPHER, SNOWSIZE, SNOWSSA, SNOWSHEAR, RSN_VEG, ASN_VEG, ACC_RAT, NAT_RAT, SNOWIMP1, SNOWIMP2
-b and -e give the opportunity to focus your graph on dates of interest.
For example, if your to PRO files are yearly files 2010080106_2011080106, you can zoom only on december via -b 2010120100 -e 2010123123
--point is made for choosing the point of interest on your PRO file.
You use for example --point 10
Similarly, if you want to plot a point in a specific massif, altitude, ... you can use the options -a, -m, -as, -s
In case of several points corresponding to these conditions, this is the first one which is plot.
-o is there for saving graph and text. You can use for example with -o output_to_save it will save two files:
output_to_save.png which is the graph
output_to_save.txt with the comparison of the global properties of the snow experiment