Thursday 23 December 2010

Semi-dead project

The project was semi-dead for about one and a half month, due to so called ordinary life. So called ordinary life irritates us, but the project was only semi-dead, which automatically implies zombielike. The revisions r98 and r99 where ueber-silently released, both of them designing some data structures to be constructed after the parsing of the map program. The program parse_program parses the program and constructs a program prototype. Nevertheless I'm considering yet another program redesign, that makes some assumption on the so called graphical layers: given a "fixed" sky layer (or for that part a "fixed" globe layer on any planet), there could be a conceptually different viewing window layer that applies filters on any fixed surface layer,
  1. a selection, for example stars brighter than 5.5, galaxies brighter than 9.5,
  2. a projection, for example lambert conic, simple conic, cylindric
  3. an orientation, centering α₀, α₁, δ₀, δ₁, image rotation ν and some such...

Tuesday 16 November 2010

Sexagesimal handling – R97

At last some real programming (again), although frustratingly slow (revision 97). In general I wish everything accomplished immediatelly!! I enabled some correct sexagesimal constant scanning allowing mkmap map programs to specify float constants as sexagesimals, f.ex.:
  • 23ʰ12ᵐ03.14ˢ (a right ascension)
  • 23ʰ12.17ᵐ (another)
  • 48°34'16.07" (a declination without a sign)
  • 33° (another)
The acceptable sequence of the sexagesimal markers are ʰᵐˢ, ʰᵐ, ʰ, °'", °' and °. All other sexagesimal marker sequences within a floating point literal constant are illegal. The code is also prepared for hexadecimal and octal constants, but correct scanning of those are not yet implemented.

CAVEAT 1: The scanner doesn't create a floating point value from the scanned token – that's up to the parser. A token "method" for creating a floating point value is to be added in the future.

CAVEAT 2: The scanner is not screaming (fprintf stderr) from the occurrence of erroneous sexagesimal tokens, the screaming philosophy is not yet determined.

Revision documentation

Added clarifying revision documentation from R1 to R51 and some general comments from R86 to the current R97. The point is that I'm successively learning some complex options of svn and the facilities (and lack thereof) of googlecode. The following pretty complex svn command generates a diff overview:
# svn diff --diff-cmd /usr/bin/diff -x '--brief'
In "the best of worlds" the syntax would instead have been
# svn diff --brief
or
# svn diff -B

Friday 8 October 2010

Project mgmt on google code?

Q: Project mgmt on google code?
A: Not likely!

Actually, I examined the facilities on google code a while ago, added a few issues and deleted them again as experimental evaluations. My immediate reaction was that I could find no life cycle stages of a certain module – a module could attain any of the following intellectual stages:
  • vapor: imagined, probably needed or possibly not, no implementation nor any evaluation supporting nor opposing the creation of the module,
  • rejected: the module development is stopped at any of the pre-gamma stages, and stowed away for trackability and a possible future reevaluation, 1)
  • evaluated vapor: text, design and evaluations describing and underbuilding the creation of a module
  • experimental: a code that implements some important aspect of a module, used for demonstration for further evaluation and a code base for the future module
  • alpha: the module is implemented but unstable,
  • beta: the module is pretty stable, but not systematically bug-tested
  • gamma: stable and systematically bug-tested
  • gamma-old: gamma but considered for replacement: replacement documentation exists
  • delta: actively being replaced
These life cycle states are 'home hack' adapted, a test-based development enviroment should have a different set of stages: fulfilling this or that many test cases.

Whether google code usage can be adapted to an arbitrary life cycle management of individual modules is as yet undecided, but it is an infinitely important question for any opensource project.

1) Extreme programmers and other modern project management use to dislike stowing away things for later reevaluation, but this is just an oversensitivity and disability to evaluate and correct oneself from own thought errors. The key points that makes stowing away problematic is keeping a database and any system of competition-by-blame.

Tuesday 5 October 2010

R91 (R92, R93): one huge jump

Pretty abstinential from the last weeks administrative low effective time consuming tasks of mine (current Swedish ineffective unemployment system), followed by quite logical and notable failures, my programming/construction deficit resulted in me boldly splitting off all scanning/parsing functions to the separate modules parse.[ch], in order to experiment freely with the parsing. Intending to program as intensely as possible to make a programming system for map generation (see prev post), the revision R91 differs very much from R90. Foremost two files that were embarassingly missing, token.[ch] were finally added. Checking out the source without those two files wouldn't have worked! :-( Stupid and sloppy of me. Also the reworked syntax is in maps/ori-mon.mkm, which was however forgotten in R91 but came in R92 (also see prev post). The test program parse_program.c was created for testing the new parsing language. When mature it shall also generate and test-print a data structure constituting the map language program loaded.

