How to make a lightning strokes/ square km / day map - maps

I have WWLLN data in .loc format. I have 92 files, from where I need to select the lats and lons (strokes) for +/-30 location only. How can I select this range from 92 .loc files using a loop and how to make a density map ( Lightning Strokes / square km/ day) using Matlab R2017a?

Related

How to represent/read a cube in dxf file?

Trying to open a dxf file format (actual project in C++), I could understand the basic structure of the file, but I can't manage to find how a cube is actually represented.
For a cube in CAD, I expect at least 9 values:
X Y Z position
A B C rotation
W H D size of the cube
I expect X, Y, Z, A, B and C to be in the ENTITY section,
But Looking at example files, I see many settings, the preview image (taking a significant space in the file), layouts, etc.. But nothing that I can match to how the cube is actually build.
Question:
How to represent/read a cube in a dxf file?
More info
Here is the documentation about the file format:
http://help.autodesk.com/view/OARX/2018/ENU/?guid=GUID-235B22E0-A567-4CF6-92D3-38A2306D73F3
Here is an example of file with a cube (created with BricsCAD). Unfortunately, I can't embed the file, as it is too big.
The "cube" is of 20mm x 25mm x 30mm.
https://download.escain.org/example_cube_20_25_30_mm.dxf
I checked LibreCAD source-code, but it does not manage 3D models. Also, libdxfrw library is too generic (it just call the interface callback with the full Entity data).
https://github.com/LibreCAD/LibreCAD_3
https://github.com/LibreCAD/libdxfrw
This cube is embedded binary ACIS data (3DSOLID) and can not be interpreted without the libraries from Spatial Inc. For more information see my answer to another question:
How I can parse nurbs surface from dxf file? Or do you know library(for js, if exists or any other language) for parsing it?
EDIT: Find binary data of ACIS entities
Starting with R2013/AC1027 Modeler Geometry of ACIS data is stored in the section ACDSDATA in a ACDSRECORD these records have no handle, instead they have an ID. The record of your 3DSOLID starts at line 22393 and has the ID 10:
0
ACDSRECORD
90
1
2
AcDbDs::ID
280
10
320
D2 <<< handle to 3DSOLID
2
ASM_Data
280
15
94
9259 <<< size in bytes
310
41534D2042696E61... <<< binary data as multiple tags of group code 310
This is your 3DSOLD with handle D2 which starts at line 2187:
0
3DSOLID
5
D2 <<< handle of your 3DSOLID
330
1F
100
AcDbEntity
8
0
100
AcDbModelerGeometry
290
0
2
{00000000-0000-0000-0000-000000000000}
100
AcDb3dSolid
350
0
As you see there is no association from the 3DSOLID to the binary content as ACDSRECORD in the ACDSDATA section.
I have no knowledge of a table (DICTIONARY) that links this data together. The only way I know is to search all ACDSRECORD in the ACDSDATA section for links (group code 320) to ACIS objects.
FYI: In DXF versions prior to R2013 the ACIS data is stored in the entity itself as ascii text with a lousy xor "encryption". All my Knowledge about the DXF format is baked into my Python package: ezdxf.

how to use the Pivoted Column values in Matrix use in another Tablix and write expressions on top of it

I have one set of data with fields
StudentId, Name , Address in one dataset and being used in one Tablix.
also another set of data: StudentID Subject Marks in another Dataset and using Matrix to Pivot in the Report.
I am able to fetch the Report in this way
StudentID Name Address MAths Physcis Chemistry Median
1 Mike NJ 85 70 90 2
2 David CA 81 85 90 1
I was calculating Median by counting number of Subject Marks greater than 80.
Now how do I use the value of Median in Tablix instead of in Matrix.
Below should be the expected output format
StudentID Median Name Address MAths Physcis Chemistry
1 2 Mike NJ 85 70 90
2 3 David CA 81 85 90
Note: I am using Matrix to Pivot Subject Column in SSRS Report. I am using Pivot operation in SSRS instead of performing in SP because I get 40 columns after Pivoting in SP and need to physically map 40 columns. Here in example I have only given 3 columns(Maths, Physcis and Chemistry).
Also please do let me know if expected output format is at least possible.
Is there any way that I will be able to Pivot Subject Columns inside the Tablix itself instead of using the another Matrix??
Thank you.
There are two ways to typically go about an aggregation like this. If you stick with the two existing datasets, you'll have to use the Lookup or LookupSet functions to get data from the other dataset. For example, if your table/matrix is using the second dataset as it's source, you would Lookup the Name of each student. Keep in mind that this is not efficient for large reports.
The other approach, which I would recommend, is to join these two datasets in SQL and use that as the data source for the report. This is more efficient and makes the report simpler to maintain.
It's good that you are letting the report do the pivoting for you, it works much better that way.

Vlookup max / min of multiple results

