wmo-im / wmds

WIGOS Metadata Standard: Semantic standard and code tables
16 stars 22 forks source link

Create new table: time zones #339

Closed jbianchi81 closed 2 years ago

jbianchi81 commented 3 years ago

Summary and Purpose

According to https://schemas.wmo.int/wmdr/1.0/html/ TimeZone property of observingFacility is defined by a reference to a code list, which is missing on codes.wmo.int/wmdr.

Proposal

The current proposal includes the following fields:

Source: <https://www.iana.org/time-zones> last version 2022a (released 2022-03-15)

The script for generating this table can be found here. For now, the description includes all locations found for each timezone. These enumerations should be shortened by selecting the most representative locations.

The table was added to the branch as 4-08.csv.

notation name description
-12 UTC-12:00 Timezone with a UTC offset of UTC-12:00 hours. Locations in this timezone include Etc/GMT+12
-11 UTC-11:00 Timezone with a UTC offset of UTC-11:00 hours. Locations in this timezone include Pacific/Samoa, US/Samoa, Pacific/Pago_Pago, Etc/GMT+11, Pacific/Niue, Pacific/Midway
-10 UTC-10:00 Timezone with a UTC offset of UTC-10:00 hours. Locations in this timezone include Pacific/Honolulu, Pacific/Tahiti, America/Atka, US/Aleutian, Pacific/Johnston, Pacific/Rarotonga, US/Hawaii, Etc/GMT+10, America/Adak, HST
-9.5 UTC-09:30 Timezone with a UTC offset of UTC-09:30 hours. Locations in this timezone include Pacific/Marquesas
-9 UTC-09:00 Timezone with a UTC offset of UTC-09:00 hours. Locations in this timezone include Etc/GMT+9, Pacific/Gambier, America/Nome, America/Metlakatla, US/Alaska, America/Yakutat, America/Sitka, America/Juneau, America/Anchorage
-8 UTC-08:00 Timezone with a UTC offset of UTC-08:00 hours. Locations in this timezone include America/Santa_Isabel, America/Vancouver, Etc/GMT+8, Mexico/BajaNorte, Canada/Pacific, America/Tijuana, PST8PDT, US/Pacific, America/Ensenada, Pacific/Pitcairn, America/Los_Angeles
-7 UTC-07:00 Timezone with a UTC offset of UTC-07:00 hours. Locations in this timezone include America/Cambridge_Bay, America/Fort_Nelson, America/Edmonton, America/Shiprock, America/Denver, America/Dawson_Creek, America/Phoenix, America/Mazatlan, America/Ojinaga, Canada/Mountain, America/Creston, America/Chihuahua, America/Boise, America/Dawson, America/Inuvik, America/Hermosillo, US/Mountain, MST7MDT, US/Arizona, America/Whitehorse, Mexico/BajaSur, America/Yellowknife, Etc/GMT+7, Canada/Yukon, MST, Navajo
-6 UTC-06:00 Timezone with a UTC offset of UTC-06:00 hours. Locations in this timezone include America/Merida, America/Monterrey, America/Mexico_City, Mexico/General, Canada/Central, America/Menominee, Pacific/Easter, America/Chicago, America/Managua, America/Costa_Rica, Pacific/Galapagos, America/Knox_IN, Etc/GMT+6, US/Central, America/Matamoros, America/El_Salvador, America/Belize, America/Rainy_River, CST6CDT, America/Indiana/Knox, America/Tegucigalpa, America/Swift_Current, America/Winnipeg, America/Resolute, America/Regina, America/Rankin_Inlet, America/Guatemala, US/Indiana-Starke, America/Indiana/Tell_City, America/North_Dakota/New_Salem, America/North_Dakota/Center, Chile/EasterIsland, America/North_Dakota/Beulah, America/Bahia_Banderas, Canada/Saskatchewan
-5 UTC-05:00 Timezone with a UTC offset of UTC-05:00 hours. Locations in this timezone include America/Indiana/Petersburg, America/Indiana/Vincennes, America/Indiana/Vevay, America/Jamaica, America/Indiana/Marengo, Cuba, America/Iqaluit, America/Indianapolis, America/Indiana/Winamac, America/Toronto, America/Kentucky/Louisville, America/Kentucky/Monticello, America/Lima, America/Louisville, America/Montreal, America/Nassau, America/New_York, America/Nipigon, America/Panama, America/Pangnirtung, America/Port-au-Prince, America/Porto_Acre, America/Indiana/Indianapolis, America/Thunder_Bay, Etc/GMT+5, America/Rio_Branco, America/Guayaquil, EST5EDT, America/Havana, America/Cancun, America/Detroit, America/Eirunepe, America/Coral_Harbour, America/Fort_Wayne, Brazil/Acre, Canada/Eastern, America/Bogota, US/East-Indiana, America/Atikokan, America/Grand_Turk, US/Eastern, US/Michigan, EST, America/Cayman, Jamaica
-4 UTC-04:00 Timezone with a UTC offset of UTC-04:00 hours. Locations in this timezone include America/Santiago, America/Santo_Domingo, America/Aruba, America/Port_of_Spain, America/Asuncion, America/Barbados, America/Puerto_Rico, America/St_Barthelemy, America/Thule, America/St_Lucia, America/St_Thomas, America/St_Vincent, America/Antigua, America/Anguilla, Canada/Atlantic, America/Tortola, Brazil/West, America/Virgin, Chile/Continental, Etc/GMT+4, Atlantic/Bermuda, America/St_Kitts, America/Blanc-Sablon, America/Halifax, America/Montserrat, America/Guyana, America/Guadeloupe, America/Grenada, America/Goose_Bay, America/Glace_Bay, America/Dominica, America/Kralendijk, America/La_Paz, America/Curacao, America/Cuiaba, America/Lower_Princes, America/Boa_Vista, America/Marigot, America/Martinique, America/Caracas, America/Manaus, America/Porto_Velho, America/Campo_Grande, America/Moncton
-3.5 UTC-03:30 Timezone with a UTC offset of UTC-03:30 hours. Locations in this timezone include America/St_Johns, Canada/Newfoundland
-3 UTC-03:00 Timezone with a UTC offset of UTC-03:00 hours. Locations in this timezone include America/Argentina/Tucuman, America/Argentina/Ushuaia, America/Miquelon, America/Argentina/Salta, America/Jujuy, America/Cordoba, Brazil/East, Atlantic/Stanley, Antarctica/Palmer, Antarctica/Rothera, America/Buenos_Aires, America/Godthab, America/Bahia, Etc/GMT+3, America/Montevideo, America/Belem, America/Fortaleza, America/Araguaina, America/Catamarca, America/Maceio, America/Punta_Arenas, America/Argentina/Rio_Gallegos, America/Argentina/Mendoza, America/Recife, America/Argentina/La_Rioja, America/Argentina/Jujuy, America/Argentina/Cordoba, America/Rosario, America/Paramaribo, America/Argentina/ComodRivadavia, America/Nuuk, America/Sao_Paulo, America/Argentina/Buenos_Aires, America/Argentina/Catamarca, America/Santarem, America/Cayenne, America/Mendoza, America/Argentina/San_Juan, America/Argentina/San_Luis
-2 UTC-02:00 Timezone with a UTC offset of UTC-02:00 hours. Locations in this timezone include Brazil/DeNoronha, America/Noronha, Atlantic/South_Georgia, Etc/GMT+2
-1 UTC-01:00 Timezone with a UTC offset of UTC-01:00 hours. Locations in this timezone include Atlantic/Azores, America/Scoresbysund, Etc/GMT+1, Atlantic/Cape_Verde
0 UTC±00:00 Timezone with a UTC offset of UTC±00:00 hours. Locations in this timezone include Atlantic/Canary, Atlantic/St_Helena, Atlantic/Faroe, Atlantic/Reykjavik, Atlantic/Faeroe, Atlantic/Madeira, Africa/Abidjan, Etc/GMT+0, Universal, UTC, UCT, Portugal, Iceland, Greenwich, GMT0, GMT-0, GMT+0, GMT, GB-Eire, GB, Europe/London, Europe/Lisbon, Europe/Jersey, Europe/Isle_of_Man, Europe/Guernsey, Europe/Belfast, Etc/Zulu, Etc/Universal, Etc/UTC, Etc/UCT, Etc/Greenwich, Etc/GMT0, Etc/GMT-0, Etc/GMT, WET, Zulu, Africa/Lome, Antarctica/Troll, Africa/Dakar, America/Danmarkshavn, Africa/Freetown, Africa/Bissau, Africa/Banjul, Africa/Bamako, Africa/Nouakchott, Africa/Conakry, Africa/Ouagadougou, Africa/Monrovia, Africa/Timbuktu, Africa/Accra, Africa/Sao_Tome
1 UTC+01:00 Timezone with a UTC offset of UTC+01:00 hours. Locations in this timezone include Africa/Ndjamena, Africa/Malabo, Arctic/Longyearbyen, Europe/Skopje, Eire, Europe/Stockholm, Europe/Tirane, Europe/Vaduz, Africa/Niamey, Europe/Vatican, CET, Europe/Sarajevo, Europe/Warsaw, Europe/Zagreb, Europe/Luxembourg, Atlantic/Jan_Mayen, Europe/Vienna, Europe/Brussels, Europe/San_Marino, Europe/Ljubljana, Africa/Porto-Novo, Europe/Gibraltar, Europe/Dublin, Europe/Copenhagen, Europe/Busingen, Europe/Budapest, Europe/Malta, Europe/Bratislava, Etc/GMT-1, Europe/Berlin, Africa/Tunis, Europe/Andorra, Europe/Amsterdam, Europe/Monaco, Europe/Oslo, Europe/Paris, Europe/Podgorica, MET, Europe/Rome, Europe/Belgrade, Europe/Prague, Europe/Zurich, Europe/Madrid, Africa/Ceuta, Poland, Africa/Brazzaville, Africa/Luanda, Africa/Bangui, Africa/Kinshasa, Africa/Algiers, Africa/Lagos, Africa/Libreville, Africa/El_Aaiun, Africa/Douala, Africa/Casablanca
2 UTC+02:00 Timezone with a UTC offset of UTC+02:00 hours. Locations in this timezone include EET, Etc/GMT-2, Egypt, Europe/Tallinn, Europe/Sofia, Asia/Amman, Asia/Beirut, Europe/Riga, Europe/Tiraspol, Europe/Mariehamn, Europe/Nicosia, Europe/Uzhgorod, Africa/Bujumbura, Africa/Windhoek, Asia/Nicosia, Europe/Athens, Africa/Blantyre, Europe/Bucharest, Europe/Chisinau, Africa/Tripoli, Europe/Helsinki, Europe/Kaliningrad, Europe/Kiev, Asia/Jerusalem, Africa/Cairo, Asia/Tel_Aviv, Africa/Lubumbashi, Europe/Vilnius, Africa/Mbabane, Africa/Maseru, Africa/Maputo, Asia/Damascus, Africa/Kigali, Africa/Khartoum, Asia/Gaza, Israel, Africa/Juba, Africa/Johannesburg, Asia/Famagusta, Africa/Harare, Africa/Gaborone, Africa/Lusaka, Asia/Hebron, Libya, Europe/Zaporozhye
3 UTC+03:00 Timezone with a UTC offset of UTC+03:00 hours. Locations in this timezone include W-SU, Europe/Kirov, Europe/Istanbul, Etc/GMT-3, Indian/Comoro, Asia/Istanbul, Europe/Minsk, Indian/Mayotte, Asia/Kuwait, Africa/Asmera, Asia/Qatar, Africa/Asmara, Africa/Addis_Ababa, Europe/Moscow, Turkey, Indian/Antananarivo, Asia/Baghdad, Africa/Djibouti, Asia/Bahrain, Asia/Riyadh, Antarctica/Syowa, Europe/Simferopol, Africa/Nairobi, Asia/Aden, Africa/Dar_es_Salaam, Europe/Volgograd, Africa/Kampala, Africa/Mogadishu
3.5 UTC+03:30 Timezone with a UTC offset of UTC+03:30 hours. Locations in this timezone include Iran, Asia/Tehran
4 UTC+04:00 Timezone with a UTC offset of UTC+04:00 hours. Locations in this timezone include Asia/Tbilisi, Europe/Saratov, Asia/Dubai, Asia/Muscat, Europe/Samara, Europe/Astrakhan, Indian/Reunion, Asia/Baku, Indian/Mauritius, Europe/Ulyanovsk, Indian/Mahe, Etc/GMT-4, Asia/Yerevan
4.5 UTC+04:30 Timezone with a UTC offset of UTC+04:30 hours. Locations in this timezone include Asia/Kabul
5 UTC+05:00 Timezone with a UTC offset of UTC+05:00 hours. Locations in this timezone include Asia/Karachi, Asia/Yekaterinburg, Asia/Tashkent, Antarctica/Mawson, Asia/Dushanbe, Asia/Qyzylorda, Asia/Samarkand, Etc/GMT-5, Asia/Oral, Indian/Kerguelen, Asia/Atyrau, Asia/Aqtau, Asia/Aqtobe, Indian/Maldives, Asia/Ashkhabad, Asia/Ashgabat
5.5 UTC+05:30 Timezone with a UTC offset of UTC+05:30 hours. Locations in this timezone include Asia/Calcutta, Asia/Colombo, Asia/Kolkata
5.75 UTC+05:45 Timezone with a UTC offset of UTC+05:45 hours. Locations in this timezone include Asia/Katmandu, Asia/Kathmandu
6 UTC+06:00 Timezone with a UTC offset of UTC+06:00 hours. Locations in this timezone include Indian/Chagos, Asia/Omsk, Asia/Qostanay, Asia/Urumqi, Asia/Kashgar, Asia/Thimphu, Asia/Thimbu, Etc/GMT-6, Asia/Dhaka, Asia/Dacca, Asia/Bishkek, Asia/Almaty, Antarctica/Vostok
6.5 UTC+06:30 Timezone with a UTC offset of UTC+06:30 hours. Locations in this timezone include Indian/Cocos, Asia/Rangoon, Asia/Yangon
7 UTC+07:00 Timezone with a UTC offset of UTC+07:00 hours. Locations in this timezone include Asia/Novokuznetsk, Indian/Christmas, Asia/Pontianak, Asia/Saigon, Antarctica/Davis, Asia/Ho_Chi_Minh, Asia/Tomsk, Asia/Phnom_Penh, Asia/Vientiane, Asia/Barnaul, Asia/Bangkok, Asia/Novosibirsk, Etc/GMT-7, Asia/Hovd, Asia/Jakarta, Asia/Krasnoyarsk
8 UTC+08:00 Timezone with a UTC offset of UTC+08:00 hours. Locations in this timezone include Hongkong, Asia/Taipei, Asia/Ulan_Bator, Asia/Ujung_Pandang, Asia/Ulaanbaatar, Asia/Harbin, Asia/Hong_Kong, Etc/GMT-8, Asia/Singapore, PRC, Asia/Manila, Asia/Makassar, Asia/Macau, Asia/Macao, Asia/Brunei, Asia/Choibalsan, Asia/Chongqing, Asia/Chungking, Asia/Kuching, Asia/Kuala_Lumpur, Asia/Shanghai, Australia/West, Asia/Irkutsk, Singapore, ROC, Australia/Perth
8.75 UTC+08:45 Timezone with a UTC offset of UTC+08:45 hours. Locations in this timezone include Australia/Eucla
9 UTC+09:00 Timezone with a UTC offset of UTC+09:00 hours. Locations in this timezone include Asia/Tokyo, Asia/Khandyga, ROK, Pacific/Palau, Asia/Pyongyang, Asia/Seoul, Asia/Jayapura, Asia/Yakutsk, Etc/GMT-9, Japan, Asia/Dili, Asia/Chita
9.5 UTC+09:30 Timezone with a UTC offset of UTC+09:30 hours. Locations in this timezone include Australia/Yancowinna, Australia/North, Australia/Broken_Hill, Australia/Adelaide, Australia/Darwin, Australia/South
10 UTC+10:00 Timezone with a UTC offset of UTC+10:00 hours. Locations in this timezone include Asia/Vladivostok, Pacific/Saipan, Pacific/Port_Moresby, Australia/Hobart, Australia/Melbourne, Pacific/Truk, Australia/Queensland, Australia/NSW, Australia/Sydney, Australia/Tasmania, Australia/Victoria, Etc/GMT-10, Antarctica/Macquarie, Antarctica/DumontDUrville, Pacific/Yap, Australia/Currie, Australia/Lindeman, Australia/ACT, Asia/Ust-Nera, Australia/Brisbane, Australia/Canberra, Pacific/Chuuk, Pacific/Guam
10.5 UTC+10:30 Timezone with a UTC offset of UTC+10:30 hours. Locations in this timezone include Australia/LHI, Australia/Lord_Howe
11 UTC+11:00 Timezone with a UTC offset of UTC+11:00 hours. Locations in this timezone include Antarctica/Casey, Pacific/Efate, Asia/Magadan, Etc/GMT-11, Asia/Sakhalin, Pacific/Guadalcanal, Pacific/Pohnpei, Asia/Srednekolymsk, Pacific/Noumea, Pacific/Norfolk, Pacific/Kosrae, Pacific/Ponape, Pacific/Bougainville
12 UTC+12:00 Timezone with a UTC offset of UTC+12:00 hours. Locations in this timezone include Etc/GMT-12, NZ, Kwajalein, Antarctica/McMurdo, Antarctica/South_Pole, Asia/Anadyr, Pacific/Auckland, Asia/Kamchatka, Pacific/Majuro, Pacific/Tarawa, Pacific/Nauru, Pacific/Kwajalein, Pacific/Fiji, Pacific/Wallis, Pacific/Wake, Pacific/Funafuti
12.75 UTC+12:45 Timezone with a UTC offset of UTC+12:45 hours. Locations in this timezone include Pacific/Chatham, NZ-CHAT
13 UTC+13:00 Timezone with a UTC offset of UTC+13:00 hours. Locations in this timezone include Pacific/Kanton, Pacific/Enderbury, Etc/GMT-13, Pacific/Tongatapu, Pacific/Apia, Pacific/Fakaofo
14 UTC+14:00 Timezone with a UTC offset of UTC+14:00 hours. Locations in this timezone include Pacific/Kiritimati, Etc/GMT-14

