Surfer will automatically recognize the date/time data as long as one of these conditions is true:
- The data is in an Excel file format (XLS, XLSM or XLSX) and the cells are formatted as dates or times.
- The data is in TXT, CSV, DAT, ASCII, or another text format, and the data is in one of the standard U.S. Excel date/time formats, such as mm/dd/yy.
As long as one of the above conditions are met, then you can use the date/time data as any regular data. You can create a post map of the data or grid the data and create a contour map from the grid. The dates and times in the data file are internally converted to a number to grid and create maps from. To convert the numbers back into dates, format the axis labels with the Type set to Date/time and specify the desired date and time format.
If the data is not saved as dates or times in an Excel file, or the format of the data in the text file is not a U.S. Excel date/time standard format, the data will be imported into Surfer as text, not as date/time.
For example, please see Axes.srf and Temperature_Samples.xlsx in the \Samples\ directory in the Surfer installation folder.
For more information, please see: Working with Date/Time Data in Surfer
Surfer 11 and previous versions do not support alphanumeric or date/time data. All data to be gridded in Surfer must be numeric. You can work around this by converting your data to Julian dates, plotting the Julian dates, then labeling the axis with the actual date/time data.
Convert your date/time data to Julian dates
The first step is to convert the dates/times to Julian dates. Julian dates are a system of time measurement for scientific use. You can do the conversion easily in Excel:
- Open your data file in Excel.
- Select your date/time column and choose to format the cells as Number. That will convert the dates/times to Julian dates. You may want to increase the Decimal places if you have time data in addition to dates.
- Save and close the data file.
- You can now grid this data file in Surfer and create a map from the data. Now your axes will show the Julian date labels.
Label the axes with the actual date/time data
If you created a non-3D map (contour, image, shaded relief, etc) you can replace the axis labels with the actual date/times by following these steps:
- Select the Bottom Axis in the Object Manager for the map (or whatever axis shows the Julian date values).
- In the Property Manager, click the General tab and uncheck the Show checkbox.
- Click the Ticks tab and set the Major Ticks and Minor Ticks styles both to None.
- Now you can either click Draw | Text to draw in the date labels, or you can create a post map to plot dates along the X axis as data point labels.
- To create a post map, select the Map in the Object Manager, and in the Property Manager, click the Limits tab, and note the yMin value for the map.
- Open the Surfer worksheet, or an Excel worksheet, and create a data file with 3 columns of data for all the tick marks and labels you would like to see on the axis:
- X (Julian dates/times)
- Y (minimum Y value of map), this will all be the same Y value for all points
- label (regular dates or time format, ie. 5/15/05) corresponding to the Julian dates on the same row
- Select the map and click Map | Add | Post Layer, select the data file and click Open. If you are asked if you want to adjust the map limits, click No.
- Select the post map and in the Property Manager, make sure the post map uses the first two columns of data for the X and Y columns and uses the "+" symbol.
- Click the Labels tab and set the Worksheet column to be the column containing the label data, and set Position relative to symbol to Below.
- If you want to make adjustments to the date labels, select the post map, and in the Property Manager click the Labels tab, and make font adjustments or placement changes here.
For an example of the final output, please see attached S8_DateTimeAxis.srf.
Updated February 8, 2017