I have a list of values in EXCEL
X Y
5 3000
5 3200
5 2800
10 1600
10 2900
10 3500
15 1800
15 4500
I want to get the list of X without duplicates and corresponding MIN / MAX values Y. Something like this for MAX values:
X Y
5 3200
10 3500
15 4500
How do I proceed?
A simple pivot table will do that.
Insert Pivot Table
Drag X to the rows area
Drag y to the Values area twice
Adjust value settings for one Y to MAX
Adjust value settings for one Y to MIN
Have a look at PowerQuery:
Select any cell within your data range.
Click the Data tab, then > From Table/Range.
If prompted, in the From Table dialog box, you can click the Range Selection button to select a specific range to use as a data source.
If the table or range of data has column headers, you can check My table has headers. The header cells are used to define the column names for the query.
Within PowerQuery AKA Get&TransForm
Click the Transform tab, then > Group by.
In the dialog box, click Advanced and under Group by you choose X
Choose a New column name, e.g.: maxVals. Furthermore choose Max as an Operation and under Column you choose Y.
Confirm through OK and close PowerQuery.
You'll now end up with your desired output. Replicate this for the minVals.
For MAX values you could sort your data: column X ascending & column Y descending and then apply an advanced filter (only to column X), checking the option for unique values only for MIN values you repeat the process but specify ascending as the sort order for column Y
Recording macros of these actions will provide you with the VBA code, which you should be able to make dynamic as you are asking your question in a Lecture after the Sections on Variables and Range References.
I hope this will be helpful

Conditional Formatting based on parameter value

I have a report in Report Builder 3.0 which has 2 parameters, #LocalAuthority and #FiscalYear, neither of these are multi value.
The main basis of the report is a matrix which shows certain figures for Wards within a Local Authority
Ward Fig A Fig B Fig C
Springfield 50 60 40
Grange Hill 20 60 90
I want to try and conditional format my figures based on the previous fiscal year. For example if the above table was showing Fiscal Year 2018/19 and the one below is showing Fiscal Year 2019/2020 I want the text to change colour depending whether there has been an increase or not.
Ward Fig A Fig B Fig C
Springfield 60 60 40
Grange Hill 20 60 80
So Springfield Fig A has increased so I would like it to show red and Grange Hill Fig C has decreased so I would like it to show green.
Have tried this as an experiment
=iif(Fields!Fig A.value > Previous(Fields!Fiscal.value),"Yellow","Purple")
but it would seem you are unable to use 'Previous' in a matrix
I would suggest returning this year and last year data on the same row so that the report in Report Builder has the information it needs to display nicely. In this example, "LY" means "Last Year" and "TY" means "This Year". Report Builder can then choose "Yellow" or "Purple".
Ward LY_Fig_A LY_Fig_B LY_Fig_C TY_Fig_A TY_Fig_B TY_Fig_C
Springfield 50 60 40 60 60 40
Grange Hill 20 60 90 20 60 80

Calculating a % rate based on two date dimension in one cube

Set up - SSAS 2012 with OLAP cubes (built by supplier) and MS Report Builder v3. No access to BIDS.
I am building a report which needs to calculate a disposal rate based on data from a single cube. Historically this would have been calculated from two separate tables of data, giving a count by month of new items by date recorded and a count by month of items disposed by month of disposal. This can then be turned to a disposal rate using a lookup or similar.
Blank disposal dates are fine (can take months to dispose of items).
I would like to keep this in a single query so that I can introduce extra dimensions to analyse the data and represent it multiple ways easily. My suspicion is that I need a calculated member but I am not sure where to start with these. Any help would be greatly received - I am trying out a few things and will update this should I solve myself.
Simple formula would be
=(sumif(Items, DateReported="July 2014"))/(sumif(Items, Disposal Date="July 2014"))`
So the following data...
Month Recorded Month Disposed No of Items
May-14 May-14 25
May-14 Jun-14 3
May-14 Jul-14 45
Jun-14 232
Jun-14 Jun-14 40
Jun-14 Jul-14 46
Should produce...
Month No Recorded No Disposed Disposal Rate
01/05/2014 73 25 34%
01/06/2014 48 43 90%
01/07/2014 45 91 202%
My current MDX statement:
SELECT
NON EMPTY { [Measures].[No of Items] } ON COLUMNS,
NON EMPTY
{
([Date Reported].[Calendar Months].[Month].ALLMEMBERS
*
[Disposal Date].[Calendar Months].[Month].ALLMEMBERS )
} ON ROWS
FROM [Items]
You can use LinkMember to move a reference to one hierarchy (like [Date Reported].[Calendar Months]) to another one (like [Disposal Date].[Calendar Months]), provided both hierarchies have the exact same structure. Thus, only using [Date Reported] in your query, the calculation can use [Disposal Date]. The query would be like the following:
WITH MEMBER Measures.[Disposed in Date Reported] AS
(Measures.[No of Items],
LinkMember([Date Reported].[Calendar Months].CurrentMember, [Disposal Date].[Calendar Months]),
[Date Reported].[Calendar Months].[All]
)
MEMBER Measures.[Disposal Rate] AS
IIf([Measures].[No of Items] <> 0,
Measures.[Disposed in Date Reported] / [Measures].[No of Items],
NULL
), FORMAT_STRING = '0%'
SELECT { [Measures].[No of Items], Measures.[Disposed in Date Reported], Measures.[Disposal Rate] }
ON COLUMNS,
[Date Reported].[Calendar Months].[Month].ALLMEMBERS
ON ROWS
FROM [Items]
Possibly, you would want to adapt the column titles in your report. I left that out and used member names that desribe more what they do than what should be shown to users.

Resources