Reason

[your reasoning why the proposal resolves the issue]

joergklausen commented 3 years ago

Some entries from the .csv seem odd, e.g., 393, 394. Otherwise, the elements could be mapped as follows: notation = offset name = offset description = timezone I personally think, it is more relevant to know the offset (in hours), rather than the timezone. It is also more easily managed. The problem is that several timezones exist for the same offset, so they should be listed together (the offset needs to be unique).

amilan17 commented 3 years ago

https://en.wikipedia.org/wiki/List_of_UTC_time_offsets

amilan17 commented 3 years ago

@amilan17 - create branch may not be ready for FT22-1

jbianchi81 commented 2 years ago

The problem of using offset as notation is that it wouldn't take into account offset changes due to daylight saving nor historical changes of rules.

I suggest using the list of tz database. It is a collaborative compilation of information about time zones, taking into account offset changes. It uses the naming convention area/location, i.e. Asia/Kolkata. Area is the name of a continent or an ocean. Location may be a compound name, resulting in a 3-level name, as in America/Indiana/Indianapolis. Special area Etc is used for administrative zones.

There are numerous implementations of this database, including python libraries tzinfo and pytz. I also found that the library tzwhere may be used to assess if a given geographical location belongs to a specific timezone, i.e.:

import pytz
from tzwhere import tzwhere
tzwhere = tzwhere.tzwhere()