Some history examination of the repository revealed that I renamed scan.[ch] in the code while not doing it properly in svn. So while a smart programmer might have been able to deal with the missing code by reading and analyzing, some intermediate versions of scan/token.[ch] are missing. Fixed now – I think.

A sample program

The following code is very preliminary, but exhibits the principle of map creation, that I've chosen. The stream system that I spoke of previously is not the primary way to organize the drawing of images. Instead a human map drawer reasons with various layers and objects to draw in those layers. The layers have an order: the first drawn first, then next one – possibly overwriting features in the previous layers – and so on till all layers are drawn. In map making most objects are coordinate transformed zero times or more, and finally the object is projected onto a flat surface, i.e. "the paper". When a label is attached to an object, (f.ex. the string "Sirius" to the star Sirius) it is not transformed/projected quite the same way: a label should be placed near the object that it labels, but "upright" from the perspective of the image spectator, so that the spectator needn't put the head on one side: the label has to take the paper position of the object and add a little offset so as to be written near but not on the object it refers to.

The programming system, and the code below, is not finally defined: it needs some fixes to become logical, and to reflect the stream system that I've speculated about earlier, but at last I got an idea of how to code maps in a generic way. The long term intention is of course not just star maps, but any map. The details of how to store databases in files and how they're loaded and processed is of course a remaining topic: I'm inclined towards relation algebras rather than the clumsy SQL thinking, but this is a matter of syntax, not semantics, since a well designed relation algebra should be mapable to SQL statements.
orion() {
    ## procedure for the heavenly hunter 
    border    += load “ori_b.db”;
    labels    += [pos: [x: middle, y: bottom], 
                  string: "Orion",
                  justify: middle];
    projection [type: Lambert_conic, α: 5ʰ20ᵐ, δ: 10°, Δδ: 10°];
    frame [height: 500px, width: 500px];
}
monoceros() {
    ## procedure for the heavenly unicorn
    border    += load "mon_b.db";
    labels    += [pos: [x: middle, y: bottom], 
                  string: "Monoceros",
                  justify: middle];
    projection [type: Lambert_conic, α: 7ʰ10ᵐ, δ: 10°, Δδ: 10°];
    frame [height: 500px, width: 600px];
}
main() {
    
    ## ‘layer’ declares the layers wherein the program puts
    ## objects, when executing an ‘out’ all layers are drawn
    ## with stored objects one by one, background first, then
    ## border, aso. to at last map_labels. What layers that
    ## are to be used, is up to the programmer and the naming 
    ## is free by programmer choice:

    layer background(noproj); # background: no projections, 
                              #             just one frame
    layer border;             # border:     given in αδ* as
                              #             a loop → coorsys
                              #             change, projection,
                              #             frame
    layer grid;               # grid:       given in αδ* as
                              #             lines → coorsys 
                              #             change, projection, 
                              #             frame
    layer nebulae;            # nebulae:    given in αδ → 
                              #             coorsys change, 
                              #             projection, frame
    layer stars;              # stars:      given in αδ →
                              #             coorsys change, 
                              #             projection, frame
    layer labels(noproj);     # labels:     given in αδ →
                              #             x₀y₀ + xy offset ???
                              #             (MANUALLY!)


    background += infinite [color: [r: x00, g: x00, b: x40]];
    grid       += grid [α: 1ʰ, δ: 10°];
    stars      += load "stars.db";
    labels     += align stars "stardesg.db";
    nebulae    += load "nebulae.db";
    labels     += align nebulae "nebdesg.db";
    { # a stacklike block for loading local data
        orion; # run procedure ‘orion’
        out "orion.svg";
    }
    {
        monoceros; # run procedure ‘monoceros’
        out "monoceros.svg";
    }
}
Further notes on the layers: layer border is for constellation borders, layer labels is for star and galaxy labels, and are intended for manually copying positions from the star and galaxy layers, then adding an offset to place the star and galaxy labels at proper positions: not colliding with each other, not overlapping the labelled object.

Thursday 23 September 2010

n-body links

Added links to n-body solution information on algorithms and formulae part of astro and s/w links.

Saturday 18 September 2010

wstring vs. ustring

The problem with Windows cygwin gcc using 16 bits' strings instead of the hard coded 32 that I use is solved in the only way possible within C.

The problem is about the following: I rely on wide characters being signed, irrespective of what the local C implementation uses for wide characters. As a means to (in future) allow Unicode upper plane code points1) I also implement wide characters with signed integers (assuming them to use 4 byte). The normal wcs string functions – f.ex. the comparison wcscmp instead of strcmp for old narrow characters – varies according to implementation, so I provide my own counterparts in ucstr.h. They're not complete, but they work for my purposes, including others that aren't on the web.

