Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inconsitency adding lat labelling on the right (on graticules)... #26

Closed
peters77 opened this issue Apr 24, 2019 · 5 comments · Fixed by #33
Closed

inconsitency adding lat labelling on the right (on graticules)... #26

peters77 opened this issue Apr 24, 2019 · 5 comments · Fixed by #33
Assignees
Labels

Comments

@peters77
Copy link

Code Sample, a minimal, complete, and verifiable piece of code

# Your code here
font=aggdraw.Font('yellow','/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf', opacity = 200, size=30)
areaid = 'eurol'
#areaid = 'germ'
lscn = scn.resample(areaid, radius_of_influence=10000)

lscn.save_dataset(composite, imgdir + '/Metop-A.jpg',
                          overlay={'coast_dir': '/satpy/coastlines/', 'color': (255, 255, 0), 'width': 1.0, 'resolution': 'i',
                          'grid': {'major_lonlat': (10, 10), 'minor_lonlat':(2, 2),'font': font,
                          'write_text': True,
                          'outline': (224, 224, 0), 'outline_opacity': 175,
                          'width': 1.0, 'minor_width':0.5, 'minor_outline_opacity': 175, 'minor_is_tick': False, 'lon_placement':'tb', 'lat_placement': 'lr'}}, fill_value=0)

Problem description

There seems to be some strange inconsitency adding lon/lat labeling in satpy.
If I try to place the labeling with
'lon_placement':'tb', 'lat_placement': 'lr'
and area = eurol
Pic1-Metop-A-1

the '20N' lable is missing on the lower right corner

If I set e.g.
area = germ

the lat label '50N' is missing on the right. I can't get a labeling on the right (pic2)
I even tried to set ''lat_placement': 'lr' " or 'lat_placement': 'r'. But no labeling on the right.

Pic2-Metop-A

Another example, 40N, 50N and 60N missing, 'lat_placement': 'lr'

Noaa_20-Orbit_7372-NightTime-20190422-M15-omerc_bb

Versions of Python, package at hand and relevant dependencies

satpy-0.14.1
pycoast-1.2.2
Python 3.6

@mraspaud
Copy link
Member

mraspaud commented Oct 9, 2019

I think this mail from Ernst is related:
Here is the diff of cw_base.py distributed
with current pycoast 1.2.3 (<) and my corrected version (>).

102c102
<         offset by margins and returns an array of coordintes"""
---
>         offset by margins and returns an array of coordinates"""
123c123
<         ylim2 = y_size - margins[0]
---
>         ylim2 = y_size - margins[1]
129c129
<         # loop trought line steps and detect crossings
---
>         # loop trough line steps and detect crossings
237c237
<         # posituion text labels near edges of image...
---
>         # position text labels near edges of image...
256c256
<         lin_lons = np.arange(lon_min, lon_max + Dlon / 5.0, Dlon / 10.0)
---
>         lin_lons = np.arange(lon_min, lon_max + Dlon / 5.0, Dlon / 100.0)
303c303
<                                       Dlon / 50.0)
---
>                                       Dlon / 500.0)
359c359
<                                       Dlat / 50.0)
---
>                                       Dlat / 500.0)

@djhoese
Copy link
Member

djhoese commented Oct 9, 2019

So we need to test that code out is what you're saying?

@mraspaud
Copy link
Member

mraspaud commented Oct 9, 2019

If we don't get a PR from Ernst, then yes...

@peters77
Copy link
Author

peters77 commented Oct 9, 2019

I can test it if martin patch the code and there is a branch to install?

mraspaud pushed a commit to mraspaud/pycoast that referenced this issue Oct 11, 2019
Issue pytroll#26

Signed-off-by: Martin Raspaud <martin.raspaud@smhi.se>
@mraspaud mraspaud mentioned this issue Oct 11, 2019
4 tasks
@mraspaud
Copy link
Member

@peters77 I applied the patch in #33, feel free to test

mraspaud added a commit that referenced this issue Oct 25, 2019
@mraspaud mraspaud self-assigned this Oct 25, 2019
@mraspaud mraspaud added the bug label Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants