How to use the CNS Data Fixer Program
The CNS data fixer is a program written in Python to correct processed station data files in the CNS data directory. The program only modifies the .dal and .hrl files in the data directory. To use this program, Python must be installed on the computer. Also, the command line must be used for this program.
To start, open a command line window and change directory into the cns_data_fixer directory. This directory holds the CNS data fixer program.
The name of the Python script to run is cns_fixer.py. By adding a -h option a list of the options are printed to the screen. Refer to the next screen shot.
Each option listed, requires a value to directly proceed it. The only exceptions are the -h option and the –hourly option.
Using the –hourly option sets this program to modify the hourly data (.hrl) files.
The -s and -e options require a date string in the following format: YYYY-MM-DD.
The -x option requires a string like the following: obs*x, where x is some floating point number, and obs is a placeholder for the value to be modified.
The -f option is not required to be entered and defaults to solar radiation. This option exists for future functionality.
The -u option is the upper limit of value corrections. Enter this option to specify a floating point number where the modified values should not exceed.
Finally, the -i option is to set the cns station id. To retrieve the station ids, go to the following link: http://virga.nmsu.edu/cgi-shl/wx_data/stations.py
Refer to the following screenshot to view the output of visiting the link.
The station id is the third comma separated value in the line. For example, Artesia's station id is the following: nmcc-ed-1.
As an example, Alcalde ASC will be updated. Alcalde's station id is nmcc-ra-1. Enter in the start date and end date as well as the -x option. In this case, the solar radiation will be modifed by multiplying the original data by 1.05 from January 1, 1985 to March 25, 1995.
After running this program, the data directories should have a file with a time stamp post-fixed to the file name. For example, in the 85 directory, a new file has been created with the time stamp post fixed. This new file is actually the file with the original data. The file containing modified data is named normally. In this case, nmcc-ra-185.dal. Refer to the following screenshot for details.
To back up to the original data, simply delete the modified file, nmcc-ra-185.dal and rename the file with the time stamp post fixed to nmcc-ra-185.dal.
Using this program is hourly mode works exactly as the daily mode, with the exception that the file modified and backed up will have .hrl file extensions.