Skrifennow

My blog, imported from Blogger and converted using Jekyll.

Greeting the user in Cornish for #speakcornish week

Jul 11, 2015

The events of #speakcornish week, an initiative of MAGA Kernow (The Cornish Language Partnership) along with other Cornish language organisations, have been taking place over the past week.

The way to greet someone in Cornish, depends on the time of day, with Myttin da for "Good morning", Dohajydh da for "Good afternoon" etc.

I have written a Python module to greet the user according to the time of day, at the console. It is available at my Bitbucket account or alternatively below:

# gorhemmyn_kw.py
# David Trethewey
# 11-07-2015
# skrifys rag #speakcornish week 2015
import time
class Gorhemmyn:
    # py termynyow a wra chanjya
    # furv an gorhemmynadow
    bora = 3
    myttin = 7
    dydh = 11
    dohajydh = 14
    gorthugher = 18
    nos = 23
    def __init__(self):
        t = time.localtime()
        our = t.tm_hour
        self.gorhemmyn = "Dydh da" # default
        if our >= Gorhemmyn.nos or our < Gorhemmyn.bora:
            self.gorhemmyn = "Nos da"
        if our >= Gorhemmyn.bora and our < Gorhemmyn.myttin:
            self.gorhemmyn = "Bora da"
        if our >= Gorhemmyn.myttin and our < Gorhemmyn.dydh:
            self.gorhemmyn = "Myttin da"
        if our >= Gorhemmyn.dydh and our < Gorhemmyn.dohajydh:
            self.gorhemmyn = "Dydh da"
        if our >= Gorhemmyn.dohajydh and our < Gorhemmyn.gorthugher:
            self.gorhemmyn = "Dohajydh da"
        if our >= Gorhemmyn.gorthugher and our < Gorhemmyn.nos:
            self.gorhemmyn = "Gorthugher da"

    def pryntya(self):
        print(self.gorhemmyn)

if __name__ == "__main__":
    g = Gorhemmyn()
    g.pryntya()

Ebrenn y'n Nos - mis-Gortheren 2015

Jun 30, 2015


Ottomma skrif a'n kynsa rann yn kevres a wrav vy gul rag Radyo An Gernewegva, a-dro dhe'n ebrenn y'n nos ha hwilans spas. An rekordyans o darlesys yn rann 229 o RAnG. Drog yw genev yth esa neb si yn keyndir an rekordyans, yth esa neb kaletter gans ow korrgowser dell dybav.

This is a transcript of the first part of a series I am doing for Radyo An Gernewegva about the night sky and space exploration. It was broadcast in episode 229 of RAnG.

Dydh da. Davydh Trethewey ov vy. My a vynn gul kevres nowydh yn Radyo an Gernewegva a wra dismygi dhywgh hwi pub mis a-dro dhe'n ebrenn nos. My a wra leverel pyth a yllowgh gweles yn ebrenn nos, ha nowodhow a-dhiworth an bys steronieth ha hwilans spas.

Yn mis-Gortheren an nosow yw berr. Yn Truru, dy' Kalann Gortheren, an howlsedhes yw 21:34, amser hav Predennek, ha'n howldrevel yw 05:14. Yma tri sort a mo (po twilight yn Sowsnek): mo sivil, mo morek, ha mo steroniethel. Yn dalleth mis-Gortheren, mo steroniethel a bes dres oll an nos, ha ny wra hi mos tewl yn ewn vyth oll. An nosow a hirha dres an mis, ha'n diweth an mis bydh an howldrevel 05:47 ha'n howlsedhes 21:06, hag y fydh tri our tewlder ewn ynter 23:45 ha 03:09. Mars os ta yn neb le arall yn-mes Kernow, hwi a yll kavos an termynyow ma diworth www.heavens-above.com

A-dhistowgh wosa an howl a sedh, hwi a yll gweles an planetys Gwener ha Yow y'n west. Yn gorthugher 30ves mis-Metheven, an dew blanetys a wra neshe y'n ebrenn, bys dhe tressa rann degre, le es braster gwelys an loor, kyn ny wrons i bos yn keth le yn spas.
Imaj: Gwiasva Astronomy Now
Gwener yw an splanna anedha, mes nyns yw possybl gweles travyth warnedhi awos an kommol oll a-dro dhedhi. Yn pellweler, yth yw hi gwelys avel gwarak gwynn. Drefenn hi dhe mos ynter an howl ha'n norvys 15ves mis-Est, hi a wra brashe, mes an gwarak a danowha. An moyha splannder dhe Wener yw nos 12ves mis-Gortheren. Gwener yw an splanna taklenn yn ebrenn nos, marnas an loor.