def is_within_timezone(lon,lat,tzid):
  if tzid not in pytz.all_timezones:
      raise ValueError('timezone not found in code list')

  timezone_str = tzwhere.tzNameAt(lat, lon)
  if timezone_str != tzid:
      raise ValueError('coordinates don\'t match timezone')

  return True
joergklausen commented 2 years ago

I have no issue with the use of the official IANA tz database as the source of a code list for WMDR, but I think the purpose of this code list is different in our case. We are not interested in mapping a time zone like 'Switzerland/Berne' to a UTC offset like '+1'. We are interested in documenting the UTC offset of a station itself. In particular, daylight saving time does not matter because all observations should be referenced against UTC. So, in my view, the codelist should indeed take the form I suggested earlier, perhaps with a slight adaptation, cf.

notation = offset name = UTC+offset description = Examples: list a few typical timezones

specifically, by way of examples

notation name description
-6 UTC-06:00 Timezone with a UTC offset of -06:00 hours. Locations in this timezone include America/Costa_Rica, America/New_York, Canada/Mountain, Mexico/BajaSur, Pacific/Galapagos
5.75 UTC+05:45 Timezone with a UTC offset of +05:45 hours. A location in this timezone is Asia/Kathmandu
9.5 UTC+09:30 Timezone with a UTC offset of +09:30 hours. Locations in this timezone include Australia/Adelaide, Australia/North, Australia/South, Australia/Darwin
jbianchi81 commented 2 years ago

