From 13482fa0458b485a810635f1b9b55cd67c056c96 Mon Sep 17 00:00:00 2001 From: Chris Piker Date: Mon, 21 Oct 2024 18:38:55 -0500 Subject: [PATCH] =?UTF-8?q?Removed=20of=20all=20non-mathematical=20=CF=86'?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- das2/property.c | 2 ++ das2/vector.c | 34 +++++++++++++++++----------------- das2/vector.h | 29 +++++++++++++++++++++++------ utilities/das3_spice.c | 24 ++++++++++++------------ 4 files changed, 54 insertions(+), 35 deletions(-) diff --git a/das2/property.c b/das2/property.c index 1989bf9..2353080 100644 --- a/das2/property.c +++ b/das2/property.c @@ -209,6 +209,8 @@ DasErrCode DasProp_init( uFlags |= (DASPROP_REAL | DASPROP_SINGLE); else if(strcasecmp(sType, "realrange") == 0) uFlags |= (DASPROP_REAL | DASPROP_RANGE); + else if(strcasecmp(sType, "realArray") == 0) + uFlags |= (DASPROP_REAL | DASPROP_SET); else if(strcasecmp(sType, "doublearray") == 0) uFlags |= (DASPROP_REAL | DASPROP_SET); else if((strcasecmp(sType, "time") == 0)||(strcasecmp(sType, "datetime") == 0)) diff --git a/das2/vector.c b/das2/vector.c index 515f658..47f97ec 100644 --- a/das2/vector.c +++ b/das2/vector.c @@ -37,11 +37,11 @@ static const char* g_nBuiltDirs[][4] = { { "", "", "", ""}, /* 0x00000000 */ { "x", "y", "z", ""}, /* DAS_VSYS_CART */ - { "ρ", "ϕ", "z", ""}, /* DAS_VSYS_CYL */ - { "r", "θ", "ϕ", ""}, /* DAS_VSYS_SPH */ - { "r", "ϕ", "θ", ""}, /* DAS_VSYS_CENTRIC */ - { "ϕ", "θ", "a", ""}, /* DAS_VSYS_DETIC */ - { "ϕ", "θ", "a", ""} /* DAS_VSYS_GRAPHIC */ + { "ρ", "φ", "z", ""}, /* DAS_VSYS_CYL */ + { "r", "θ", "φ", ""}, /* DAS_VSYS_SPH */ + { "r", "φ", "θ", ""}, /* DAS_VSYS_CENTRIC */ + { "φ", "θ", "a", ""}, /* DAS_VSYS_DETIC */ + { "φ", "θ", "a", ""} /* DAS_VSYS_GRAPHIC */ }; const char* das_compsys_str( ubyte uFT) @@ -96,7 +96,7 @@ ubyte das_compsys_id(const char* sFT) * eastward we might reasonable have principle component tokens from * the frame of: * - * R, θ, ϕ + * R, θ, φ * * Which make it look like these are spherical coordiantes, but they * are not! @@ -112,39 +112,39 @@ const char* das_compsys_desc(ubyte uST) "is (x,y,z). Missing components are assumed to be 0."; case DAS_VSYS_CYL: return "An ISO 31-11 standard cylindrical system. The full componet set " - "is (ρ,ϕ,z) where ρ is distance to the z-axis, φ is eastward " + "is (ρ,φ,z) where ρ is distance to the z-axis, φ is eastward " "angle. Z is assumed to be 0 if missing, ρ assumed to be 1 " "if missing."; case DAS_VSYS_SPH: return "An ISO 31-11 standard spherical system. The full component set " - "is (r,θ,ϕ) where r is the radial diretion, θ is the colatitude " - "(which is 0° at the north pole) and ϕ is the eastward angle. " - "Both θ, ϕ are assumed to be 0° if missing and r is assumed to " + "is (r,θ,φ) where r is the radial diretion, θ is the colatitude " + "(which is 0° at the north pole) and φ is the eastward angle. " + "Both θ, φ are assumed to be 0° if missing and r is assumed to " "be 1 if missing."; case DAS_VSYS_CENTRIC: - return "A spherical system. The full component set is (r, ϕ, θ) where " - "'r' is the radial direction, 'ϕ'' is the eastward direction and " - "'θ' is positive towards the pole. Both 'θ' and 'ϕ' are assumed " + return "A spherical system. The full component set is (r, φ, θ) where " + "'r' is the radial direction, 'φ'' is the eastward direction and " + "'θ' is positive towards the pole. Both 'θ' and 'φ' are assumed " "to be 0° if missing and 'r' is assumed to be 1 if not specified."; case DAS_VSYS_DETIC: return "An ellipsoidal coordinate system defined with respect to a " "reference surface. Normals from the surface do not intersect" "the origin except at the equator and poles. The full " - "component set is (ϕ, θ, a) where 'ϕ' is the eastward angle of a" + "component set is (φ, θ, a) where 'φ' is the eastward angle of a" "point on the reference ellipsoid, 'θ' is the latitude and 'a' " "is the distance outside the ellipsoid along a surface normal. " - "All of 'a', 'θ' and 'ϕ' are assumed to be 0 if absent."; + "All of 'a', 'θ' and 'φ' are assumed to be 0 if absent."; case DAS_VSYS_GRAPHIC: return "An ellipsoidal coordinate system defined with respect to a " "reference surface. Normals from the surface do not intersect" "the origin except at the equator and poles. The full " - "component set is (a, ϕ, θ) where 'ϕ' is the WESTWARD angle of a" + "component set is (a, φ, θ) where 'φ' is the WESTWARD angle of a" "point on the reference ellipsoid, 'θ' is the latitude and 'a' " "is the distance outside the ellipsoid along a surface normal. " - "All of 'a', 'θ' and 'ϕ' are assumed to be 0 if absent."; + "All of 'a', 'θ' and 'φ' are assumed to be 0 if absent."; } return ""; } diff --git a/das2/vector.h b/das2/vector.h index aa063b6..5ca3598 100644 --- a/das2/vector.h +++ b/das2/vector.h @@ -57,17 +57,34 @@ DAS_API const char* das_compsys_desc(ubyte systype); * right-handed triplet */ DAS_API int8_t das_compsys_index(ubyte systype, const char* sSymbol); + +/** Note on Unicode character phi: φ + * + * There are two representations, one is used as a symbol and is normally + * rendered with a straight line. The other is loopy and is preferred + * in mathematical contexts. We use the mathematical one here. In short: + * + * φ, U+03C6, 0xCF 0x86 (utf-8) <------ is the one used. + * ϕ, U+03D5, 0xCF 0x95 (utf-8) <------ is *not* used + * + * To make matters worse, many fonts render *both* characters *the same* + * when they should be distinct. + * + * In the future some way of spelling out 'phi' and 'theta' should be added + * to the library. + */ + /** Given the index of a component in the standard right-handed triplet * get it's standard symbol. * * The standard symbols vary by the vector system type, they are: * * Cartesian: (x, y, z) - * Cylendrical: (ρ, ϕ, z) - * Spherical: (r, θ, ϕ) - * Centric: (r, ϕ, θ) - * Detic: (ϕ, θ, a) - * Graphic: (ϕ, θ, a) + * Cylendrical: (ρ, φ, z) + * Spherical: (r, θ, φ) + * Centric: (r, φ, θ) + * Detic: (φ, θ, a) + * Graphic: (φ, θ, a) * * All arranged to generate a right-handed coordinate system. */ @@ -213,7 +230,7 @@ int das_geovec_dirs(const das_geovec* pThis, ubyte* pDirs); * @param iIndex The component number, must be 0 to number of components - 1 * * @returns a very short string (4 bytes or less, including the null) Typical - * returns are "x", "y", "ϕ", "θ'", etc. + * returns are "x", "y", "φ", "θ'", etc. * * @memberof das_geovec */ diff --git a/utilities/das3_spice.c b/utilities/das3_spice.c index e9b4805..3897ff8 100644 --- a/utilities/das3_spice.c +++ b/utilities/das3_spice.c @@ -97,11 +97,11 @@ void prnHelp() " are assumed. The following list of coordinate systems are supported:\n" "\n" " (cart)esian - Cartesian x, y, z (the default)\n" -" (cyl)drical - ISO 31-11 ρ, ϕ, z\n" -" (sph)erical - ISO 31-11 r, θ, ϕ (θ = colat, North pole @ 0°)\n" -" planeto(centric)- Spherical r, ϕ, θ' (θ' = lat, +lon to East)\n" -" planeto(detic) - Ellipsoidal ϕ, θ',r' (θ' = lat, +lon to East, r' = alt)\n" -" planeto(graphic)- Ellipsoidal ϕ, θ',r' (θ' = lat, +lon to West, r' = alt)\n" +" (cyl)drical - ISO 31-11 ρ, φ, z\n" +" (sph)erical - ISO 31-11 r, θ, φ (θ = colat, North pole @ 0°)\n" +" planeto(centric)- Spherical r, φ, θ' (θ' = lat, +lon to East)\n" +" planeto(detic) - Ellipsoidal φ, θ',r' (θ' = lat, +lon to East, r' = alt)\n" +" planeto(graphic)- Ellipsoidal φ, θ',r' (θ' = lat, +lon to West, r' = alt)\n" "\n" " Full names can be used, but just the portion in parenthesis is sufficient.\n" "\n" @@ -1297,19 +1297,19 @@ DasErrCode _writeLocation(DasDs* pDsIn, XCalc* pCalc, double rTimeShift) if(uSysOut != DAS_VSYS_CART){ /* Convert output coord sys if needed */ switch(uSysOut){ - case DAS_VSYS_CYL: /* ρ,ϕ,z */ + case DAS_VSYS_CYL: /* ρ,φ,z */ reccyl_c(aRecOut, aTmp, aTmp+1, aTmp+2); aTmp[1] *= dpr_c(); /* Always output degrees */ break; - case DAS_VSYS_SPH: /* r,θ,ϕ */ + case DAS_VSYS_SPH: /* r,θ,φ */ recsph_c(aRecOut, aTmp, aTmp+1, aTmp+2); aTmp[1] *= dpr_c(); aTmp[2] *= dpr_c(); break; - case DAS_VSYS_CENTRIC: /* radius (r), long (ϕ), lat (θ) */ + case DAS_VSYS_CENTRIC: /* radius (r), long (φ), lat (θ) */ reclat_c(aRecOut, aTmp, aTmp+1, aTmp+2); aTmp[1] *= dpr_c(); aTmp[2] *= dpr_c(); break; - case DAS_VSYS_DETIC: /* long (ϕ), lat (θ), alt (r') */ + case DAS_VSYS_DETIC: /* long (φ), lat (θ), alt (r') */ recgeo_c(aRecOut, radOut, flatOut, aTmp, aTmp+1, aTmp+2); aTmp[0] *= dpr_c(); aTmp[1] *= dpr_c(); break; @@ -1423,15 +1423,15 @@ DasErrCode _writeRotation(DasDs* pDsIn, XCalc* pCalc, double rTimeShift) /* Convert non-cart output coords, always output degrees */ if(uSysOut != DAS_VSYS_CART){ switch(uSysOut){ - case DAS_VSYS_CYL: /* ρ,ϕ,z */ + case DAS_VSYS_CYL: /* ρ,φ,z */ reccyl_c(aRecOut, aTmp, aTmp+1, aTmp+2); aTmp[1] *= dpr_c(); break; - case DAS_VSYS_SPH: /* r,θ,ϕ */ + case DAS_VSYS_SPH: /* r,θ,φ */ recsph_c(aRecOut, aTmp, aTmp+1, aTmp+2); aTmp[1] *= dpr_c(); aTmp[2] *= dpr_c(); break; - case DAS_VSYS_CENTRIC: /* radius (r), long (ϕ), lat (θ) */ + case DAS_VSYS_CENTRIC: /* radius (r), long (φ), lat (θ) */ reclat_c(aRecOut, aTmp, aTmp+1, aTmp+2); aTmp[1] *= dpr_c(); aTmp[2] *= dpr_c(); break;