Yow yw gorherys yn kommol ynwedh, mes yn pellweler y hyll bos gwelys grogysow kommol warnodho, tewedh bras (An Namm Rudh Meur), ha peswar a'y loryow. Yow a wra mos anweladow yn skon, drefenn ev dhe mos bys dhe du arall an howl ha ni, ha ny wra ev bos gwelys y'n ebrenn nos. Ev a wra henna 26ves mis-Est ha wosa henna dasomdhiswedhes y'n ebrenn bora. An planet Meurth yw tu arall dhe'n howl ynwedh hag anweladow lemmyn.
Sadorn yw gweladow isel yn soth yn ranneves Libra, wosa hi a dewlhe. An bysowyer Sadorn yw gweladow yn pellweler, hag ynwedh loor Titan ha nebes an huni byghanna.
Y fydh an loor leun dhe'n 2a mis-Gortheren, kwartron diwettha an 8ves mis-Gortheren, loor nowydh an 16ves mis-Gortheren ha kynsa kwartron an 24ves mis-Gortheren. Y fydh an loor leun arta dhe'n 31ves mis Gortheren.
Yth esa diskwedhyans Golowys an Kledhbarth an 22a mis-Metheven. Ny wrons i gweles yn fenowgh diworth le mar soth avel Kernow, mes nebonan diworth Lanndreth a's gwelas ha miroryon erell a'n Ruvaneth Unys. Mirewgh orth an wiasva www.flickr.com/groups/aurorawatch/ po sywyewgh @aurorawatchuk war Twitter dhe kavos gwarnyans diskwedhans aurora.

Yma meur a nowodhow dhe vri a-dro dhe hwilans spas y'n mis ma.
An efanvos Rosetta diworth Asienteth Spas Europ a wrug drehedhes an komet Churyumov-Gerasimenko yn mis-Du diwettha, mes y direll Philae a wrug aslamma ha tira yn maner nag esa lowr a wolow howl dhe nerthhe hy panelys howl. Y hwre an komet na neshe an howl yn misyow diwettha, ha krefter an howl a dheth ha bos lowr dhe dhifuna an direll ha'y dannvonn sinell bys dhe'n resegvell ha'n norvys. Dell hevel y hwra bos possybl dhe'n direll gul an ober godhonieth a vynnons an godhoniethoryon y wul.
Philae. kevrenn

An efanvos “Gorwelyow Nowydh” (New Horizons) a wra neyja dres Pluton 14ves mis-Gortheren. An efanvos na o lonchys nans yw dewdhek blydhen, yn 2003, ha neyja dres planet Yow war y fordh dhe Bluton. Hag ev war y fordh, Pluton o dasklassys avel “planet korr” a-der “planet” wosa diskudhans taklennow erell yn grogys Kuiper kepar hag Eris hag erell. Ny wra an efanvos na mos yn resegva a-dro dhe Bluton, drefenn ev dhe neyja re uskis dhe hedhi. Kyn fia an dresneyjans termyn berr, y hwra iskargans an data pur lent, y hwra durya bys dhe martesen 18 mis wosa an dresneyjans dhe dhannvon an data dhe'n norvys, awos pellder meur dhe Bluton, ogas dhe 3 bilvil mildir. An negys "Goonhilly Earth Station Limited" a vynn usya an lestri radyo bras dhe Woonhelghya yn Kernow dhe geskommunya orth efanvosow ynterblanetek y'n termyn a dheu.
Godhonydhyon a wrug usya efanvos “Ekspress Gwener” (Venus Express) dhe diskudha yma loskvenydhow byw war Wener, dre weles nammow-poth yn is-rudh, hag y hwrussons i dyllo paper yn y gever seulabrys.
An efanvos Cassini re beu ow resegva a-dro dhe Sadorn wosa ev dh'y dhrehedhes yn 2003. Yma hwath imajys nowydh diworto a loryow Sadorn kepar ha Dione, loor a vraster kepar ha Pow Frynk, a wrug Cassini dresneyja 16ves mis-Metheven ha gweles kilnansow bras, ha Titan gans lynnow hidrokarbons warnodho.

Lynnow war enep Titan. kevrenn
























My a wayt bos an gewer da ha'n nosow kler y'n mis ow tos ha ni a yll gweles neppyth dhe les y'n ebrenn. Bys nessa prys.