Fine, so far – but since cygwin use 16 bits internally for wide chars, the wide string literals, f.ex. L"ψ⁶ Aur" 2) won't work for my personal 32 bits wide chars. Therefore I have to replace them with uchar array declarations like
   uchar _L_psi_e6_Aur[] = {L'ψ',L'⁶',L' ',L'A',L'u',L'r',0}.
and replacing all occurrences of L"ψ⁶ Aur" with _L_psi_e6_Aur. It's not beautiful, but it's the only way to make the code portable.


1)ponder f.ex. using a Mesopotamian Cuneiform glyph here, which is realistic, since there was Cuneiform star catalogues, f.ex. MUL.APIN, then such a Cuneiform glyph is implemented in plane 1 of Unicode, which needs 21 bits, which is so odd that 32 bits is provided by integer is the best match,
2)a star in the eastern Auriga, formerly Telescopium Herscheli

A crucial question: why not use another programming language than C. Yes, why not, but the languages not to use for this kind of application are Java and C# (and all .NET languages), because they require loading of a heavy virtual machine that are not used for the conversion process. Other not-to-use-for-this languages are JavaScript and PHP, because of their web oriented implementations. Relevant languages are Python and C++. The current implementation will stick to C because of lib spinoffs that can be used in implementation of programming language experiments of mine – C++ won't do for parallel programming – until a full set of star maps can be generated: nothing is impossible in C, but many solutions require ugly-like-h*ck code.

Saturday 11 September 2010

Streaming theory – r87

Revision 87 just adds a few notes on the streaming theory I'm pondering to implement. The principle is creating stream filters and cascading star data in pipes of one stream filter after another. The theory should be analogous to the pipe streams of Unix, except the filters are not normally written in a Unix shell, even thought that is possible. Instead of using PP3:s simple state setup and having a fixed few steps cascade (1. set "parameters", i.e. any generation constants, 2. delete and add objects, 3. "compute and draw"), the filters and the pipe streams shall be configurable in the intended programming language of mkmap.

Saturday 4 September 2010

Star name raid

I did a star name raid in Wikipedia yesterday, removing fake star names such as "Biceps" for γ Her, or "Melqart, Melkarth" for μ Her.

Thursday 2 September 2010

PP3 images in SVG

The original PNG files produced from PP3 seems to be disused on English Wikipedia. One glorious guy named User:Kxx seems to have converted the images to SVG, he applies an unknown extra script or program to the TeX (?) code produced by PP3. The method is however undocumented – no deal – the maps should be replaced anyways.

Wednesday 1 September 2010

Orion

I just observed that there was no sample on this blog, only on the Swedish language blog Haccationes. So here yet another sample for this blog. The constellation Orion, the upper one generated by mkmap (2010-09-01), the lower one the SVG version (PP3 generated) residing on Wikimedia Commons.

mkmap currently generates a map in the Lambert Conformal Conic Projection, which is very popular on orientation maps (especially military maps) covering a small area because an angle is the same as in reality, and a distance on the map is nearly the same scale irrespective of direction where measured. This is a pretty good quality for star maps too, unless a major part of the sky is to be depicted by the image.

The Wikimedia image, besides being more mature and differently colored, has one great disadvantage from mkmap: only the bright star constitute a realistic picture as seen in the night, and when observing fainter stars, one cannot recognize star patterns from that map. This is because the Wikimedia map doesn't draw stars with a radius according to the apparent magnitude, instead it first sorts the star into one of the magnitude categories -1, 0, 1, 2, 3, 4, 5 and possibly 6, then draws all stars with a certain magnitude with one radius only. So the Wikimedia map simply cannot be used for astronomical observations because the astronomer won't be able to recognize the star patterns in the sky based on that star map.

Revision 82 to 84

Preparations for stricter and error detecting parse: the token shall contain info about line number in source code where scanned, functions for strict token detection added in mkmap.c.

Saturday 28 August 2010

R77 — R81

At last a revision that adds an embryonic usage of the mkm "program" as sketched on the mkmap "hack plan". Also a few updating and moving-around revisions supporting r77. (I began to despair for all documenting work of my ordinary life).

+Linx II

A few more astronomical links added: CDS archive database (CDSARC) at University in Strasbourg, a spectral types link to ESO, and a link to PostgreSQL.

Tuesday 17 August 2010

AVM ≠ Web 2.0?

AVM is a metadata format to put in images allowing such metadata, for example JPEG, TIFF and PNG. It's then just a regime to add astronomically relevant metadata to such an image. The scope is infinitelly smaller than True Web 2.0 which requires a partially new Web representing editors, widgets, gadgets and an inbuilt self-parsing facility similar to XSLT. A real bummer so far...

