Skrifennow

My blog, imported from Blogger and converted using Jekyll.

Computer troubles and further updates to TaklowKernewek tools

Jun 4, 2017

My desktop computer is currently incapacitated, it has for the past day and a half been resizing a NTFS partition after I made the decision, after breaking my QGIS installation while attempting to upgrade it to 2.18, to go back to a dual-boot system rather than a Windows virtual machine running in Ubuntu. Meanwhile I had also broken my netbook because it crashed while trying to upgrade to Ubuntu 17.04. I fixed this by doing a reinstall from a bootable USB stick using the UbuntuMATE iso, formatting only the root partition leaving data in /home intact.

This shouldn't deter anyone from using QGIS, or Ubuntu, just that I was doing odd things with GDAL and kealib, making myself able to use multiband .kea files  in QGIS running with the system environment variables, but use conda to run RSGISLib in Python 3, and also conda to run the European Space Agency's SNAP toolbox to process Sentinel 2 images.
There was a resulting mismatch between different versions of GDAL which caused problems when I tried to update to QGIS 2.18, which failed due to conflicting dependencies, and then trying to revert to 2.14 also failed, so therefore QGIS no longer worked at all.
With my netbook, I had installed so much on it that the root partition was close to full and I think that was what started causing problems.

Fortunately all data is backed up on external drives.

However it is not so easy to do much mapping work on my netbook, although I do now have QGIS 2.18 installed on it, but I have done a bit more on TaklowKernewek, including making the netbook mode work for more of the apps, and developing the mathematics quiz app.

The netbook modes were modified to allow the corpus statistics app, and a couple of others to fit the screen of my netbook (EeePC 1005HA), by adjusting font sizes as well as some input/output box heights.
Inflecting the verb 'covhe' (in SWF Tradycyonal) - Cornish for 'remember'



Inflecting the verb 'covhe' (in SWF Tradycyonal) - Cornish for 'remember'


Basic translation memory using Skeul an Yeth 1 example sentences. The font size of three of the four buttons has been shrunk a little so that labels do not grow bigger than the box itself.

more of the output

some further output of the translation memory


word frequency table for words of 5 or more letters in 'Origo Mundi'. The font sizes are quite small to read to make sure that the boxes do not fall off the bottom of the screen.
The word frequency bar chart has been tweaked as to not use white as a colour, since matplotlib may not always outline the bars.

counting syllables


Transliterating from Kernewek Kemmyn to Standard Written Form. It is possible that goelann should instead go to goolan in SWF, it certainly did in 2008 SWF, and may still do so despite being a multisyllable word.

Mathematics Quiz app

A new difficulty level allow input numbers up to 100, and the GUI has been adjusted to work better on smaller screens (though further work on this may be needed).
The options radio buttons have been consolidated into one column in the GUI

The program now reports back the answer to the previous question that you gave if you were correct as well as if you were wrong. This still looks a little confusing since the question now in the upper box is the second question whereas the answer is for the first. If you get a question right, you get 1 point. The bonus for speed has been reduced compared to earlier versions, to get any speed bonus at all you need to answer within 10 seconds.

'Pur gales' allows the computer to choose numbers up to 100, in this version the addition and subtraction are shown as symbols, due to possible confusion with 'ha' internal to the number such as 'dew ha dew ugens' (42). 'tri ha dew ugens marnas dew ha dew ugens' might be interpreted as 43 - 2 + 40 = 81 rather than 43 - 42 = 1.

There is a need to make some further adjustments to the Tkinter GUI code since at present the widgets aren't filling the window after it is maximized.

Updating Mars 'Top Trumps' webpages

May 28, 2017

I have previously created a website for Souness Glacier Top Trumps, based on Colin Souness' work on candidate mid-latitude glaciers on Mars, and my MSc thesis on them.

One of the things covered is whether the object has coverage with the High Resolution Imaging Science Experiment on Mars Reconnaisance Orbiter.

The HiRISE team are continually releasing new images as the Mars Reconnaisance Orbiter is still operating.

I have some horribly obsfucated Python code that can match the shapefile coverage of the Souness objects, to coverage footprint shapefiles, after using QGIS to reproject to a common coordinate system.

I have recently updated my Top Trumps webpages to use shapefiles up to 4th May 2017.

However, the Mars Express tiles remain the same, since the data releases of High-Resolution Stereo Camera process to level 4 (including the derived digital terrain model) are available at NASA Planetary Data System only up to orbits up to 12th Feb 2009.

There do appear to be newer ones recently uploaded at the Freie Universität Berlin website, although they are not in the same format as the ones I used from NASA PDS and they are not in the European Space Agency Planetary Science Archive or NASA PDS yet.

The website currently says:

Archive status (highest released orbit): f836 (levels 2 & 3, PSA), 6567 (level 4, PSA), d795 (level 4 VICAR, HRSCview)

To incorporate these would require a more comprehensive reanalysis of the data, since some more Souness objects would gain digital terrain model coverage and some would gain improved resolution coverage.