A little more on the "omission error" for the woodland areas

Jun 30, 2015

To have a bit more of a look at the areas that are woodland in OS VectorMap and not classed as woodland in the classification, I here show where these areas are on the satellite images, and the classes that these areas are in fact assigned.

June 2006


Showing the areas indicated as woodland in OS VectorMap but not by the classification outlined in black, overlaid on the Landsat 7 image from 9th June 2006 (bands 5,4,3). large version

Showing the actual classifications the "omission error" areas were assigned. large version

March 2007


Showing the areas indicated as woodland in OS VectorMap but not by the classification outlined in black, overlaid on the Landsat 7 image from 24th March 2007 (bands 5,4,3). large version

Showing the actual classifications the "omission error" areas were assigned. larger version

September 2013

Showing the areas indicated as woodland in OS VectorMap but not by the classification outlined in black, overlaid on the Landsat 8 image from 24th September 2013 (bands 6,5,4). Some areas that display in pink here appear to be recently felled forest areas that have a weak reflectance in NIR (shown in green), but strong in SWIR1 (shown in red) with some reflectance in red (shown in the blue channel here). large version

Showing the actual classifications the "omission error" areas were assigned, and the 'cloud' areas. Some shaded areas are spuriously being classified as water. large version

Errors in the land cover assessment

Jun 28, 2015

Last time, I mentioned I was going to compare the ground control points to the classification.
Before I do that, I thought I'd compare the extents of classified woodland and water to OS VectorMap data.

I show the "commission error" - where the classification indicated something where OS VectorMap didn't, and "omission error" where OS VectorMap indicated something but the classification didn't.
Not all of the difference may be error in the classification, there may have been real change on the ground between the epoch of the image and the OS VectorMap data, or what is marked out as a woodland areas on VectorMap may include clearings, felled areas, or partially forested areas that were often classified as "Mosaic".

June 2006

RGB (9th June 2006)

NIR:SWIR1:Red 9th June 2006

 
large version There are a few areas of cloud shadow and other areas falsely classified as water. In addition there are some areas of cloud which may not be real. The woodland is generally underpredicted relative to OS VectorMap, the "omission error" areas are often classified as "Mosaic".

March 2007

 
RGB 24th March 2007
NIR:SWIR1:Red 24th March 2007

large version This is perhaps the most accurate of the woodland classifications, though some of the woodland areas are missed particularly in the east of the image (where perhaps cloud is interfering to some extent) and is often classified as "mosaic". There are a few areas of bogusly classified water in topographic shadow areas

 

September 2013

RGB (24th September 2013)
NIR:SWIR1:Red

large version Extensive areas of thin cloud appear in this image, woodland is overpredicted relative to OSVectorMap. It is likely that, late in the growing season, other vegetation has increased in NDVI and is perhaps masquerading as forest, or the subtle shadows of thin cloud are affecting the classification. Again some topographic shadowed areas are erroneously classed as water.
It is evident that the kind of first-order adjustment for seasonal change in NDVI etc. is not really adequate to prevent large shifts between classes, instead it is likely to be necessary to examine each landcover class in detail to see how its spectral properties change across the growing season.

Revisiting Land Cover assignment using Landsat

Jun 23, 2015

As part of one of the modules for my MSc in Remote Sensing and Planetary Science at Aberystwyth University, I did an assignment on land cover classification in Wales, using the LandSat satellites. I used data from Landsat 7 and Landsat 8.

The final maps from the assignment were somewhat basic, which I have revised below though I haven't changed the classification itself.

The classification scheme, was a rule-based one, where the rules were refined based on ground-control points taken using fieldwork.

I have put them into QGIS here, and added placename labels for context.

This is the first part of my revisiting this assignment. In future I will also say a little more about the ground control points from the fieldwork and how the results of the classification correspond to what was seen on the ground, and take this a little further than in the assignment report.
What would be really great, is to be able to automatically adjust a ruleset, rather than doing this by hand hard-coding into the scripts.


The Data

Landsat is a programme of Earth observation satellites launched by NASA and operated in cooperation with the US Geological Survey.

They have the capability to take data in several visible light bands, near infrared, short-wave infrared (this is longer wavelength than near-infrared but the common terminology in Earth Observation), and thermal infrared.

Landsat 8 has a slightly different range of wavelengths than Landsat 7, additionally having the 'Coastal' band in band 1 at a slightly shorter wavelength than the Blue band.