Monday 16 August 2010

Parsing

The mkmap program parsing is now half way implemented (r74): instead of trying to make the usual recursive descent parser I made a so called shallow parse meaning that only the superficial structure of the document is currently parsed (incorrectly) such as { } pairs, but in the functions intended for the exact future descent parse. I've formerly considered the technique of shallow parsing for a macro-style scan of C, fantasizing to add an object orientation system intermediate between C++ and Objective-C, doing away with the sick C++ virtual tables and the static methods as a default, while the same avoiding the weird Objective-C syntax.

Sunday 15 August 2010

VAMP ≈ Web 2.0?

Web 2.0 is a hype based on wish thinking from technically non-knowledgeable commentors that have scratched the surface of web collaboration tools such as google doc, Wikipedia and other wikies. Discounting old and weak standards such as HTML, CSS and JavaScript (an oldish Scheme), there is need of some qualified data and metadata information transfer, and I suspect the VAMP Project might become a replacement of the Good Ole Web. The missing parts are the new browsers, replacing the old web browsers for being protectionistic and obstructing the development of web standards, foremost Gecko/Mozilla who systematically deviate, and Internet Explorer who systematically non-develops and claims "market standard" while not standardizing. To the hell with them! Throw out the old shit and make a new web!

The pilot applications sketched in the VAMP PDF:
  • Museum AstroKiosk
  • Planetarium Visualization
  • Online Sky Navigation Software
  • Desktop Planetarium Software
  • Stellarium
The architecture requires an Astronomy Visualization Metadata (AVM) format and VAMP Server Databases.

I would suggest – in the long run – to consider enhancing the AVM and scope of interest to other sciences.

TODO: write an article at Citizendium (requires an account), or one at Wikipedia.

Saturday 14 August 2010

OpenSource

Using OpenSource repositories and an OpenSource blog, sternons is – as elsewhere stressed – an OpenSource project. That means that the program and all components of it are OpenSource, more specifically GNU LGPL (except the catalogues derived from Public Domain catalogues in publicly available data repositories). Keeping OpenSource and Public Domain where applicable is a compulsive holy moral instituted by God – the Golden Rule, valid in all major and most minor religions.

Added OpenSource licenses in revision 59 (and my copyright in rev 60 which is needed for preserving the copyleft). The development have been relatively down last week due to my administration and some tedious travelling.

When trying to get a clear view over what documentation licenses are used at CDS repository I found almost no information at all, except a few instructions about acknowledgements. The grand exception is the notorious NGC 2000.0 from Sky Publishing Corporation and some dubious notices in the NGC/IC Project making the copyright of the catalogue VII/239A dubious. To be avoided. Instead the NGC-related catalog to be used for "nebulae" is VII/1B (RNGC), which appears to be free.

Saturday 7 August 2010

+Linx I

Added some Astronomical links for:
  1. general public inspiration,
  2. mayhap collaborators,
  3. "competitors" (this is OpenSource, competitors are really passive collaborators), "competition" is welcome, and "competitors" are welcome!
  4. astronomy surfers
Feel free to propose additions!

Friday 6 August 2010

Unit system

Programming languages in general don't deal with the units of the floating point values (real per old Algol terminology), f.ex. when there's an assignment such as
  a := 10.5;
there's no information whether 10.5 is km/h, mph, pixels, Volt or megaGauss. In astronomy there's a need to distinguish between radians, degrees, hours. Furthermore degrees could be expressed in degrees (°) and decimal degrees, or degrees (°), minutes (') and seconds (").

For sternons, I'll try to add units to numbers. The concept is so rare that it's seldomly heard of in programming languages. I don't know whether it is a viable alternative to types – it might be too complex when fully implemented – but some very important projects that failed could have been well served by a unit control implementation.

Revision 55.

Bad skin!!

Blää!
I have to remake the blog by changing the completely inflexible skin called "simple" by  Xxxx Xxxxxxxx . Q: What happens if one resizes the browser window? A: Nothing! Comment: a well designed skin – not an artful fashionably designed one (imagine a tone of strong disgust here) – changes its subwindow sizes when the browser window is resized! "Artful fashionable" trash means low-quality HTML and CSS obviously!

Not very good after modifying the skin to be resizable either: the main trouble is the current choice of red and blue nuances that are prob migrainic for anyone except the most extroverted persons.

Tuesday 3 August 2010

Sternons


Sternons blog created. My programming blog is on Haccationes Rursi, but that one contains personal programming notes on everything, not on the sternons toolset. Also: it is written in Swedish in order to cultivate a Nerdish Swedish, which is not quite suitable for a programming product intended to be used internationally, unless the world — quite hypothetically but factually correct — decides that Swedish is the best language for the development of future science.