Skip to content

Conversation

@PaulWessel
Copy link
Member

When building a categorical CPT for months or weekdays, we can now have GMT supply those labels based on current default settings for time and language by using +cM or +cD, respectively. Available in makecpt and grd2cpt. Closes #5189 and we may merge into master after 6.2.0 release.

Examples of use:

gmt makecpt -Crainbow -T1/12/1 -F+cM

1	201.88/0/255	L	;January
2	95.625/0/255	L	;February
3	0/10.625/255	L	;March
4	0/116.88/255	L	;April
5	0/223.12/255	L	;May
6	0/255/180.63	L	;June
7	0/255/74.375	L	;July
8	31.875/255/0	L	;August
9	138.12/255/0	L	;September
10	244.37/255/0	L	;October
11	255/159.38/0	L	;November
12	255/53.125/0	B	;December
N	128

gmt makecpt -Crainbow -T1/7/1 -F+cD --FORMAT_TIME_PRIMARY_MAP=Abbrev --GMT_LANGUAGE=es

1	163.93/0/255	L	;LUN
2	0/18.214/255	L	;MAR
3	0/200.36/255	L	;MIE
4	0/255/127.5	L	;JUE
5	54.643/255/0	L	;VIE
6	236.79/255/0	L	;SAB
7	255/91.071/0	B	;DGO
N	128

For days we also check the setting of TIME_WEEK_START.

When building a categorical CPT for months or weekdays, we can now have GMT supply those labels based on current default settings for time and language.
Closes #5189 and merge after 6.2.0 release.
@PaulWessel PaulWessel added the new feature PR that implements a new feature or capability in GMT label May 8, 2021
@PaulWessel PaulWessel added this to the Future release milestone May 8, 2021
@PaulWessel PaulWessel self-assigned this May 8, 2021
@Esteban82
Copy link
Member

Esteban82 commented May 8, 2021

It works.

BTW, the abbreviated form of Sunday in Spanish (DGO) is based on an ISO norm or something like that? Because for me the correct form is "DOM".

@PaulWessel
Copy link
Member Author

Not sure where the DGO came from. Some googling cannot confirm that but I find DOM. So perhaps open a bug report on this, @Esteban82 ?

@Esteban82
Copy link
Member

So perhaps open a bug report on this, @Esteban82 ?

Ok, or maybe I can create a PR to modifie this file, right?
https://github.com/GenericMappingTools/gmt/blob/32296e512b173cfdd2c3e8da1d2735e49b79f02a/share/localization/gmt_es.locale

@PaulWessel
Copy link
Member Author

Yep, that is fine.

Esteban82 added a commit that referenced this pull request May 9, 2021
Change dgo to dom. See discussion in #5201.
@Esteban82 Esteban82 mentioned this pull request May 18, 2021
@PaulWessel PaulWessel changed the title WIP Add suitable shorthands for creating month and day labels Add suitable shorthands for creating month and day labels Jun 6, 2021
@PaulWessel PaulWessel merged commit 60c5474 into master Jun 6, 2021
@PaulWessel PaulWessel deleted the auto-cat-labels branch June 6, 2021 00:37
@maxrjones maxrjones added new core module feature PR that implements a new core module feature add-changelog Add PR to the changelog labels Jun 8, 2021
@seisman seisman removed this from the Future release milestone Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add-changelog Add PR to the changelog new core module feature PR that implements a new core module feature new feature PR that implements a new feature or capability in GMT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically create month labels for CPT

5 participants