Dayfile.txt: Difference between revisions

4,172 bytes added ,  8 August 2020
m
(25 intermediate revisions by the same user not shown)
 
== Changes in different releases of Cumulus ==
 
Be aware that this article was written for Cumulus 1, amended to also cover MX 3.0.0. Whilst the list of fields has been kept updated for more recent MX versions, other parts of this article may not be applicable to latest MX version, check for edits by developer.
 
{{Version badge 1}}
 
=== File specific Editing Rules ===
 
[[File:Open office (editing cumulus log files).png| right]]
# The file should be saved without "Byte Order Mark", specialised text editors will include a menu where you select the encoding and can select not to include BOM.
 
=== Using the Cumulus 1 editing feature ===
 
{{Version badge 1}}
'''This section applies to Cumulus 1.x.y only'''. The last command in '''Edit''' [[Cumulus_Screenshots#File.2FEdit.2FHelp_Menu |menu]] is ''dayfile.txt''. ''This is how you view'' the dayfile.txt from within Cumulus. This is a text editor, so you can type new values over those currently displayed, insert and delete rows, and it works best when at full screen. Click the ''Help'' button for detailed instructions. Cumulus Help is comprehensive.
The Cumulus 1 editor provides a "Create Missing" option where it will, for any dates for which a line does not exist, create a line if it can from reading the [[Monthly log files|detailed log file]] to extract all values relevant to that day and do the necessary minimum/maximum/total/average calculation for each dayfile.txt field, storing the time from the relevant other log file in any time-stamp field in dayfile.txt. If a particular day does not exist as a row on the daily summary log, then 'create missing' can search the observations in the relevant monthly log, and calculate approximate highs, lows and totals to insert as an extra row in the daily summary log. These are approximate because the actual highs and lows for that day are quite likely to have occurred at moments in-between those that were logged. For ''Create missing'' a list of inserted records is produced in [[dayfileeditlog.txt]]. If just some fields are wrong in a particular row (meteorological day) on day file, then there is a [[Standard_log_files#Using_Standard_logs_to_deal_with_shorter_.28or_incomplete.29_dayfile.txt_records_for_particular_dates | work around]] as at all current versions (up to 1.9.4) you can only use 'Create missing' to read from the [[Standard_log_files]] if the whole day (a line starting with that date) is missing in ''dayfile.txt''. Although Cumulus does not recognise the concept of a sensor not being available, it will write solar information even if you don't have a solar sensor; it does have to cope with reading a monthly log file that might have fewer derivatives than it wants (when using Create Missing) and therefore it may not know what to write into dayfile.txt as the calculated value. Cumulus 1 can't write a null value, so it writes zero for values, and "00:00" for time stamps. If you are using a 9am or 10am rollover time, be aware that create missing in Cumulus 1 always inserts 00:00 for null time-stamps, but in normal running Cumulus uses the rollover time for null time-stamps.
 
==== Using Standard logs to deal with shorter (or incomplete) dayfile.txt records for particular dates ====
 
'''WORKAROUND if required dates are present in both the standard log and dayfile.txt, but not all fields for that date exist in dayfile.txt'''
 
The only method available at the time of writing involves multiple steps:
#*Either use '''ExportMySQL.exe monthly''' to create a database table called "monthly" (you can call it another name, but you must have set name in MX, before you run ExportMySQL.exe), and read all the standard logs into that database table
#*Or if you already have the table and have MX updating the standard logs into that database table
#Then, you can fairly easily update to add any missing values into existing columns in this monthly table, and from it update columns in a daily summary table. See [https://cumulus.hosiene.co.uk/viewtopic.php?f=18&t=18096 this post in support forum] where I describe two PHP scripts designed for this type of task.
 
== Cumulus MX ==
 
There is a dayfile editor within the admin interface to edit this log file.
 
Only from MX version 3.6.0 has this been able to read the log file if it has some lines that were created using Cumulus 1 (with less than 46 fields). In the same version of MX, the number of fields in this log file was increased by 4 when Feels Like temperature was added. From that version all lines viewed in this editor will have 50 fields. The content of any field that was not in the line when it was created will be an empty string as far as this editor is concerned and any line edited and saved, therefore gains all these empty fields and will be stored as 50 fields until version 3.6.10.
 
From Emergency Version 3.6.12 (formally released in 3.7.0), all lines have 54 fields. The extras are Canadian Humidity Index (Humidex).
 
[[File:Badge vMx.png]]For Cumulus MX, when you select a line, both '''Edit''' and '''Delete''' buttons are enabled. There is no way of inserting new lines into dayfile.txt from within MX, nor of changing the dates in the file.
 
 
 
=== Editing inside MX ===
=== Editing externally ===
 
See earlier section on this page for the rules and later section for advice on dealing with rogue values. Remember if you edit this file externally, either do not add any missing fields, or if you do then these must remain empty for every extra field in every line that was originally shorter!
 
MX does not have the capability to recalculate, the values and time-stamp for any entry in dayfile.txt, by reading the [[Monthly log files|detailed log file]] to extract all values relevant to that day and do the necessary minimum/maximum/total/average calculation. It can be done in a script if you are a programmer. I have done this, but it was not as easy as I thought, the log file you read from may have duplicate times potentially making the calculation harder, and you cannot edit the file as you go along, you basically rename the old file and create a new file with original name as you work through all days changing individual fields whenever you need to.
== Information shown in the table ==
 
*The fields are now numbered starting from 1 to fit in with Cumulus MX where when the log file is read, adds a line number in front of the date field.
*The field number is shown starting from zero, this has two advantages:
** The Cumulus MX user may not be aware of this happening as it is within the internal workings.
**It stresses that the line consists of a date, (that should be a unique identifier, the same date should not be repeated in another line) plus data (mostly numerical, but some values are paired with a time)
*The original table below was for Cumulus 1 and then field number '''was''' starting from zero. So in some forum posts you might see references to old numbering, in others to new numbering. The old numbering from zero had two advantages:
**Numbering starting from zero is consistent with standard indexing used for arrays in programming languages (like JavaScript), so the number shown is the number to quote in any scripts you write to read this file if you just want to examine that particular derivative.
**#It stressesstressed that the linedate consistsfield ofwas adifferent to the rest. The date, (that should'''must''' be a unique identifier, the same date should not be repeated in another line) plus data (mostly numerical, but some values are paired with a time).
*#The remaining fields were all either numerical values or a time paired with preceding numerical value.
**Numbering starting from zero is consistent with standard indexing used for arrays in programming languages (like JavaScript), so the number shown is'''was''' the number to quote in any scripts youwhere writea toline readwas thisconverted fileto ifan youarray, justand you wantneeded to examineaddress thata particularsingle derivativefield.
*The alphabetic column identifiers used by many spreadsheets are shown, please see warnings about using spreadsheets for editing earlier on this page
*The type of field is shown, you must not put a sign for an unsigned field, you can not specify a decimal point in an integer field, all time fields must use HH:mm format
!style="width:200px" | Field type
!style="width:600px" | Description
|-
|colspan="4" style="background:lightgray;"|Included from when dayfile.txt first invented (assumed in first public release 1.0)
|-
|0
|colspan="3"|For internal MX purposes, the zero field identifies a field that holds the line number. It is not actually stored as a field in the log file, but precedes any line exchanged via an application programming interface, and therefore is also included in an array representing all the fields in any log file line.
 
If you are processing this log file using a third party (or your own) script, that probably does not place the line number into any array, and your array elements will start at 0 for the field labelled 1 in this table, so putting all field numbers out by 1.
|-
|colspan="4" style="background:lightgray;"|Those fields included below have been in dayfile.txt from the start of Cumulus 1 (Version 1.0, the First release on 27th January 2004).
|-
|1
|A
|8 characters
|Date as ''2 figure day [separator] 2 figure month [separator] 2 figure year'' - the separator is that set in the windows system short date format (see [[setup]])
|-
|12
|B
|Unsigned number
|Highest wind [[Wind_measurement#Weather_Stations_and_Cumulus|gust]] speed
|-
|23
|C
|unsigned integer
|[[Wind_measurement#Wind_Direction | Bearing]] of highest wind gust
|-
|34
|D
|5 characters
|Time of highest wind gust
|-
|45
|E
|signed decimal
|Minimum [[Temperature_(and_humidity)_measurement#Cumulus_Calculated_Parameters | temperature]]
|-
|56
|F
|5 characters
|Time of minimum temperature
|-
|67
|G
|signed decimal
|Maximum temperature
|-
|78
|H
|5 characters
|Time of maximum temperature
|-
|89
|I
|Unsigned number
|Minimum [[Pressure_Measurement | sea level pressure]]
|-
|910
|J
|5 characters
|Time of minimum pressure
|-
|1011
|K
|Unsigned number
|Maximum sea level pressure
|-
|1112
|L
|5 characters
|Time of maximum pressure
|-
|1213
|M
|unsigned number
|Maximum [[Rain_measurement#Rain_Rate | rainfall rate]]
|-
|1314
|N
|5 characters
|Time of maximum rainfall rate
|-
|1415
|O
|unsigned number
|Total rainfall for the day
|-
|colspan="4" style="background:graylightblue;"|Above here represents the minimum length for every line, a count of 15 items
|-
|colspan="4" style="background:lightgraypink;"|(TheThere is no record of which version added this next field, it is almost certainly one of the versions in the release history between versions 1.2.5 and 1.5.1 that was lost by Steve Loft,. andThe forfirst MXmention of it in "DataEditorthe forum relates to a question re the 1.cs"8.2 thisrelease additionconfirming hasit "was Extendedpresent forby ???"December as2008, abut comment)those release notes don't mention it being introduced in that release.
 
Because of that, in "DataEditor.cs" (part of the source code that is compiled into CumulusMX.exe) this addition has "Extended for ???" as a comment)
|-
|1516
|P
|signed decimal
|colspan="4" style="background:lightgray;"|(Wind run was added from version 1.8.4)
|-
|1617
|Q
|unsigned number
|Daily [[Windrun | wind run]]
|-
|colspan="4" style="background:lightgray;"|(The next pair of entries were added from version 1.8.9 build 907 (June 2010) as part of a total redesign of how dayfile.txt was implemented in Cumulus 1)
|-
|1718
|R
|unsigned number
|Highest [[Wind_measurement#Weather_Stations_and_Cumulus|Average Wind Speed]]
|-
|1819
|S
|5 characters
|Time of Highest Avg. Wind speed
|-
|colspan="4" style="background:lightgray;"|(The two pairs of humidity entries were added fromin a v 1.9.0 beta, the exact build number is now lost)
|-
|1920
|T
|unsigned integer
|Lowest [[Temperature_(and_humidity)_measurement | humidity]]
|-
|2021
|U
|5 characters
|Time of lowest humidity
|-
|2122
|V
|unsigned integer
|Highest humidity
|-
|2223
|W
|5 characters
|colspan="4" style="background:lightgray;"|(The next two entries were added from version 1.9.0)
|-
|2324
|X
|(not documented)
|Total evapotranspiration (Only valid for Davis stations, shows zero otherwise)
|-
|2425
|Y
|unsigned
|Total hours of sunshine (only valid if sunshine sensor connected)
|-
|colspan="4" style="background:lightgray;"|(The next 16 entries were added from version 1.9.1 May 2011)
|-
|2526
|Z
|signed decimal
|High [[Heat index]] (added to Cumulus in 1.7.11 only as spot value, not stored)
|-
|2627
|AA
|5 characters
|Time of high heat index
|-
|2728
|AB
|Signed decimal
|High [[Apparent temperature]]
|-
|2829
|AC
|5 characters
|Time of high apparent temperature
|-
|2930
|AD
|signed decimal
|Low apparent temperature
|-
|3031
|AE
|5 characters
|Time of low apparent temperature
|-
|3132
|AF
|unsigned number
|High hourly rain
|-
|3233
|AG
|5 characters
|Time of high hourly rain
|-
|3334
|AH)
|signed decimal
|Greatest [[wind chill]] (high wind speed, low temperature) (addedcalculated insince version 1.8.3 as spot value, not stored)
|-
|3435
|AI
|5 characters
|Time of greatest wind chill
|-
|colspan="4" style="background:lightgray;"|(The next two pairs for dew point were added in version 1.9.2 beta build)
|-
|3536
|AJ
|signed decimal
|High [[Temperature_(and_humidity)_measurement#Cumulus_Calculated_Parameters | dew point]]
|-
|3637
|AK
|5 characters
|Time of high dew point
|-
|3738
|AL
|signed decimal
|Low dew point
|-
|3839
|AM)
|5 characters
|colspan="4" style="background:lightgray;"|(The next three entries were added in version 1.9.2 Build 1004)
|-
|3940
|AN
|unsigned integer
|Today's dominant/average wind direction
|-
|4041
|AO
|unsigned decimal
|[[Heat/cold degree days and Chill hours | Heating degree days]]
|-
|4142
|AP
|unsigned decimal
|colspan="4" style="background:lightgray;"|The next two pairs were added in version 1.9.3 build 1036 (these only show valid values if appropriate sensors exist)
|-
|4243
|AQ
|unsigned decimal
|High solar radiation
|-
|4344
|AR
|5 characters
|Time of high solar radiation
|-
|4445
|AS
|unsigned decimal
|High UV Index
|-
|4546
|AT
|5 characters
|Time of high UV Index
|-
|colspan="4" style="background:lightgray;"|The next two pairs were added in version 3.6.0, 2 more derived values and their times
|-
|4647
|AU
|signed decimal
|High [[Feels Like]] temperature
|-
|4748
|AV
|5 characters
|Time of high feels like temperature
|-
|4849
|AW
|signed decimal
|Low Feels Like temperature
|-
|4950
|AX
|5 characters
|Time of low feels like temperature
|-
|colspan="4" style="background:lightgray;"|IncludedThe fromnext whentwo dayfile.txtpairs firstwere invented (assumedadded in firstversion public3.6.12 release 1.0)
 
*Version 3.6.12 (build 3088) was an emergency release to cure serious problems in previous build 3087. It added the following 4 fields (2 values and their times).
**The 4 extra fields are left empty in this release, although you can add values and time-stamps using the dayfile editor.
*From version 3.7.0 the first 2 of these 4 fields are populated, and the last 2 are removed, so I have labelled them as error.
|-
|51
|AY
|signed decimal
|High Canadian Humidity Index or [[Humidex]]
|-
|52
|AZ
|5 characters
|Time of high Humidex
|-
|colspan="4" style="background:lightblue;"|Just confirming that the next 2 fields were included by mistake in an emergency release (3.6.12), and are not included in current nor any other version, so have labelled them as error.
|-
|53 ('''error''')
|BA
|signed decimal
|Labelled as Low Humidex, but not used, (appear in 3.6.12, but no other version)
|-
|54 ('''error''')
|BB
|5 characters
|Labelled as Time of low Humidex, but not used, (appear in 3.6.12, but no other version)
|}
 
5,838

edits