#### Quick links: Contents Index

# Intermagnet CD Data Viewer

# CSV Tables

The INTERMAGNET CD data viewer needs two tables to tell it about countries and observatories:

ctr.csv | ISO Country codes
obs.csv | All observatories worldwide (not limited to the observatories on any CD-ROM or DVD).

The files must be in Excel CSV (comma seprated values) format, a simple ASCII format that you can read and write using Microsoft Excel (because they are ASCII you could use a plain text editor, but it is easier to use Excel). Each file must contain a header row as the first line, followed by data rows. There must be no empty rows between the header and the end of the data or within the data rows. The header line tells you what information should go in each column. For ctr.csv the columns are:

Name | Data type
Country | String
3 Digit Code | String
Intermagnet Code | String (may be empty)

The '3 Digit Code' field contains country codes to ISO standard 3166. These codes can be found at one of the following addresses: http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html. http://unstats.un.org/unsd/methods/m49/m49alpha.htm

The 'Intermagnet Code' field is used to 'translate' non-ISO standard codes that have been used on the INTERMANGET CD-ROM. In some cases more than one code has been used to designate a country. For these situations enter two (or more) rows for the country with one of the Intermagnet Codes on each row. Where the CD-ROM only uses the standard code, the 'Intermagnet Code' field can be left blank. For an example of this, see the entries for China.

For obs.csv the headers are:

Name | Data type
IAGA Code | String
Observatory Name | String
Latitude | Real number
Longitude | Real number
Altitude (metres) | Integer number
Country Code | String (contains either the INTERMAGNET code or the 3 digit ISO code from ctr.csv).
Year Valid From | Integer number (may be empty)
Year Valid To | Integer number (may be empty)

## File versions

To allow the country and observatory tables to be updated, the software supports version numbers for the table files. Filenames are modified to be in the form:

ctr_vNNN.csv
obs_vNNN.csv

Where NNN is the version number (note that file name lengths have been kept to the DOS 8.3 standard). The file with the highest version number is used by the software. Version numbers must be between 100 and 999.

## File locations

The software uses the most recent version of both CSV files that it finds in the configuration directory ($HOME/.imag/). On Windows $HOME translates to your 'documents and settings' directory, so look for the files in somewhere like c:\documents and settings\your-username\.imag\ - on UNIX $HOME is your login directory.

Each time the software starts it checks for new versions of these files in the software distribution itself (i.e. inside the JAVA jar file). Any versions of the files found in the software distribution that are more recent than those in the configuration directory will be copied to the configuration directory and used immediately.

The software also checks databases when they are loaded to see if they contain new versions of these files (the databases may include a CD-ROM drive, which may contain a new CD-ROM). On the CD-ROM the files may be put in either of two places:

File | Location>
ctr_vNNN.csv | magYYYY/csv directory magYYYY/ctry_inf directory
obs_vNNN.csv | magYYYY/csv directory magYYYY/obsy_inf directory

The 'CSV' directory is new to the CD-ROM and has been added for the storage of the country and observatory tables. Whichever location the files are stored in the software will copy new files from the CD (as and when it finds them) to the configuration directory ($HOME/.imag/). After files have been copied the software will use the highest version number of the file from the configuration directory.

Users can provide their own versions of these files simply by copying them to the configuration directory with a higher version number than any files that already exist. If a user wants to ensure that a particular file always takes precedence, then using 900 as a base number will work OK.

You can see the list of files that the program knows about from 'Help / Diagnostics / Configuration files'.

#### Quick links: Contents Index