The area of study for the assignment was an area of mid-Wales including Aberystwth, and upland areas around Pumlumon.

We were set the images from Landsat 7 from March 2007 and June 2006 to work from, and I additionally used a Landsat 8 image from September 2013. Landsat 7 developer a scan line corrector fault. which resulted in black stripes where no data was collected.

The black no data stripes were ignored, in this classification, my view was to classify based on the data that exists, and perhaps use a nearest neighbour interpolation right at the end after classification if desired.

The various Landsat bands allow an overview of land cover types, based on the differing reflectance spectral properties of vegetation of various types, water, and non-vegetated surfaces. Living vegetation is strongly reflectant in the green and near-infrared, with dead vegetation reflecting more strongly at the longer 'short-wave infrared'.


A bank of cloud coincides with the area of study on 6th July 2013
Landsat 7: 9th June 2006, using Bands 3, 2 and 1 (red, green and blue) as RGB.

Landsat 7: 9th June 2006, using Bands 4, 6 and 3 (NIR, SWIR1 and red) as RGB.

Landsat 7: 24th March 2007, using bands 3, 2 and 1 (red, green, blue) as RGB.

Landsat 7: 24th March 2007, using bands 4, 6 and 3 (NIR, SWIR1, red) as RGB.
Landsat 8: 24th September 2013, bands 4, 3 and 2 (red, green, blue) as RGB.

Landsat 8: 24th September 2013, bands 5, 6 and 4 (NIR, SWIR1, red) as RGB.

Classification

A rule based classification was used, inspired broadly speaking by the various Richard Lucas et al. papers: Lucas et al. 2007 Lucas et al. 2011.

Before classification, I first segmented to objects, for which I used the routine in the Python RSGISLib libraries:
The 9th June 2006 image, segmented in RSGISLib using the runShepherdSegmentation method with 120 clusters and a minimum object size of 9 pixels (8100 sq.m), colourized randomly.
In fact I segmented the image three different ways, in the assignment writeup I exclusively used the objects from segmenting the 24th March 2007 Landsat 7 image.
I made a kind of first order seasonal adjustment to the images, based on band averages in areas not classified as cloud or water. It was not entirely successful in creating a consistent classification as seen below.

Ruleset

The ruleset I first developed on the March 2007 image because that had areas of cloud and therefore an opportunity to get the cloud masking right first.
There are three stages to the process, first the Level 1A classification that delineates water (by low NIR and SWIR brightness), cloud (by high levels in the blue band), shadow (by thresholds in Blue, NIR, and SWIR1), and non-vegatation (by normalised differential vegatation index (NIR, R)).



After this, in Level 1 split the vegetated areas into woodland, wetland, and heath, and grasslands into unimproved, semi-improved and improved by NDVI.


Level 2 classification splits woodland into broadleaf and coniferous, and wetlands into blanket bog and flush, and the upland vegetation further.
For the other images, I made a first-order seasonal adjustment based on the average band values in non-water and non-cloud objects, effectively attempting to adjust back to the March image. I adjust the NDVI by half of its actual change to avoid overcorrection of the grassland classes, and the Lucas et al. 2011 heath detection index by a manually set value of +3000 in June and +5000 in September.

24th March 2007 segmentation

This was what I used in my report. There is a substantial area under cloud in the SE of the image. I have masked out areas that have No Data in one or both images.
The cloud areas are shown in the SE, generally woodland and water extents are well-recovered. large version
Unfortunately some detail is lost in the uplands, and some areas are spuriously classified as non-vegetated. large version

Modification of the cloud threshold was needed to mask out the extensive areas of thin cloud covering parts of the image. Some spurious water bodies are shown which are in face topographic shadow misclassified as water. large version


6th June 2006 segmentation

 
Again, the summer image does not differentiate the different type of upland vegetation well. The cloud shadow on Borth Bog is misclassified as water. large version

The summer 2006 image is segmented and the spring 2007 data applied, there are some spurious classifications in the cloud shadow areas. large version

The September 2013 data, again showing some spurious areas of water, and some errors around the margins of cloud. large version

24th September 2013 segmentation

I only present the 24th September 2013 data, for this segmentation, due to problems that would be caused by the Landsat 7 no data stripes.

Using the Landsat 8 image for segmentation avoids the stripes of no data, but delimiting the edges of thin cloud is difficult and may result in spurious classifications around the edges. The upland vegetation is not well delineated, with large areas assigned to 'unimproved grassland' or 'Molinia-dominated upland grassland'. large version

All Posts