An example Souness object which now has links to additional HiRISE footprints from the University of Arizona HiRISE webpage.
I also fix a bug whereby if HiRISE covered all of the bounding box of the 'context' of a Souness object, the png overlay for the HiRISE coverage would show only transparency, due to the way in which ImageMagick was used to colourise the rasterised shapefile.

The convert command was modified from
convert {i} +level-colors black,yellow {o}
to
convert {i} +level-colors ,yellow {o}

so that in the input file,  the value 255 is taken only as the white point, not as both black and white which produced a blank image containing only transparency.

e.g. Souness 83

Souness 83, where the bounding box is wholly covered by the footprint of the HiRISE image PSP_010345_2150.



Bilingual interface to Cornish Corpus Statistics Python GUI application and switching between Kemmyn and manuscript spelling

May 6, 2017

As part of my taklow-kernewek tools, I created an application that can do some corpus statistics on Cornish texts, and is configurable at run-time to a certain extent.

I have made a few improvements to the files cornish_corpus.py and corpus_wordfreqGUI.py, which include a bilingual interface, and ability to switch between using Kernewek Kemmyn and manuscript spelling (or at least a reading of such).

To create a switchable bilingual interface, I overhauled the GUI code to make it more object orientated, and created a set of dictionaries where the keys each refer to another dictionary with 2 elements {'en': 'English text', 'kw': 'Cornish text'}.

A button in the GUI then runs a function that changes the interface language, and alters the text in all of the relevant widgets to use that in the new language.

It can also be specified when running corpus_wordfreqGUI.py, at the command line as the -e switch which will launch with English interface.

English interface. The button at the lower left allows switching betweeen the two.

Cornish interface
I have also fixed a bug that happened when there were no words longer than the specified number of letters, and the list of word frequencies is generated. Internally, what happens inside cornish_corpus.py is that the length of the longest word is found, so that the output text is spaced appropriately. Now it checks whether there is an empty list of tuples of (word, frequency) to avoid an indexing error.

The other thing I have done is fix a bug when the manuscript spelling was selected (previously only via command line -m switch, but now also in the GUI, as below). There is a different list of texts available in manuscript vs. Kemmyn, which had previously caused the program to have an index error in some cases.

Unfortunately I still have an issue with TkInter, since when switching between Kemmyn <--> manuscript there is an extra empty space generated, which needs a bit of adjustment to how the widgets pack etc. I got a bit confused when trying to fix it so am leaving it in for now.
Kemmyn (top left) and manuscript (bottom right). These windows have been launched direct from the command line, with the manuscript one launched by "corpus_wordfreqGUI.py -m" to choose the manuscript spelling texts rather than Kemmyn.

Annoying issue with space at the left appearing after switching within the GUI to manuscript spelling.

Update 07/05/17 - Tkinter bug fixed

After spending a while looking at my copy of Programming Python I found the pack_forget() method, which I used to remove the buttons at the lower left (language and manuscript mode switch) while the text choice list is repopulated with new radio buttons, and then the buttons are repacked afterwards.
I also show in the heading above the list texts which mode the program is in.

In Kemmyn mode, showing the most frequent words of at least 5 letters in Passyon agan Arloedh

In manuscript spelling

Mathematics quiz in Cornish with some improvements

May 4, 2017

I have made some improvements to the mathematics quiz apposyans_awrgrymGUI.py in my taklow-kernewek tools.

There is now a facility to set a difficulty level, either easy where numbers are always 1-10 and negative answers are suppressed, medium allowing numbers up to 20 and hard allowing numbers up to 40.
The program asks what 10 + 32 is, the answer of course is 42.

The user has answered the question 19 - 33 incorrectly as -4. The program has repeated the previous question in text and figures along with its answer.

The report at the end shows how many questions were answered correctly, and what the points score was. I may well revise the way this calculated since at present it can reward speed more than accuracy (1 point is given for each correct answer and 10-t for speed where t is the number of seconds taken to answer, up to 10 seconds).




Mathematics Quiz in Cornish

May 3, 2017

One of the things I discussed in my talk last year at the Skians conference as possible future developments in software for Cornish is tools or games for learners.

In a first step in that direction, I have programmed a mathematics quiz which asks twenty questions of addition or subtraction, in a Python Tkinter GUI app (or at the command line), to help users practice recognising Cornish numbers.

After entering a number in the box, click on "Profya Gorthyp" or press Enter to submit the answer.

The computer checks the answer for correctness, then shows the time taken for you to submit it, number correct out of questions answered so far, and the total points. One point is awarded for a correct answer, and extra points for speed.

After 16 questions answered, 14 were correctly answered, and total points is 75.4

The end of the quiz after 20 questions.
The code is at my taklow-kernewek repository at Bitbucket. I will likely add a little more to it, including perhaps some different difficulty levels, and maybe some multiplication or division at some point.

All Posts