Sounds good to me. Also the list will be shorter. It would be like this: https://en.wikipedia.org/wiki/List_of_UTC_time_offsets

joergklausen commented 2 years ago

@fstuerzl Do you think you could create this table and add it to the branch? The link in the Proposal doesn't seem to resolve to such a table.

jbianchi81 commented 2 years ago

@joergklausen @fstuerzl If you agree, I could generate the table with a script, update the Proposal and share the script

joergklausen commented 2 years ago

Discussion on the form of the notation: signed decimal number vs a more comprehensive form of UTC+hh:mm; to be discussed. @jbianchi81 Thanks for creating the branch

amilan17 commented 2 years ago

@jbianchi81 -- will you have time to update this branch before our next meeting? We'd like to have this ready for FT22-2 before the end of May.

jbianchi81 commented 2 years ago

@amilan17, @joergklausen : Proposal and branch updated.

amilan17 commented 2 years ago

https://github.com/wmo-im/wmds/wiki/2022-05-19-TT-WIGOSMD-22 notes:

jbianchi81 commented 2 years ago

@joergklausen -- ready for validation

amilan17 commented 2 years ago

@joergklausen @jbianchi81 - Is 4-08 an appropriate table ID for this type of table? Category 4 of the WIGOS Metadata Standard is for describing the geographical environment of the station. Furthermore, I think there are other places in the standard that might reference the TimeZone codelist (see https://github.com/wmo-im/wmdr/issues/23).

joergklausen commented 2 years ago

Table number could be 11-03 just as well.

amilan17 commented 2 years ago

https://github.com/wmo-im/wmds/wiki/2022-05-31-TT-WIGOSMD-23 notes:

@amilan17 update table number and move to ready for FT

amilan17 commented 2 years ago

ready for FT